Hello,
I have the answer of my question. My mistake was that the lines...
gl_TexCoord[1].s = gl_TexCoord[1].s / gl_TexCoord[1].q / 2 + 0.5;
gl_TexCoord[1].t = gl_TexCoord[1].t / gl_TexCoord[1].q / 2 + 0.5;
...musst into the fragment shader.
Cheers,
Martin
Am Donnerstag, den 02.07.2009, 15:19
Hello,
I try "projective texturing" and I didn't use the TexGen. Also I use a
shader. And in the vertex shader I do this:
gl_TexCoord[1] = ( projMat * viewMat * gl_Vertex );
gl_TexCoord[1].s = gl_TexCoord[1].s / gl_TexCoord[1].q / 2 + 0.5;
gl_TexCoord[1].t = gl_TexCoord[1].t / gl_TexCoord[1].q /
Hi Ulrich,
thank you very much. You gave me the right hint to solve my problem.
I just added the texture matrix and everything worked as expected:
Code:
/* set Texture matrix*/
osg::TexMat* texMat = new osg::TexMat;
osg::Matrix mat;
osg::Vec3 projectorPos = osg::Vec3(0.0f,
Hi Johannes,
On 30/5/09 7:59 PM, Johannes Schüth wrote:
when i'm using shaders instead of fixed functionality to create projective
textures the
resulting texture mapping is a tiny spot in the center of the terrain model.
If i disable the shaders by removing the follwing line i get a correct
p
Hi,
when i'm using shaders instead of fixed functionality to create projective
textures the resulting texture mapping is a tiny spot in the center of the
terrain model.
[Image: http://www.jotschi.de/download/osg/projection_shader.jpg ]
If i disable the shaders by removing the follwing line i g
Managed to achieve Projective Texturing in shader - just changed the
gl_TexCoord[0].q = 1.0 to dot( ecPosition,gl_EyePlaneQ[0];
so:
gl_TexCoord[0].s = dot(ecPosition, gl_EyePlaneS[0]) ;
gl_TexCoord[0].t = dot(ecPosition, gl_EyePlaneT[0]) ;
gl_TexCoord[0].p = dot(ec
Thanks for your help Sebastian, I'm using texgen->setPlanesFromMatrix
to set up eye-planes. I assume that's correct (looking at osgspotlight
and other examples..)
Regards
On Mon, 2008-04-14 at 08:37 +0200, Sebastian Messerschmidt wrote:
> Hi Paul,
>
> In the vertex shader try this
> vec4 e
Hi Paul,
In the vertex shader try this
vec4 ecPosition = gl_Vertex * gl_ModelViewMatrix;
gl_TexCoord[0].s = dot(ecPosition, gl_EyePlaneS[0]) ;
gl_TexCoord[0].t = dot(ecPosition, gl_EyePlaneT[0]) ;
gl_TexCoord[0].p = dot(ecPosition, gl_EyePlaneR[0]);
gl_TexCoord[0].q = 1.0;
Hi,
I need some advice on projective texturing. I can get it going in Fixed
Functionality - however not on the GPU.
I've set up a texGenNode and passing the matrix as a uniform to the
shader. I'm also passing the ViewMatrix but sufficed to say I'm not
getting the desired effect.
Any advice wo
9 matches
Mail list logo