GTA 3 smooth objects

Started by
16 comments, last by zedzeek 18 years, 8 months ago
Take a look at this screen from GTA 3: click. Look carefully at the car (Kuruma). See how the roof is smooth and curved? How do they manage to do that without an insanely high number of polygons? They use DirectX and we are OpenGL followers but the principle must be the same. Their models can't have a huge number of polys as even with 10 cars in the scene at once it does not drop frame rates. So how so they do it?
Advertisement
I don't know,

But i am always amazed at how they make that game, and the preceeding ones.

I too would like to know.

ace
I really don't know much about 3d rendering but that looks like basic (untextured) gouraud shading to me.
Probably 4 polys tops, along with gouraud shading, smooth normals, and the specular highlights to top it off. Really quite simple.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Hey you're right! I did a google and it turned up interesting results from wiki. So what is the algorithm for gourad shading? I have the face normals calculated, I don't know how to calculate vertex normals.

EDIT:

Promit, it's very simple to you putting it one after the other, but it's all hebrew to me as far as coding goes. What are "smooth normals"? And the specular hilight - how do I code?
Quote:Original post by Promit
Probably 4 polys tops, along with gouraud shading, smooth normals, and the specular highlights to top it off. Really quite simple.


Wow, im surprised i actually know what you are on about, haha.

I can try and explain for you deavik

4 Poly-tops: not entirely sure, but probably 2 quads end on end?
gauroud shading: a smoothe shading equation for smooth blending accross a surface

smooth normals: rather than the normals being perpendicular to the surface they are interpolated with the normals on adjacent surface so more rounded lighting is achieved without obvious differences.

Specular highlighting is the component of the phong lighting model where you get to a specific angle and the surface glares at you.

Correct me if im wrong.

ace
Vertex normals are calculated by finding all the faces that use the vertex and add those faces' normals together and divide the resulting vector by the number of faces.

Note, this will give you the smooth normals you're looking for. In practis, normals are mofified by gfx artists in a 3D program ... Then *they* decide which vertices should have hard/smooth/user defined normals.
-----------------------------Amma
Quote:Original post by deavik
Hey you're right! I did a google and it turned up interesting results from wiki. So what is the algorithm for gourad shading? I have the face normals calculated, I don't know how to calculate vertex normals.

EDIT:

Promit, it's very simple to you putting it one after the other, but it's all hebrew to me as far as coding goes. What are "smooth normals"? And the specular hilight - how do I code?

A vertex normal is just the normalized sum of the normals for all faces it is part of.

For specular highlights: Check out glMaterial (specifically GL_SPECULAR and GL_SHININESS) and the corresponding settings for the light sources (glLight)
OK, I got the part about what smooth normals are. How do I use them? Let's say I find out which faces are using a particular vertex (which I have no idea how I am going to do yet), I average out their normals, then what? Does it go like this:

glNormal3f(..,..,..)
glVertex3f(..,..,..)
glNormal3f(..,..,..)
glVertex3f(..,..,..)
..........

And also, after I have got the smooth normals, what is the gouraud shading algorithm?

One other thing - there were 7 replies to this post within 24 minutes. Amazing!
Yes, that's how you do it. Goraud shading, which basically means that the vertex colors (including the result from lighting) are interpolated over the triangles, is applied automatically.

This topic is closed to new replies.

Advertisement