Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualNik02

Posted 24 May 2013 - 04:01 AM

The problem is not within that shader. That is a simple generic transformation that expects the WVP matrix in the constant registers 0...3, and that the incoming vertex has position and color elements. It doesn't care at all whether the transformation represents rotation or something else entirely.

 

Have you tried to transpose the WVP matrix before using SetVertexShaderConstantF? The m4x4 is a macro instruction that is implemented as four dp4:s across consecutive float4 registers on the drivers/hardware, and due to this the transpose is needed if using D3DX matrix utility functions to generate the transform.

 

The transpose is cheaper to do once on the host program, as opposed to running it on each vertex.


#1Nik02

Posted 24 May 2013 - 03:58 AM

The problem is not within that shader. That is a simple generic transformation that expects the WVP matrix in the constant registers 0...3, and that the incoming vertex has position and color elements. It doesn't care at all whether the transformation represents rotation or something else entirely.

 

Have you tried to transpose the WVP matrix before using SetVertexShaderConstantF? The m4x4 is a macro instruction that is implemented as four dp4:s across consecutive float4 registers on the drivers/hardware, and due to this the transpose is needed if using D3DX matrix utility functions to generate the transform.


PARTNERS