Members - Reputation: 160
Posted 27 August 2012 - 12:03 AM
[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?
Crossbones+ - Reputation: 3971
Posted 27 August 2012 - 12:15 AM
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.