Jump to content
  • Advertisement


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

Leyder Dylan

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.

If you intended to correct an error in the post then please contact us.

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 this post

Link to post
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".


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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!