On 01/10/2012 02:55 PM, wang shuiying wrote:
Hello,

we know that in openGL rendering pipeline, there is a stage called
rasterization after per-vertex operation and before per-fragment
operation. In rasterization stage, openGl generates certain properties
(e.g. texture coordinates)for each fragment as a linear function of the
eye-space or object-space or windows space coordinates.  My question is
, how to check which coordinate is used in osg implementations? And how
to change the coordinate that is used?

The per-fragment attributes you're talking about are just interpolated from the same attributes that are assigned to the surrounding vertices. AFAIK, there's no way to change how these are computed, even with shaders (they're just simple linear interpolations).

It sounds like you might actually be talking about TexGen (texture coordinate generation), which in the fixed-function world can be set to OBJECT_LINEAR, EYE_LINEAR, SPHERE_MAP, NORMAL_MAP, or REFLECTION_MAP. TexGen will automatically compute the texture coordinates on the vertices (which will then be interpolated for each fragment, as mentioned above). In OSG, the TexGen StateAttribute controls texture coordinate generation. If you're using shaders, it's up to you to do the texture coordinate generation math yourself.

--"J"

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to