Flat Shading is ignored

Started by
3 comments, last by TomKQT 12 years, 3 months ago
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?
Advertisement
Screenshots?
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.
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!
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).

This topic is closed to new replies.

Advertisement