Sign in to follow this  
EasyCoder

Unexplainable Change of Texture Colour

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. [i]does not[/i] 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this