• Advertisement
Sign in to follow this  

RenderMonkey: matrix packing option

This topic is 3962 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 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
Advertisement
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
yes you can do that but it involves transposing the matrix every time (possibly many times per frame) which is an overhead to take into consideration.

Share this post


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

  • Advertisement