Thanks Ulrich and Jason,

Originally I was thinking of something that would load a texture and modify 
everything with a certain hue (eg everything with a given hue is set to a 
different hue at runtime).  Sounds like there aren't any existing tools for 
something like that (though it wouldn't be that hard to write).

I'll pursue the other option of setting a material on the geometry.  This makes 
things slightly more complicated because the geometry must use 2 separate 
materials which our current models don't have.  Thus I'll have to specifically 
edit/create each of our models with the different materials.

PS Shaders are a difficult option because we will likely be running our 
software on machines that don't support the new shader stuff...  That's the 
only reason I wanted to stay away.

Thanks!
-Brad

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Ulrich Hertlein
Sent: Saturday, July 18, 2009 12:34 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Runtime texture mod

On 17/7/09 6:14 PM, Brad Huber wrote:
> Does anyone know of a good way to modify pixels in a texture at runtime
> w OSG?
>
> Basically I’m looking for a way for the user to select an arbitrary
> color to be used on an airplane or similar. EG ability to switch to any
> color as in the attached image.

 From what you're saying it sounds like you really only need to modify the 
object base 
colour, using one of the techniques that Jason suggested.

If you *really* want to modify individual pixels in a texture you can use 
Image::data() to 
get a pointer to the image data and modify that directly.  It might be a bit 
tricky since 
you have to take the Image format into account.  Call Image::dirty() when 
you're done with 
the modification to upload the new data to the texture.

Cheers,
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to