do i need different normals to go from flat to gouraud or per fragment shading?

hi, i think i understand the main concepts behind gouraud. i also have managed to get some flat shaded lighting effects working on that basic monkey model in blender. i am also using open asset importer to load the normals and vertices from a file. so if my normals are perpendicular to the triangle that is being described, do i need different normals to implement gouraud or per fragment shading? and if not how do i interpolate the normals when they are all the same?
thanks
:slight_smile:

Well, actually you need normals per vertex, not per triangle.
Blender for sure is able to export normals per vertex.

actually thats what i meant, it’s just that all the normals are the same for each vertex in the triangle. so i don’t know how to get anything but flat shading when all the normals are the same. i guess i get the idea of what gouraud shading does just not how to implement it. i’ll just take a look at the tut again tomorrow.
:slight_smile:

gourad shading = light calculations happens in the vertex shader, for normals per vertex
phong shading = light calculations happens in the fragment shader, for normals per vertex. but, the vertex normals are passed (and automatically interpolated) from vertex to fragment shader.

so you see, you need normals per vertex and not per triangle. in every case, if you want more than flat shading.

sorry bro, i suck at explaining things in english.

Enable smooth shading in blender before exporting. This should also reduce the size of the data for the mesh, as vertices can be shared between faces.

Enable smooth shading in blender
so just so im 100% sure, i do need to have different normals?
never mind the previous line, but is all that smooth shading does is change the normals?

[QUOTE=a-sylum;1264122]so just so im 100% sure, i do need to have different normals?
never mind the previous line, but is all that smooth shading does is change the normals?[/QUOTE]

Smooth shading assigns a normal to each vertex. Flat shading assigns a normal to each face.

If the data format associates normals with vertices, then flat shading will result in each face having a distinct set of vertices; when faces adjoin, their vertices will have the same position but (usually) different normals, so they can’t be shared.