Page 1 of 1

Question about lighting model and shading

Posted: Sat Jun 04, 2005 1:25 pm
by Steve F
I'm looking for a back check on my understanding of ps2 lighting model and shading.

I have a large trimesh (7938 triangles) representing a terrain of peaks and valleys. All triangles are the same color. No texture (yet). Looking at model, it is impossible to visually sense the terrain features (no surprise here).

I believe the most basic lighting and shading effect would be:

Flat shading attribute for each triangle. I use EE to calculate a face normal for each triangle and alter the luminance based on the angle from the [imaginary] light source location to the camara, and the reflectance coeffecent of the surface.

The next better lighting and shading would be:

Gouraud shading attribute for each triangle. I use EE to calculate vertex normal for each vertex representing the vector sum of the three triangles that share that vertex and alter the luminance as above.

Even better lighting and shading would be:

VU shader procedures. GIF packets DMA'ed to VIF running shader microcode.

First question, have I overlooked other methods for lighting and shading?

Second, with the first two methods, have I overlooked a builtin feature of the PS2 hardware that handles the lighting calculations?

And third, did I describe the basic lighting and shading correctly?

Posted: Sun Jun 05, 2005 2:10 am
by blackdroid
Theory is sound. easiest is maybe C code for you, if not then use vu code since its less opcodes.