Sign in to follow this  

Location of D3DTS_WORLD value in register

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

This topic is 1968 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this