Hi, To Jason Daly,
Thank you for your reply. In my case, I record positions of the vertexes in eye coordinate in vertex shader, and I want the rasterization to perform the linear interpolation function with eye coordinate so that I can get the position value of certain "vertex produced by interpolation". In a nutshell, I want to change the way how opengl interpolates such attributes as those defined by "varying variables" in vertex shader. So from your reply, only texture coordinates can be generated in different ways. As to general attributes, one has no way to change the interpolation method performed on them? Can I at least get to know, if can not change, the interpolation method used by the openGl in my implemention? Thank you. Shuiying Message: 16 Date: Tue, 10 Jan 2012 15:00:12 -0500 From: Jason Daly<jd...@ist.ucf.edu> To: OpenSceneGraph Users<osg-users@lists.openscenegraph.org> Subject: Re: [osg-users] Help:How to control rasterization stage through osg? Message-ID:<4f0c98cc.8010...@ist.ucf.edu> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed 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