Sign in to follow this  
Toto

D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR

Recommended Posts

Toto    122
I´m tryng to implement env map (reflection) in the fixed pipeline like this:

   ZeroMemory(&stReflecMatrix, sizeof(D3DXMATRIX));
   stReflecMatrix._11 = 0.5f;
   stReflecMatrix._22 = -0.5f;
   stReflecMatrix._41 = 0.5f;
   stReflecMatrix._42 = 0.5f

   m_poD3DInterface->SetTransform(D3DTS_TEXTURE0, &stReflecMatrix);
   m_poD3DInterface->SetTextureStageState(0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR);
   m_poD3DInterface->SetTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2);


It works, but just in a spherical object, because it isnt taking in to account the camera position, just the pos and normal of the vertex. Someone know how can it be done using the camera position?

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