RenderMonkey: matrix packing option

Started by
2 comments, last by treeway 17 years, 2 months ago
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
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.
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.
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.

This topic is closed to new replies.

Advertisement