## Wednesday, November 23, 2011

### Snapshot from my latest GLSL Path tracer

Here is a snapshot from my latest GLSL Path tracer which was inspired by the excellently done path tracer in WebGL by Evan Wallace(http://madebyevan.com/webgl-path-tracing/). I have modified his code considerably to make it run even faster on PC.

It runs at ~70fps with 128 samples per pixel for an output res. of 1024x1024. Check this video captured live from a session.
Another video showing a live editing session.
Another video showing the famous Cornell Box scene.
This demo renders the famous Cornell Box scene in realtime. You can edit all the parameters live and it renders at ~240 fps on my NVIDIA Quadro FX 5800 on an output resolution of 1024x1024. I have not added importance sampling or any other optimization. Adding those will certainly make it even faster.
Yet another video of Cornell Box

This time it is even better with more photons. Takes a bit longer to converge but the output is worth it. GLSL Pathtracer Demo Enjoy!!!

## Sunday, November 20, 2011

### Some recent snapshot and demo video on GPU raycasting

Here is a snapshot and video from my GPU raycasting demo.
Here is the like to the video.

## Friday, November 18, 2011

### Twirl filter in GLSL

I had worked on image processing project back in my high school days and so the last memories returned recently when I wanted to implement the twirl filter in GLSL. Mathematically, it is easily given as the following function in polar coordinates,
F(r,theta)=f(r,theta+amt)
In normal world though, we are working in Cartesian coordiates so we need to add that conversion in. Other than that, it is the same function. Here is the output from my shader.
 The Lena image filtered with the twirl filter in GLSL.
And here is the GLSL fragment shader for doing this.

uniform sampler2D textureMap; //image
uniform float amount; //amount of twirl
void main() {
vec2 uv = gl_TexCoord[0].st-0.5;
float angle = atan2(uv.y,uv.x);