Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Something wrong with default Materials settings in QNX's OpenGL ES: (8 Items)
   
Something wrong with default Materials settings in QNX's OpenGL ES  
When FLAT or SMOOTH shading is enabled, there are no any shading performed if lighting is enabled via 
glEnable(GL_LIGHTING). Looks like QNX's OpenGL ES implementation have wrong initial values for materials. GL ES specs 
says:
GL_AMBIENT must be set to (0.2, 0.2, 0.2, 1.0).
GL DIFFUSE must be set to (0.8, 0.8, 0.8, 1.0).
GL_SPECULAR must be set to (0, 0, 0, 1).
GL EMISSION must be set to (0, 0, 0, 1).
GL SHININESS must be set to 0.

Or if no any of material parameters are set QNX's OpenGL ES implementation switches off materials or they are not used 
in the lighting equation if they are not set.
Re: Something wrong with default Materials settings in QNX's OpenGL ES  
Can you provide a small example that shows this ?

Some things to verify:

-Did you provide a valid glNormalPointer before issuing glDrawArrays
-Is the GL_NORMAL_ARRAY enabled with glEnableClientState
-What is the GL_MODELVIEW_MATRIX used
-Is fog/texturing enabled or disabled
Re: Something wrong with default Materials settings in QNX's OpenGL ES  
> Can you provide a small example that shows this ?

Yes, within one day.

> -Did you provide a valid glNormalPointer before issuing glDrawArrays

Yes, I have tried to setup global glNormal3f() and per-vertex normals via glNormalPointer - there is no difference.

> -Is the GL_NORMAL_ARRAY enabled with glEnableClientState

In case if glNormalPointer used, yes, it is enabled.

> -What is the GL_MODELVIEW_MATRIX used

Sorry, but I have no my example sources right now.

> -Is fog/texturing enabled or disabled

Fog is disabled, and there is no difference in shading (no shading) nor when texturing is enabled nor is disabled.
Re: Something wrong with default Materials settings in QNX's OpenGL ES  
Argh, you can test it easy by commenting out three glMaterial calls in the gf-ph-3d example. In this case default 
material settings must be used.
Re: Something wrong with default Materials settings in QNX's OpenGL ES  
Etienne, could you comment this issue, because problem still persist.
Re: Something wrong with default Materials settings in QNX's OpenGL ES  
What happens if you manually set the light and material state to the default values ?
Re: Something wrong with default Materials settings in QNX's OpenGL ES  
> What happens if you manually set the light and material state to the default 
> values ?

If I set material settings (AMBIENT and DIFFUSE) to default values, shading begins to work correctly.
Re: Something wrong with default Materials settings in QNX's OpenGL ES  
> If I set material settings (AMBIENT and DIFFUSE) to default values, shading 
> begins to work correctly.

Any news ?