Skip to main content
gamedev.net
🔒 Locked

lighting formula

Started by glsensor Oct 3, 2006 at 11:15 PM 4 replies 1.6k views
Original Post
glsensor
glsensor
Generally, a specular lighting formula as follow N is Normal,L is LightDir, V is ViewDir, R is reflection vector R = 2 * (N.L) * N - L I = AmbientColor + DiffuseColor * N.L + (R.V)n This lighting model Link: http://www.gamasutra.com/features/20030418/engel_02.shtml My question is where I can find more lighting formulas? Advance thanks!
TheAdmiral
TheAdmiral
Some real-time lighting/shading models/techniques, roughly in increasing order of complexity:

Ambient Lighting Model
Flat Shading
Gouraud/Smooth Shading, based on Lambert's law (usually used for diffuse lighting)
Blinn-Phong Shading
Phong Shading (Specular)
Radiosity
Precomputed Radiance Transfer
Tone Mapping
High Dynamic Range Lighting (HDR)

These are in no way mutually exclusive and many of the models assume or subsume the previous ones. While not really lighting models, I included PRT and the likes because they are just as important to know about as the others. Wikipedia describes the various models well, but if you want applicable formulas, you may need to do a little searching.

Regards
Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
jollyjeffers
jollyjeffers
This is more appropriate for the GP&T forum. Moved.

Lighting models is a long-running and fairly complex field of computer graphics. There are a few basic parts (e.g. Lambertian, BRDF's etc..) but there have been a lot of different approaches to lighting.

the PRT/Radiosity type approaches tend to be (mostly) pre-processed and come more from the physical simulation side of things; lighting models (such as Blinn-Phong) tend to be mathematical approximations to observed lighting conditions/results.

I highly recommend you read Advanced lighting and materials with shaders. I wrote my final year dissertation on lighting models in Direct3D and read a lot of material for it - I found that book to be one of the best.

Wolfgang Engel's "Programming Vertex and Pixel Shaders" book has several canned models ready for you to use with minimal effort.


Look out for the book with my name on it coming out next year - I'm writing the entire section on lighting models [grin]


hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
glsensor
glsensor
Thank Admiral and Jack!

I post this question because I can't use standard phong lighting model on a wall lighting. Phong lighting model uses N.L (N.L equal to cos(angle) of lighting vector and Normal) complete diffuse reflection, so that lighting model has a limit. If lighting on a wall the light beam is almost tangental to surface and the cos(angle) approximate zero. Therefore the wall is black!

Maybe I can do that light intensity is directly proportional to length of lighting vector. But this way can't uses by bump-mapping I guess.

Wait for reply
glsensor
Matt Aufderheide
Matt Aufderheide
Well i reccomend chnaging the light positions to be not exactly flush with the wall surface... because in real life if this is the case the wall would be nearly black also.

Also all lighting models use N.L
glsensor
glsensor
I think, In really world all surfaces are not only specular reflection. N.L olny simulated specular reflection when all normals perpendicular to surface unless uses bump-mapping technique, So point lighting on a mirror should be black but the wall is not. Maybe some techniques/lighting-formulas could simulate physical lighting on a wall.

[Edited by - glsensor on October 5, 2006 11:35:31 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.