• Advertisement
Sign in to follow this  

Another question for incoherent material displayed against the original model

This topic is 2448 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,
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_DESTBLEND, D3DBLEND_INVSRCALPHA) ;
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);

pDoc->WHObj->Render();

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




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?
Thanks
Jack

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement