SOP Raytrace

   4885   3   1
User Avatar
Member
4730 posts
Joined: Feb. 2012
Offline


Inspired from Psyop Softimage ICE Workshop by Jonah Friedman.
Edited by animatrix_ - Sept. 8, 2016 11:59:07
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Cool!

Maybe it's my paranoia from doing it wrong so many times, but is there correlation between those random values on subsequent bounces? It kind of looks like there might be, but it's hard to tell for sure without checking it over myself. If there is, you have to make sure that each ray's BSDF sampling seeds are unique (or alternatively, independent) from all other seeds, else you can end up with nasty biases, Moiré patterns, or poor convergence.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Very neat to visualize 8)
www.kmcnamara.com
User Avatar
Member
4730 posts
Joined: Feb. 2012
Offline
Thanks guys.

ndickson
Maybe it's my paranoia from doing it wrong so many times, but is there correlation between those random values on subsequent bounces? It kind of looks like there might be, but it's hard to tell for sure without checking it over myself. If there is, you have to make sure that each ray's BSDF sampling seeds are unique (or alternatively, independent) from all other seeds, else you can end up with nasty biases, Moiré patterns, or poor convergence.

Good eye I wasn't using very unique seeds for each subsequent ray where the seeds were also using the same values.

Basically at each depth, I go through the array of rays and then create a new array of N randomized rays based on the original, where N is the number of splits for each ray.

int count = 0;
int count = 1;
while loop
{
for every ray …
{
for ( int f = 0; f < chi(“rays”); ++f )
{
vector nn = randomizeVectorByCone ( p, n, 0, ch(“angle”), f + ch(“seed”) * 10, 0, 2 );
}
}
}

Now I changed it to this:

while loop
{
for every ray …
{
for ( int f = 0; f < chi(“rays”); ++f )
{
vector nn = randomizeVectorByCone ( p, n, 0, ch(“angle”), f * count + f + ch(“seed”) * 10 + count * depth, 0, 2 );
}
}
}

Is this random enough?
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
  • Quick Links