DGL https://delphigl.com/forum/ |
|
Disabling GL_COLOR_MATERIAL https://delphigl.com/forum/viewtopic.php?f=19&t=3625 |
Seite 1 von 1 |
Autor: | BTierens [ Fr Dez 31, 2004 11:27 ] |
Betreff des Beitrags: | Disabling GL_COLOR_MATERIAL |
Hello, Is this a good way to disable GL_COLOR_MATERIAL? Or is there a better way? Code:
Doing the following doesn't works because when calling glEnable(GL_COLOR_MATERIAL), OpenGL affects the last know color to the last known material. Code:
|
Autor: | Flash [ Fr Dez 31, 2004 13:31 ] |
Betreff des Beitrags: | |
![]() (Maybe 2 little Screenshoots whould be fine...) |
Autor: | BTierens [ Fr Dez 31, 2004 15:16 ] | ||
Betreff des Beitrags: | |||
1: Code:
The glColor3f(0.5,0.5,0.5); changes the color of the light on the textured polygons. I don't think this is a good solution. 2: Code:
Everything gets a yellow shine and some parts of the landscape aren't lighted (or how do you say that in English).
|
Autor: | rswm [ Fr Dez 31, 2004 19:14 ] |
Betreff des Beitrags: | |
set an glcolor with 1,1,1 then there shouldn't be this yellow color in there .... the lighting ... hmmm ... perhaps its works when you set that glcolor thing ... perhaps *g* PS: please delete all these glenable(gl_color_material), gldisable(...) and only write at the beginnging of your renderingprocedure (after glclear and so) gldisable(gl_color_material) if ther is an error after doing this please send a new screenie *g* |
Autor: | BTierens [ Mo Jan 03, 2005 09:50 ] | ||
Betreff des Beitrags: | |||
When I try that, the yellow shine is gone, and the lighting too...
|
Autor: | Sascha Willems [ Mo Jan 03, 2005 10:34 ] |
Betreff des Beitrags: | |
After using glColorMaterial you may have to reset the ambient and diffuse parts of the lighting, as they are influenced by GL_COLOR_MATERIAL (I guess they're both set to 1/1/1, which would explain why it seems there is no more lighing). So this should work : Code:
|
Autor: | BTierens [ Mo Jan 03, 2005 11:54 ] | ||
Betreff des Beitrags: | |||
The lightAmbient and lightDiffuse were 1/1/1 by default: Code:
Now I'm using your ambient and diffuse parameters because they give a good lighting. The yellow shine is gone, the landscape is lighted, but there is still a difference in lighting (but that's not that bad) Thanks for your help.
|
Autor: | BTierens [ Di Jan 04, 2005 13:53 ] |
Betreff des Beitrags: | |
I've found another solution were there is no difference between using GL_COLOR_MATERIAL and not using GL_COLOR_MATERIAL. You should reset all material parameters with glMaterialfv to their default values or to your initial values. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |