Hi there
Strange problem:
vec4 temp = (gl_ModelViewProjectionMatrix * Position);
gl_Position = temp;
This code compiles, links AND works fine.
By putting temp.w into color i can confirm, that its value is 1;
vec4 temp = (gl_ModelViewProjectionMatrix * Position);
temp.w = 1.0;
gl_Position = temp;
This code compiles and links fine, but DOESN’T SHOW ANYTHING! My mesh simply disappears!
It is not just this situation, this is just the simplest case to show the problem. In fact i can never see my mesh, as long as i touch the w component of the vector that gets copied into gl_Position.
Ie:
vec3 temp = (gl_ModelViewProjectionMatrix * Position).xyz;
gl_Position.xyz = temp.xyz;
gl_Position.w = 1.0;
This does not show my mesh neither.
I should add, that my vertex-shader runs in software, because i use a loop, which is not supported on my Radeon 9700.
So it might be the fault of the software-vertexshader.
Can anyone confirm this? Is there a workaround?
The problem is, i want to use quaternions in my shader, and my quaternion does not generate a w-component of my resulting position, so i need to manually set it to 1.0, which then results in my mesh disappearing.
However, the code i use to test it, still uses matrices, which do create a w-component.
Jan.