HI Gerrick, I have only drivers so I'll go get the latest and hope that they don't break anything else along the way.
Cheers, Robert. On 5/31/07, Gerrick Bivins <[EMAIL PROTECTED]> wrote:
Hi Robert, We have done this in our app and used the section of the code that you have in the #else section without problems EXCEPT we had to use beta drivers on linux (RHEL_4 at the time) for a while. This was probably up until around Jan/Feb when nvidia released new drivers. Now things are working fine with the lastest released drivers. The only difference we have in our code is that we multiply gl_TexCoord[*] by gl_TextureMatrix[*] { ... gl_TexCoord[1].s = dot(ecPosition, gl_EyePlaneS[1]); gl_TexCoord[1].t = dot(ecPosition, gl_EyePlaneT[1]); gl_TexCoord[1].p = 0.0; // dot(ecPosition, gl_EyePlaneR[1]); gl_TexCoord[1].q = 1.0; //dot(ecPosition, gl_EyePlaneQ[1]); gl_TexCoord[1]*=gl_TextureMatrix[1]; ... } but if that's identity in your case, you shouldn't have to do this. biv On 5/31/07, Robert Osfield <[EMAIL PROTECTED]> wrote: > > Hi All, > > Today I've trying to get a GLSL program to generate tex coords in the > same way as non shader texgen works. I've read up the orange book on > the topic, and also searched the web for inspriation, and what I've > written look like should work, but it doesn't :-| > > The vertex program I've kept simple so far and looks like > > void main (void) > { > gl_Position = ftransform(); > gl_FrontColor = vec4(1.0,1.0,1.0,1.0); > gl_TexCoord[0] = gl_MultiTexCoord0; > > vec4 ecPosition = gl_ModelViewMatrix*gl_Vertex; > > #if 1 > gl_TexCoord[1] = ecPosition * mat4(gl_EyePlaneS[1], > gl_EyePlaneT[1], > gl_EyePlaneR[1], > gl_EyePlaneQ[1]); > > gl_TexCoord[1].p = 0.0; > gl_TexCoord[1].q = 1.0; > #else > > gl_TexCoord[1].s = dot(ecPosition, gl_EyePlaneS[1]); > gl_TexCoord[1].t = dot(ecPosition, gl_EyePlaneT[1]); > gl_TexCoord[1].p = 0.0; // dot(ecPosition, gl_EyePlaneR[1]); > gl_TexCoord[1].q = 1.0; //dot(ecPosition, gl_EyePlaneQ[1]); > > #endif > // gl_TexCoord[1] = gl_MultiTexCoord0; > } > > > The two parts of the #if #else #endif work identically, if I comment > out the resetting og the p and q values I have what I think is correct > code, but the generated tex coords are clearly wrong as I don't any > valid texture being accessed. By adding the p and q setting in I do > at least get half sensible values, but there still are not correct as > distortion occurs as I change the eye point. > > glxinfo gives me: > > OpenGL vendor string: NVIDIA Corporation > OpenGL renderer string: GeForce 7800 GT/PCI/SSE2 > OpenGL version string: 2.0.2 NVIDIA 87.62 > > > I am not setting the fragment program yet, so it should be the > standard OpenGL fixed function pipeline for the shader. > > Any ideas? > Robert. > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/