Sign in to follow this  
aprilspirit89

Location of D3DTS_WORLD value in register

Recommended Posts

aprilspirit89    160
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
Nik02    4348
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

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