Jump to content

  • Log In with Google      Sign In   
  • Create Account

Location of D3DTS_WORLD value in register


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Tunisia hawker   Members   -  Reputation: 160

Like
0Likes
Like

Posted 27 August 2012 - 12:03 AM

I wonder if I can get world matrix in shader using register.I wrote this in C++ and used a fixed pipeline:
[source lang="cpp"]g_pd3dDevice->SetTransform(D3DTS_WORLD, &matWorldSave);[/source]
Now I want to add a shader,and use world matrix without changing code above.For example,I can use register s0 to represent the first texture in shader.Which register should I use?

Sponsor:

#2 Nik02   Crossbones+   -  Reputation: 2918

Like
1Likes
Like

Posted 27 August 2012 - 12:15 AM

Shaders don't have access to the fixed-function matrices.

You can use IDirect3DDevice9::SetVertexShaderConstantF method to set the matrix to the vertex shader constant registers. A 4x4 matrix is effectively just an array of 16 floats.

Niko Suni


#3 Tunisia hawker   Members   -  Reputation: 160

Like
0Likes
Like

Posted 27 August 2012 - 07:18 PM

Thanks! I'll change my code anyway.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS