Tag Archives: light pre pass

XNA: Adding fog to a LPP (or deferred) pipeline

Hi folks, After a long delay, here is one more gift for you: how to add fog to your scene. I will talk about global fog, although it can be easily extended to local fog volumes like spheres, cubes, etc. … Continue reading

Posted in XNA | Tagged , , , , | 23 Comments

XNA Light Pre-Pass: Instancing

Almost anyone out there wants to output as many meshes/triangles/details as possible. We know that individual draw calls can hurt performance, so it would be nice if there was a way to draw lots of meshes using a single draw call. … Continue reading

Posted in XNA | Tagged , , , , , | 27 Comments

XNA Light Pre-Pass: ambient light, SSAO and more

Hi folks, I’ve added a few improvements to the LPP renderer, to make it shine: ambient lighting using cubemaps, SSAO, an example of a dual-layer shader and some other small changes. Here is a screenshot: As usual, the full source … Continue reading

Posted in XNA | Tagged , , , , , , | 22 Comments

XNA Light Pre-Pass: culling, blending and particles

After the shortest Summer in my life, I’m back! Thanks to all who donated, I’m almost buying a Xbox360 with the money from this blog! This time I will release the feature that everybody was asking for: blending! I’m not … Continue reading

Posted in XNA | Tagged , , , , , , | 23 Comments

XNA Light Pre-Pass: Skinned Meshes

Skinned animation is one of the most common animation techniques today (if not the most), so I couldn’t have left it out of this series. You can find more about it here. The main idea behind it is to store … Continue reading

Posted in XNA | Tagged , , , | 24 Comments

XNA 4.0 Light Pre-Pass: casting shadows

It’s been a long time since my last post, but I didn’t give up on this blog. I was working really hard on a project aimed at DreamBuildPlay, but things didn’t go as I expected. It’s hard to keep everyone … Continue reading

Posted in XNA | Tagged , , , | 39 Comments

XNA 4.0 Light Pre-Pass: shedding the light

After my last post, I decided to continue with the z-reconstruct approach and to use light-meshes where possible. I’ve implemented two more light types: directional and spot. You can get the source code here. Here is a screenshot of the … Continue reading

Posted in XNA | Tagged , , , , , , | 11 Comments

XNA 4.0 Light Pre-Pass: Optimization Round One

Following some suggestions on my previous posts, I decided to reconstruct the z-buffer from my linear depth buffer and optimize the lighting pass. To achieve this, I did the following steps: Changed the light-accumulation render target: now it has also … Continue reading

Posted in XNA | Tagged , , , , , | 2 Comments

Reconstructing view-space position from depth

After my first LPP implementation, I decided to go for the mesh-based approach for rendering point lights. It consists in rendering a convex mesh (usually a sphere) that fits the light’s volume. This way we can use some depth/stencil tricks … Continue reading

Posted in XNA | Tagged , , , , | 3 Comments

XNA 4.0 Light Pre-Pass

Introduction The discussion between pros and cons of different techniques for real-time lighting has been running for years. Forward rendering, deferred shading and light pre-pass are some of the most famous techniques nowadays. Their definitions and variations can be found … Continue reading

Posted in XNA | Tagged , , , , | 33 Comments