Sign in to follow this  
glsensor

lighting formula

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

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

hth
Jack

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this