Archived

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

johnnyBravo

Perpixel lighting, is it....?

Recommended Posts

Hi, just to make sure, is perpixel lighting actually per pixel and not on the vertex? also is it much slower then vertex lighting or is it the same

Share this post


Link to post
Share on other sites
o_0 oh guy the answer is in your question, as its called per pixel lighting, the lighting IS MADE per pixel LOL, whatch out for tutorials and articles about pixel shading and vertex shading :D

Share this post


Link to post
Share on other sites
To continue the line of great questions, is there per-texel lighting?

as for being slower, yes it is quite slower. Just how much depends heavily on your gfx card. per-vertex shading normally uses three points to get the normals for a face and then calcs the lighting... where as per-pixel system takes the normal for every pixel that''s on the object. That could mean hundreds or thousands of normals being calced. If the poly takes exactly half of the screen space on 1024x768 pixels the result is about 393216 pixels... try comparing that with 3. Still, today''s gfx cards are quite amazing.

Share this post


Link to post
Share on other sites
quote:
Original post by las6
To continue the line of great questions, is there per-texel lighting?


yes. lightmaps would be one (static), dynamic lightmaps are as well (distance attentuation can be done with a simple multitexturing of a 2d and a 1d texture, with multiplicative blending).




If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hmm... Isn''t per-pixel lighting actually per-texel lighting?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Hmm... Isn''t per-pixel lighting actually per-texel lighting?

Yes. Deferred shading could possibly be considered ''proper'' per-pixel lighting, but then you''re just arguing about word definitions really.

Share this post


Link to post
Share on other sites
Per-pixel lighting can actually be calculated from triangle interpolants directly - then it has nothing to do with texels.
In such case, the geometry position and lighting conditions are direct parameters to the pixel shader, and the lighting equation is completely evaluated there.

-Nik

Share this post


Link to post
Share on other sites
quote:
Original post by Nik02
In such case, the geometry position and lighting conditions are direct parameters to the pixel shader, and the lighting equation is completely evaluated there.

Which, like I mentioned, is essencially how deferred shading works.

Share this post


Link to post
Share on other sites
quote:
Original post by OrangyTang
quote:
Original post by Nik02
In such case, the geometry position and lighting conditions are direct parameters to the pixel shader, and the lighting equation is completely evaluated there.

Which, like I mentioned, is essencially how deferred shading works.


Sorry, I was not familiar with the term "deferred shading"

-Nik

Share this post


Link to post
Share on other sites