smooth objects

Started by
5 comments, last by polymorphed 17 years ago
Hi, I just wanted to know what are common hints to get a smooth surface on an object without increasing the number of vertexes? I red about true normals, but I have no idea how to apply this in real time without decreasing the FPS. Is there a simple way to do it in a CG program? Or is tessellation the only correct way?
Advertisement
currently it looks like this:
http://valen16.trypill.org/vengine/screen12.png
I use a per fragment light shader here..
A big win if you're using the built in lighting is to make the normal of each vertex equal to the average of the normals of the triangles that use it. That'll smooth out the lighting pass.

Another big win is using normal maps; the general procedure is to make a high rez mesh and create a normal map using those polys, then downrez the mesh to gameplay level of detail but use the normal map from the better mesh to "fake" the detail.

The generation of these data (averaged normals, normal maps) are never done at runtime, you either have your artists make the normal maps and just apply them at runtime or average your vertex normals during mesh export so that when it's imported into the game it's already done.

-me
oh hi thanks i think this might help me..
But how do I use a normal maps (I mean normally I define a normal per vertex--- but I suppose using normal maps defines more normals per triangle (or quad...))
Quote:Original post by valen16
But how do I use a normal maps (I mean normally I define a normal per vertex--- but I suppose using normal maps defines more normals per triangle (or quad...))


I don't really know. A normal map is like another texture you apply to the object so the renderer can lookup the normal at a given pixel just like it looks up the color at a given pixel with a texture map. I don't know anything either about the generation or runtime application of normal maps, however.

A quick google search will answer 90% of your questions, I'm sure.

-me
ok I'll do that
thanks
Find out which vertices share the same position, and then add all the respective normals together for that point, and divide it by the amount of points there, so you get the average. You can do this in the loading phase, or even better, just do it once and store it in your model format.
Im pretty sure all the big modelling programs like Blender, 3DS etc. can do this for you. :)

Normal maps are best if you need additional detail to your mesh without increasing polys, examples of this would be adding texture to a tree trunk, roughness to asphalt, etc.
I beleive there are some extensions for doing this without pixel shaders, but I haven't tried them.

If you want some examples of normal mapping, I can make some, but they are going to run on the vertex/pixel shader :)

-polymorphed
while (tired) DrinkCoffee();

This topic is closed to new replies.

Advertisement