Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX Specular issue (no shaders)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Jcoose   Members   -  Reputation: 127

Like
0Likes
Like

Posted 19 June 2012 - 07:06 PM

Posted Image


I can't figure out why my specular is so blown out. I can't seam to adjust the color or the power in the material either. When I change the value they do nothing. I'm using a directional light with the Specular color turned to white.



[source lang="cpp"] gDxDevice->SetFVF(D3DFVF_XYZ|D3DFVF_NORMAL); ZeroMemory(&material, sizeof(D3DMATERIAL9)); material.Diffuse = D3DXCOLOR(0.2f, 0.5f, 0.7f, 0.5f); // set diffuse color to white material.Ambient = D3DXCOLOR(0.5f, 0.5f, 0.5, 0.5); // set ambient color to white material.Specular.r = 0.5f; material.Specular.g = 0.5f; material.Specular.b = 0.5f; material.Specular.a = 0.5f; material.Power = 100; gDxDevice->SetRenderState( D3DRS_SPECULARENABLE, FALSE ); gDxDevice->SetMaterial(&material); //gDxDevice->SetRenderState(D3DRS_AMBIENT, D3DXCOLOR(0.1f, 0.1f, 0.1f, 0.1f)); gDxDevice->SetRenderState( D3DRS_LIGHTING, TRUE ); gDxDevice->SetRenderState(D3DRS_SPECULARMATERIALSOURCE, D3DMCS_MATERIAL); gDxDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW); //gDxDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); gDxDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 8, 0, 25996);[/source]

Sponsor:

#2 Jcoose   Members   -  Reputation: 127

Like
2Likes
Like

Posted 19 June 2012 - 07:46 PM

I figured it out. My normal's weren't normalized. I did some math to check when I import them and it works now.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS