Sign in to follow this  

Another question for incoherent material displayed against the original model

Recommended Posts

I just spend some time on going back to the fixed pipeline because of the deadline of the project.
I'd like to know why the materials would not look exactly the same as the original model exported.
I have a character model which has a blue upper body and a yellow pant.
Direct3D would display it as entirely yellow. Here is another code snippet/snapshot.
m_pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
m_pDevice->SetRenderState( D3DRS_ALPHATESTENABLE, true );

m_pDevice->SetRenderState( D3DRS_SRCBLEND , D3DBLEND_SRCALPHA );
m_pDevice->SetRenderState(D3DRS_ZENABLE, true);
m_pDevice->SetRenderState(D3DRS_ZWRITEENABLE, true);
m_pDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_COLORVALUE(0.5, 0.5, 0.5, 1.0));

m_pDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);

// normalize since objects are being scaled therefore normals aren't correct anymore
m_pDevice->SetRenderState(D3DRS_NORMALIZENORMALS, true);

m_pDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
m_pDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
m_pDevice->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR );
m_pDevice->SetRenderState(D3DRS_LIGHTING, true);

m_pDevice->LightEnable(DIRECTIONAL, true);


std::vector<COperator>::iterator it, itEnd = pDoc->m_OperatorObj.end();
for (it = pDoc->m_OperatorObj.begin(); it != itEnd; it++) {


I probed the materials values just right before drawsubset was called, I found the values to be correct.
Any ideas why the difference might occur?

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