Model shading weird problem

Posted By: shinramidgar

Model shading weird problem - 04/04/09 18:48

Im a newbie at gamestudio and I just started trying to make models.
I have found a weird problem going on with my models.
(I created my some of my own faces in here and welded some verticies)
1)
url: http://i698.photobucket.com/albums/vv345/shinramidgar/4-4-200912-29-09PM.jpg
2)
url: http://i698.photobucket.com/albums/vv345/shinramidgar/4-4-200912-31-13PM.jpg
3)
url: http://i698.photobucket.com/albums/vv345/shinramidgar/4-4-200912-32-25PM.jpg

as you can see in 1) it creates a weird shading illusion to make these faces seem indented when they are really flat.

in 2) it does yet another wierd shading thing

in 3) it shades all the faces seperatly and weirdly

if anyone can help me that would be awsome

(note 1) and 2) also occur in the engine)

Posted By: lyingmime

Re: Model shading weird problem - 04/04/09 21:32

I believe what you are seeing is the result of smooth shading. All polygons in the engine are smooth shaded (as opposed to hard edged). One way that you can get around this is to normal map your objects. Another is to change your geometry in a way that will work better with smooth shading.

In a little more detail... Normals determine how a polygon is illuminated. When the normal is parallel to the angle of the light source, the luminance of the light source is multiplied by 1. When the normal is perpendicular to the light source, the luminance is multiplied by 0. (Thus a face that is tangent to the light source receives no light.)

Now, with smooth shading, each polygon face (triangle) has a single normal at the center of the face. As you move away from the center, the normal angle is blended toward the normal angle of the neighboring faces. Generally, organic models will look better with this method and inorganic models will look...broken.

What you want to do is tell the engine to treat all the normals on the flat surfaces (the ends of the cylinder) as all pointing out the same direction. Then, for all the normals around the body of cylinder, smoothly blending into one another. Many software engines have an option known as hard edges that allow you to set this without normal mapping, but most real time engines do not, because additional computations are necessary.

Hope that helps. You should be able to find some normal mapping tutorials online. And you may see why real time apps generally avoid machine-cut pieces like what you're making here.
© 2024 lite-C Forums