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.

GLSL Pathtracer

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!!!

25 comments:

Seth said...

Are you planning on posting any sample code anytime in the future?

I've written raytracers before, but this puts my work to shame.. :)

Awesome stuff!

Mobeen said...

Hi Seth,
Thanks for the compliments. Currently, I am very busy with some stuff. I am planning to opensource this pathtracer. Another thing I am planning is to do a book on practical GLSL-based ray/pathtracing and photon mapping. I have seen a couple of books but none of these give u practical details on how to do it in practice. Stay tuned for more stuff soon.

Mark said...

Cool stuff. I would be interest in purchasing your book and see a live demo for myself. Let me know when you have any of that info out. Keep up the awesome work!!!

Mobeen said...

HI Mark,
Thanks. I am a bit involved these days. I have this in my pipeline as soon as I am free I will be focusing on this.

Regards,
Mobeen

Brendon said...

What did you do to make it faster?

Mobeen said...

hi Brendon,
I have removed the sqrt in the uniform hemisphere sampling which Evan Wallace used. This gives almost the same output but with improved performance. Another thing I did was some shader caveats like replacing the if conditions by using the variable used as the fragment alpha. This way if the conditions is false, the alpha is 0 thus the fragment does not show up on display.

Dmitriy Khudorozhkov said...

Good evening,

anyway you can share a sources for this demo? Thank you.

Dmitry.
dmitry.khudorozhkov@gmail.com

Muhammad Mobeen Movania said...

Hi Dmitriy,
I have shared the shaders already. You can give it a try first. If you really cannot do it then I will post my code here for you and others.

Thanks,
Mobeen

Muhammad Mobeen Movania said...

I have modified the link. Now it should work fine. If it doesnot, you can download from here.

https://dl.dropboxusercontent.com/u/5513476/GLSLPathTracer%28bin%29.zip

Dmitriy Khudorozhkov said...

Thank you for the shaders, Muhammad. But the program doesn't work )) I get "Error executing program(t)".

Muhammad Mobeen Movania said...

Hi Dmitriy,
I have just ran it on my office machine (NVIDIA Quadro FX 5600) and it works fine. Could you share which GPU u r running this on AMD/NVIDIA and what model?

blueangel74 said...

Hi,great work,but the link don't work,can you modify the link,thanks

Muhammad Mobeen Movania said...

Hi blueangel74,
Well it works for me both on my home network and my office network. Could u try this direct link
https://dl.dropboxusercontent.com/u/5513476/GLSLPathTracer%28bin%29.zip

MarioFoerster said...

Hi,
also cannot run the GLSL Path tracer with NVIDIA 310M or NVIDIA 560GTX. Have bought your CookBook (which is really awesome :)) and PathTracing example from there is running on both cards. Any idea why this is not working?

Muhammad Mobeen Movania said...

hi MarioFoerster,
What error do you get on the dos console? Or is it some side-by-side configuration error?

Thanks,
Mobeen

MarioFoerster said...

Hi,

yes it show some Sidy-By-Side configuration error ...

Muhammad Mobeen Movania said...

OK the reason you get this error is because probably you are running the code on an x64 bit machine. I build the exe on an x86 machine. I will upload an x64 version of code and let you know.

Thanks,
Mobeen

lobachevscki said...

Thanks for sharing.

lobachevscki said...

Thanks for sharing

Denis TRUFFAUT said...

Hi, I'd like to test the code on a 64 bits machine.

Do you think it is usable in realtime in WebGL ?

The original version was not because there was some loud noise at the screen on object displacement...

Muhammad Mobeen Movania said...

Hi Denis,
Sure it should be fine on an x64 machine too. it should be fine in webgl as I converted the original webgl code to c++.

Regarding loud noise on object placement is expected as that is how path tracing works. The results should converge rapidly to a noise free output.

Denis TRUFFAUT said...

Could you provide a 64 bits executable ?

Muhammad Mobeen Movania said...

OK I will but please provide me some time.

Muhammad Mobeen Movania said...

Here you go
https://www.dropbox.com/s/k6dfcwms17p75tq/GLSLPathTracer_x64.rar?dl=0

Leandro said...

Hi, could you provide the source code?

Popular Posts

Copyright (C) 2011 - Movania Muhammad Mobeen. Awesome Inc. theme. Powered by Blogger.