PDA

View Full Version : brightening a texture with glcolor



PeterHer
04-04-2013, 04:41 AM
Hi All,

I have the following code which allows me to dim/color a texture:
glColor4ub(FColor.Red, FColor.Green, FColor.Blue, FColor.Transparency);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
If Invert = True
Then glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND) // Inverted
Else glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // Normal
glBindTexture(GL_TEXTURE_2D, RenderImage_FixedImage.TileImage.TileMapTex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, FFilter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, FFilter);
TC.X1 := 0.0; TC.Y1 := 0.0;
TC.X2 := 1.0; TC.Y2 := 0.0;
TC.X3 := 1.0; TC.Y3 := 1.0;
TC.X4 := 0.0; TC.Y4 := 1.0;
TRenderScene(LCL_RenderScene).DrawQuadTC(......... ..........
glBindTexture(GL_TEXTURE_2D, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);

Now I am wondering if it is possible not to dim but to brightening the texture.
I can not use glColor4ub which can only handle values from 0 to 255.

Any idea how I can brightening a texture?

Thanks in advance.

Peter

Carmine
04-04-2013, 10:07 AM
Have you tried simply turning off lighting for that object?