Question about lighting model and shading

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
Steve F
Posts: 75
Joined: Wed Apr 27, 2005 2:30 am
Location: Texas USA

Question about lighting model and shading

Post 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?
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

Theory is sound. easiest is maybe C code for you, if not then use vu code since its less opcodes.
Kung VU
Post Reply