Jump to content
  • Advertisement
Sign in to follow this  
aprilspirit89

Location of D3DTS_WORLD value in register

This topic is 2125 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

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!