#### Archived

This topic is now archived and is closed to further replies.

# Per Vertex Lighting or Per Pixel Lighting ?

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

## Recommended Posts

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/

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

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 10
• 10
• 14
• 10
• 25
• ### Forum Statistics

• Total Topics
632647
• Total Posts
3007640
• ### Who's Online (See full list)

There are no registered users currently online

×