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?
Location of D3DTS_WORLD value in register
Started by Tunisia hawker, Aug 27 2012 12:03 AM
2 replies to this topic
Sponsor:
#2 Members - Reputation: 2032
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.
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
Software developer
Software developer






