

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Due date: December 11th, 11.59.59 pm
Delivery: Source code and screenshots to [email protected] or [email protected]
Problem: Implement an approximation of large-radius Gaussian filter using a sequence of box filters.
Large-radius Gaussian: The naïve way to implement a Gaussian with large radius is by using large radius a 2 for-loops in a pixel shader. The complexity of this operation is O(n*n) where n is the radius of the kernel.
The task of the assignment is to simplify this operation and perform multiple blurs using the box kernel on render targets with different resolutions. Once this is done, the large-radius Gaussian blur can be approximated by blending all render target-textures together.
Recommended steps:
Review the new code template. It contains revised FBO interface which allows for easy rendering into different render targets and access to their contents from shaders.
Prepare your quad geometry. You can set up your own render buffer (look inside ModelLoader for hints) or use the quad model. The quad needs to span the whole clip space!
Set up 3-4 render targets with different resolutions (e.g. 10241024, 512512, 256x256).
Render original scene to a shadow map from the light’s point of view.
Render JUST the shadow into a separate render target (only black/white image should result from this).
For each resolution Render quad with a 3x3 or 5x5 box blur shader
Render JUST geometry with lighting (NO SHADOWS) on screen
Set up blending modes (I’ll leave it up to you to figure out which one you want)
Final pass – Render quad and accumulate contributions from all render targets in the pixel shader (sample tex1 through texN and add everything together).
Bonus (25%) will be awarded if you implement separable box blurs. This means that you won’t blur by using 2 for-loops and 3x3 or 5x5 kernels, but you will blur using 1 horizontal pass with a 3x1 kernel followed by 1 vertical pass with 1x3 kernel. This will happen for each resolution.
MORE INFO: If you have problems reusing your code from Assignment 4, you can blur something else. For example, in step 5) you can render only a black tiger on white background. Then blur this 3-4 times and composite with the original tiger in the last step. This will give you a nice glow effect.