![]() |
|
#1
|
|||
|
|||
|
I'm trying to send the model view projection matrix from the CPU side into my shader, but it's not working as expected. I have two objects loaded into my scene, without any transformations: 'box.wrl' and 'ground.osgb'.
1) Sending over the projection matrix seems to mess up the order of rendering. Code:
uniform vec4 S1, S2, S3, S4;
void main()
{
gl_Position = mat4(S1, S2, S3, S4) * gl_ModelViewMatrix * gl_Vertex;
//gl_Position = ftransform();
}
2) I can't get the view matrix to work, or I don't understand how to get it. Code:
uniform vec4 S1, S2, S3, S4;
void main()
{
gl_Position = gl_ProjectionMatrix * mat4(S1, S2, S3, S4) * gl_Vertex;
//gl_Position = ftransform();
}
*Sorry for the double post in Vizard 3.0 forum. I realized I posted on the wrong forum, and also have more useful information this time. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vizard Headlight in Shader | shivanangel | Vizard | 1 | 06-27-2012 02:19 PM |
| SSAO Shader Implementation | FranciscoPeters | Vizard | 2 | 10-08-2011 05:19 AM |
| How to apply shader and render texture to an object | whj | Vizard | 0 | 04-23-2010 01:23 PM |
| Multiple Textures for Diffuse and Specularity Shader Issue | shivanangel | Vizard | 1 | 05-11-2009 11:44 AM |
| Specular Shader Issue | shivanangel | Vizard | 2 | 05-06-2009 12:08 PM |