forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question about lighting model and shading

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Steve F



Joined: 27 Apr 2005
Posts: 75
Location: Texas USA

PostPosted: Sat Jun 04, 2005 1:25 pm    Post subject: Question about lighting model and shading Reply with quote

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?
Back to top
View user's profile Send private message
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Sun Jun 05, 2005 2:10 am    Post subject: Reply with quote

Theory is sound. easiest is maybe C code for you, if not then use vu code since its less opcodes.
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group