Volume rendering

Implementation

Pervasive fog

As this feature was implemented during the home assignments, nothing special was done within this context. The effect of the fog is pretty, but for huge scenes like "Unpleasant Encounter" such a method is quite excessive and expensive. In order to optimize the rendering process, the decision to implement bounded volume rendering was established.

Cylinder intersection

The most optimal solid to envelope a laser beam in a scene is a cylinder, therefore some time was spent on implementing it. This link and this link helped me a lot.

Not without problems, of course... Playing around with light sources helps you to find "ghost" holes in your solid.

That moment when your solids won't mind some Panoxyl...

Volume intersection

In order to use solid as a volume for fog, I added a new interface IVolumeObject in <..rt\volume\volumeobject.h> for them. Every solid, that wants to be a vessel for a fog, need to implement permeate method, that returns two points of intersection instead of traditional one. As we can see, not everything comes from the first try...

Finally, some clean implementation of algorithm... Little joys of poor computer graphics programmers..

Now our cylinders are ready to be a conduit for light sources