Sign in to follow this  
tokaplan

RenderMonkey: matrix packing option

Recommended Posts

Hi everyone, Could somebody please explain the meaning behind matrix packing option of ATI's RenderMonkey? How should I set it to get Direct3D behaviour (multiplying row vector by matrix, not matrix by column vector to get a vertex from world to projection space)? Thanks

Share this post


Link to post
Share on other sites
Hi

Im not sure about matrix packing but one way to get around the RenderMonkey exproted fx files is to swap over the perameters to the mul() function when multiplying matrices. This has the effect of transposing the result.

e.g.
in render monkey:
mul(WorldViewProjMatrix,in.Pos);
in the effect file:
mul(in.Pos,WorldViewProjMatrix);

thats how I do it, but I agree it would be better if RenderMonkey were doing the same thing as directX all along.

EDIT:

i just found in a book im reading (Complete Effect an HLSL guide) that you can also do this:
#pragma pack row_major or col_major
with col as the default.
I dont know if it will work in render monkey but its worth a shot.

Share this post


Link to post
Share on other sites
I've noticed it works exactly the Direct3D way if matrix packing is set to column major. But there's also the third way - you can substitute SetMatrix method to SetMatrixTranspose in the effect framework.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this