Jump to content
  • Advertisement
Sign in to follow this  
EasyCoder

Unexplainable Change of Texture Colour

This topic is 2545 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

I am doing colour picking of a textured object.

Picking works fine, but when I do this...


gl.glDisable(GL10.GL_TEXTURE_2D);
gl.glDisable(GL10.GL_DITHER);
gl.glDisable(GL10.GL_LIGHTING);
gl.glDisable(GL10.GL_LIGHT0);

// Apply the colour mask for colour picking

// Draw the textured object 1st time

// Read the colour mask

gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glEnable(GL10.GL_DITHER);
gl.glEnable(GL10.GL_LIGHTING);
gl.glEnable(GL10.GL_LIGHT0);

// Draw the textured object 2nd time - this time without the colour mask
(unfortunately, it has to be drawn twice within a single frame, as otherwise flashing of the colour mask ensues)


...then the flashing of the colour mask does not happen, but the texture of object changes colour slightly (i.e. darkens slightly) and stays like this from now on (i.e. does not flash between former lighter colour and later dark colour).

Anybody any idea why is this happening and how I can stop the darkening of texture ?

I have tried everything and now I am at my wits' end.

Obviously this renders the whole colour picking method unusable :(

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!