Advertisement

Per Vertex Lighting or Per Pixel Lighting ?

Started by October 13, 2003 11:43 PM
0 comments, last by Leyder Dylan 21 years, 4 months ago
I was asking me if I use the correct word for my lighting demos. In fact, I calcul the attenuation light with the vertices not the pixel. My code is based on this : http://www.ronfrazier.net/apparition/research/per_pixel_lighting.html Is it correct ? Wich word I need to use ? Per Pixel or Per Vertex ? ======================== Leyder Dylan (dylan.leyder@slug-production.be.tf http://www.slug-production.be.tf/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
This describes how to attenuate the light contribution in the distance on a pixel basis. So, it should be called "Per-Pixel Attenuation".

Explanations

In OpenGL, the lighting stage computes various things and uses them all to produce the final color. These "things" include :
- ambient contribution
- diffuse contribution
- specular contribution
- distance attenuation
- spot cutoff
and maybe others...

In white papers, you have certainly read terms like "Per-Pixel Diffuse", "Per-Pixel Specular", etc.
In fact, when you mean "Per-Pixel Lighting", it means that all of those contributions are performed at the pixel level. In your case, only the distance attenuation is computed on the pixel basis, so the term "Per-Pixel Attenuation" is more appropriate.

With that said, some engines sometimes claim to perform Per-Pixel Lighting without supporting all of the Per-Pixel Stuff listed above. And in that case, they''re not really lying when they mean to support PPL, because with certain conditions you can simplify equations. For instance, if an engine does not provide spot lights, there''s no need to compute "Per-Pixel Cutoff". If the lights never fade in the distance, there''s no need to compute "Per-Pixel Attenuation". If the materials are all mate, there''s no need to compute "Per-Pixel Specular". In general, the very least required for PPL is "Per-Pixel Diffuse" : many engines that claim to support PPL do only support Per-Pixel Diffuse.

This topic is closed to new replies.

Advertisement