# lighting formula

This topic is 4370 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
Some real-time lighting/shading models/techniques, roughly in increasing order of complexity:

Ambient Lighting Model
Gouraud/Smooth Shading, based on Lambert's law (usually used for diffuse lighting)
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

##### 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 on other sites

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.

glsensor

##### 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 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]

1. 1
2. 2
3. 3
Rutin
18
4. 4
5. 5
JoeJ
12

• 14
• 22
• 9
• 31
• 18
• ### Forum Statistics

• Total Topics
632618
• Total Posts
3007477
• ### Who's Online (See full list)

There are no registered users currently online

×