## Raydiant: chasing the rainbow

December 14, 2009 at 7:42 pm | Posted in Computer path | 2 CommentsTags: 3D, C++, density distribution, fractal, game, procedural, ray tracing

This is the first sample render of Raydiant using spectral sensitive materials. In this case some crystal triangular monoliths are responsible for the rainbowish thingy. I’ve developed a spectral pathtracing method, no photons are traced from light sources (no photon mapping), so light sources can be arbitrarily numerous and heterogeneous and render goes just even faster. Total internal reflection is also modeled, hence the secondary rainbows apparently going against the unique light source. I’ve spent long time staring at every different light effect on each zone of this particular render, I like them. So from now on Raydiant is a spectral pathtracer. The monoliths are made of glass with refraction index 1.4 to 1.6 for all the range of visible light. I’m working on speeding it up by a factor of 20 times and it’s looking good. The second image with square monoliths is another test posted for aesthetic reasons.

## Raydiant: realtime mutithreaded global illumination

November 8, 2009 at 11:04 am | Posted in Computer path | Leave a commentTags: 3D, C++, density distribution, fractal, game, global illumination, path tracing, procedural, ray tracing

The global illumination tracer module has been finally completed/debugged and is working. So the new ideas applied to Raydiant engine about realtime steradian controled stem count to improve performance are now proved to be useful. Also the generic multithreaded tracer than can hold any other tracer inside (like the global illumination one) and transparently clone it and make it work at any number of threads simultaneously without synchronization penalties is completed and debugged. The result is that now you can interactively move yourself around in a synthetic scenario with true realtime global illumination in a i7. This opens far-reaching possibilities: games that look as if you where there is one I’m really attracted to. Also now that Fermi platform from Nvidia is here the Raydiant engine can be compiled at one of those 512 CPU cards and see what happends… . Because there is no precalcs the scene lights can be instantly moved around. And any number of ligths can be put at a secenario with no performance penalty, in fact is the inverse. On some of these screenshots the new light dispersion capability of the Raydiant engine can be clearly appreciated.

## Raydiant: custom probability distribution

November 7, 2009 at 11:11 am | Posted in Computer path | 1 CommentTags: 3D, C++, density distribution, fractal, game, procedural, ray tracing

It was very useful to be able to transform a constant normalized random distribution (same probability for every number between 0 and 1) into another one with personalized density distribution. This has been used to create materials choosing photon bouncing directions. Also used on objective depth of field effects of different types. This is the way I did it (and really enjoyed deducing this one):

- Lets suppose we have a random generator with a density probability distribution : D(x)=1 for all 0<=x<1, and lets call ‘r’ the random numbers generated by this distribution.

- We want to get another density probability distribution called E(x), of course definite integral of E(x) between x=0 and x=1 must be exactly 1.

- Lets call ‘t’ to the random numbers generated by E(x) distribution.

- I found the relationship between r and t is: r = definite integral of E(x) between x=0 and x=t. This is to say the area defined between E(x) and the horizontals axis between x=0 and x=t must be exactly r.

- So just substitute your E(x) and solve the equation for t.

- Applied example 1: find a random distribution that applied to a radius and given uniform random angles gives a homogeneous surface distribution at the plane inside a radius 1 circle:
- Solution: t = sqrt(r/pi)

- Applied example 2: find a random distribution that applied to a radius and given uniform random angles gives a homogeneous surface distribution at the plane inside a washer of radius r0 and r1 with r0<r1:
- Solution: t = (-b+sqrt(b^2+2ar))/a with a = (2(r1-r0))/(r0+r1) and b = 1-(r1-r0)/(r0+r1)

- As exercise: can you calculate ‘t’ for a random distribution which is completely lineal between x=0 and x=1?

These are some screen shoots of custom random distributions made by my wife María with the same Raydiant engine:

Blog at WordPress.com.

Entries and comments feeds.