Game Development Community

World matrix

by Westy · in Torque Game Engine Advanced · 08/18/2004 (5:55 am) · 2 replies

Im trying to do a diffuse lighting shader, but the method requires a world view projection matrix , and a world matrix.

Now i can get the projection matrix from VC_WORLD_PROJ, but what is a 'world matrix' and how do i access it in the shader? The concerning line is:

Out.Norm = normalize(mul(Normal, matWorld)); // transform       Normal and normalize it

matWorld is described as the world matrix, but what is this in TSE? and how do i access it?

#1
08/18/2004 (6:43 am)
Ok looking through source i see where VC_WORLD_PROJ is set as modelview, but i dont see where its actually assigned its value.

And and see no shader declaration for world matrix. :(
#2
08/18/2004 (7:28 pm)
I belive the normal for the vertex is already multiplied by the world Matrix

In my diffuse vertex lighting model I get the normal vector like so
float3 normalVec =  In.normal;

All the calculation are done in the vertex shader so I don't pass it along.

As for VC_WORLD_PROJ there are several parts of TSE that have not be fully implimented, I presume this is one of such things.

I hope this helps