Advertisement Jump to content
Sign in to follow this  

Vertex Shader Question

This topic is 4499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Im working on my effect class. When i make a shader in Rendermonkey e.g. this code from my skybox

   Out.Pos = mul(matWorld, float4( +, 1));

where the matWorld is the WorldViewProjection matrix. this positions the skybox around the camera. okay. but when i exprot the effect, I have to swap over the code so that its:

   Out.Pos = mul(float4( +, 1)matWorld);

The way i bind the matricies in my effect class is as follows

matrix = worldMatrix; 

alright it works fine as long as i swap over the order of the world matrix in the shader before using it, but this means that i have to do that every time i export an effect. Does anyone know the reason why this would be the case? thanks

Share this post

Link to post
Share on other sites
This is all todo with whether you matrices are column-major or row-order. Its compile option in the HLSL compiler. If your implementation does not match what the FX expects you either have to transpose your matrices before you send to the shader (an unnessacary expense) or swap the order you do your matrix multiply.

I don't know about rendermonkey but Nvidia FX composer has an option to swap row/column order.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!