multipass lighting.

Started by
0 comments, last by mohamed adel 19 years, 7 months ago
Hi. I was wondering about multiple light rendering with multiple passes (when amount of visible lights is varying). First idea was like this: 1. Find a list of visible objects and level geometry. (with octree and frustum culling) 2. Render everything with only ambient light on. 3. Find a list of point-lights affecting frustum. (ligts whose influence sphere intersect with frustum) 4. For each light - find visible objects and geometry (from list generated in point 1) and render them with additive blending (passing that light to the shader) Is this correct?? Is there a better solution? How this was done in Doom3 or FarCry ?? First I considered rendering multiple lights with a single advanced shader pass, but then I would have a hardcoded light amount for each object even there are not as many lights affecting that object or there are more lights..
Gatis
Advertisement
you are right but you are not considering shadows.some geometry can be partially visible from light's point of view.So the lighting is done per pixel not per object. So step 4 should be:
For each light - find visible or partially visible objects and geometry (from list generated in point 1) and render each pixel that is not in shadow with additive blending (passing that light to the shader).

This topic is closed to new replies.

Advertisement