   Direct X9 Vertex shader and flat shading
  Just a quick question, if I use a vertex shader to calculate my lighting at the vertex''s to get my model smooth shaded do I need to write a pixel shader, or should I be able to get the normal pipeline do it.At the moment when I render my object they come out flat shaded, so every vertex stands out and you can see all the trianglesThanks in advanceSoul  
  A triangle will be flat shaded if lighting is off and you provide your own vertex colors, or if lighting is on and the corner points of the triangle have the same normal.If the vertices of a triangle have different normals then the second stage (pixel shader) will interpolate the normal along the surface and calculate the pixel color based on that.So it''s possible to have smooth shading when using the default pipeline, or only a vertex shader and the default pixel shader (by not specifying one), or both vertex and pixel shaders. ;  Thanks Fidelio, That''s what I wanted to hear So I can get the default pixel shader to interpolate my vertex shader generated normalsSoul. ;  Whether you provide colors, or D3D creates them via lighting doesn''t matter.  Whether you use the fixed pipe or vertex shader doesn''t matter.  You don''t need a pixel shader.Maybe you''ve set D3DRS_SHADEMODE to D3DSHADE_FLAT.Maybe you''ve created extra vertices rather than sharing them between faces, and used the face normal and/or color.;quote:Original post by Fidelio66  If the vertices of a triangle have different normals then the second stage (pixel shader) will interpolate the normal along the surface and calculate the pixel color based on that.   Nope.  The vertex shader calculates the light using normals/light direction/distance/color.  Each light is summed and it''s color value is passed along.  The normal is never passed along unless you''re doing your own per-pixel lighting with your own shader.The rasterizer interpolates between the colors of the three vertices.  This is VERY different from what you''ve described. ;  OK I had the impression that it worked like I described, sorry about that. But it comes down to the same thing, if you use the standard pipeline. 