Jump to content
  • Advertisement
Sign in to follow this  
schupf

Flat Shading is ignored

This topic is 2525 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 wanted to try out Flat Shading in my DX9 app and tried to activate it with this line:

HRESULT hr = mDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT);
hr is S_OK.

But my 3D world looks exactly the same. All the polygons are textured and look as if rendered with D3DSHADE_GOURAUD.

Does anyone know why setting the shade mode to Flat does not change anything in my rendering?

Share this post


Link to post
Share on other sites
Advertisement
Are you using the fixed function pipeline or shaders?
If I'm not mistaken, D3DRS_SHADEMODE affects only attributes with D3DDECLUSAGE_COLOR, so if you were calculating the color in a pixel shader, the shademode could really make no difference.

Share this post


Link to post
Share on other sites
I only use Pixelshaders. Interesting, so when using shaders the render state D3DRS_SHADEMODE has no effect. Did not know that. Thanks for your answer Tom KQT!

Share this post


Link to post
Share on other sites
I had a bad feeling about it, but wasn't sure. I found it here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb147365%28v=vs.85%29.aspx
(Approx. in the middle of the page, under Fog, Depth and Shading Mode Changes).

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!