Jump to content
DonRomano

Vex Pathtracer

Recommended Posts

Posted (edited)

Hey guys, 

I started making a very simple pathtracer with vex in sopland. I'll add basic reflection and refraction, and keep it very simple as it is made as an "educational tool" to help students understand how pathtracing works under the hood. Once I'll have finish I'll share the file here if some of you are interested.

I added an "animation" in which we can see the different paths a ray takes : the primary path (in red/blue in the video), the next event estimation path (in black/yellow), and the diffuse bounces (in magenta). I'll also add the next event estimation for the diffuse bounces, and of course when it will be implemented, reflection and refraction paths.

Here's a little video of the animation, and a very non-converged render

https://streamable.com/37kxua

vex_raytracer.thumb.png.3e6a37b05cb2829bfda118cfeba30c8a.png

(I think I have a bug in the global illumination I'll fix it tomorrow).

 

Cheers,

Edited by DonRomano
  • Like 4

Share this post


Link to post
Share on other sites

Got time today to add reflection and refraction, I even got caustics with a little trick !

image.thumb.png.a1aa99bb4180c424d14f9362ac787f41.png

Now time to adjust the animation to capture reflection/refraction rays and I'll call this done.

 

Cheers,

Share this post


Link to post
Share on other sites

Go a bit of time yesterday and this morning so I rewrote the whole thing from scratch, with fresnel blend for glass (to get both reflection and refraction), and I fixed a few bugs in the gi. I need to fix the animation of the rays now, and it should be good. I might add antialiasing too to get smoother renders (and maybe add a simple photon mapping help to caustics because they are still very noisy).

 

60897087f20d4_unknown(4).thumb.png.9c729e2456092a4e43f411e1503a6c28.png

6089707a5366c_unknown(1).thumb.png.b0864599070afe472174ccb4f1b28e6e.png

60897069e43fb_unknown(3).thumb.png.baed2b6cbdc2ac0d0548f2932dd27fb0.pngunknown.thumb.png.d7a7033e49de83f1dd9d759dd1baea12.png

 

I attached the file though it's not finished (in case you want to also test). I need to add more comments and notes to help understand what's going on, and once everything's fine I'll share the "final" file. You need to include the "raytracer.h" file in a directory defined in the HOUDINI_VEX_PATH in houdini.env.

raytracer.hipnc   raytracer.h

 

Cheers,

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×