From: Vincent Pasqualato (vincent.pasqualato++at++oktal.fr)
Date: 09/07/2005 00:51:09
Hi !
Trying to combine a shader program written in GLSL with a Performer scene
graph, we discovered that rendering an flt object with faces which are flats
(no gouraud/interpolation, no vertex normals) gives us strange results :
The flt loader seems to try some computation of vertex normals, because
there is a variation of the normal we get from Open GL (in gl_Normal
parameter of the shader program) across the faces. Plus, this interpolation
is buggy, resulting in very strange patterns of normals on the object.
If we transform our object in gouraud, and pre-compute the vertex normals,
the rendering is OK, except we don't get the flat faces we would want.
Does anyone have a suggestion about this behaviour ? Is there an option to
deactivate this normal computation ? Or is it correct, assuming the classic
OpenGL pipeline doesn't take into account vertex normals when rendering flat
faces ?
Also, another problem with flt loader and Shaders is the fact that the
loader seems to make some pre-computation on vertex colors and face
materials : vertex colors seems to be multplicated by the diffuse color of
the faces, and ambient and diffuse color of the face seem also to be
affected by the color of the vertex. Although this doesn't affect classic
OpenGL rendering, it is incompatible with our shader, which make a different
use of this colors and need them untransformed.
This behaviour must be related to a type of optimization which was valid in
the early days of OpenGL, when graphic cards were a lot less powerful, but
now that we try to use every bit of information we can put in the scene
graph, it is very annoying.
Is there a possibility, like a global variable, to deactivate this behaviour
?
Thank you for your help.
Vincent PASQUALATO
R&D Engineer.
OKTAL SE.
This archive was generated by hypermail 2b29 : Wed Sep 07 2005 - 00:52:53 PDT