• Advertisement
Sign in to follow this  

Changing Texture Color

This topic is 4249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, I am using Sun Texture in my game.But I want to change the texture color to yellow at the end of day bcoz sun's color change as time passes.Can anyone plz tell me how do I change the texture color from white to yellow or light yellow as time passes. thanks and regards.

Share this post


Link to post
Share on other sites
Advertisement
u can change R G B of the pixel on the texture if u use programmable-shader.

Share this post


Link to post
Share on other sites
D3DXFillTexture() and D3DXFillTextureTX() might be options; failing that just go for the usual LockRect() method.

More details might be useful - what language/API are you using? Is the texture a solid colour mapped to a sphere (or similar) or is it an image that you need to adjust the hue for?

Cheers,
Jack

Share this post


Link to post
Share on other sites
A greyscale texture is easy to change to another colour by multiplying it with the colour. In the fixed function pipeline this would normally be achieved by modulating with the texture factor. In shaders it's just multiplication with a constant.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement