Invitation

Whoever wants to contribute to this blog , posting his experiences on the same place, please send me a message !

Thursday, April 26, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 7 (Scene Loader)

My next installment in the thesis project is a scene loader.

I used the free open source Pugi XML API which is very easy , magnitudes easier than anything else I tried. And i describe my scene using an xml -document. My code is simpler now and any changes can be made quickly.

An simple example of an XML file with the scene parameters and materials only (no geometry , to maintain simplicity ) is this.

I remind you that i haven't found a way to do the tile processing , the problem that i described in the latter post. So, any help is still welcome.

Sunday, April 22, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 6 (Correct Refractions)

My last accomplishment on my way to create this renderer is the correction of the refractive materials.

In the following pictures, the material of the ball is totally refractive so it is not to be mistaken for real-world glass for example. In the last picture , the refractive material is exaggerated to highlight the appearance of colored caustics







At the moment I am creating an xml scene loader for easy scene parameter and geometry  loading.


Thursday, April 12, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 5 (Better Reflections, organization,bugfixes)

After a bit lazy fortnight , I have made some slow but steady progress , it is not much but nevertheless...

The rendering results have not changed  much but i have made some improvements . 

Now in the case of reflections i have corrected the mistake which occurred when we had an eye-path that contained a point with reflective material. In that case , if the next hitpoint after the reflection was a point on the light then the light would not be seen (appeared to be black) . That happened because the possibility to hit the random light point of the light-path, was practically zero. So in that situation, i consider only  one path (eye-path +that point only the light) and not the all-by-all combinations , practicing path tracing.

I have also made some optimization concerning the memory consumption. Especially , with the usage of materials in the cuda code. I have also added the creation of .Obj objects but i have some problems with the materials on the rendered objects so proper objs will be shown on the next post.

Also added point lights into the mix

I have tried to use two cards for the rendering ,a GTX 560ti and a GTX 460 , totaling 722 cuda cores , with very nice results. The scaling is not perfect but in my code is good enough. 100% gpu usage for the main card ( GTX 560ti  ) and about 85%-92% for the secondary (GTX 460) 


560 on the left-460 on the right
Next steps are : 

a.To create a proper Scene Loader

        b.Materials on obj s  ,usage of more complicated material properties , material containing textures etc.
       c.Importance sampling for many lights.
       d.Correct refractions because the present code contains a load of small errors.



Point Light example




Correct (or so it seems) reflections 

See you next week!
  
  


Friday, March 30, 2012

GTX 680 is out !

In case you missed it Nvidia's GTX-680 with incredible specs is out... with the GTX-690  with double the specs on its way!

1536 cuda cores , 2GB VRAM and 1GHZ core frequency !

http://www.guru3d.com/article/geforce-gtx-680-review/2

And i thought that my rig was nice....

Bidirectional Path Tracing using Nvidia Optix , Part 4 (Multiple lights and some bug fixes)

Hello again,

This time I have very little stuff to show couple of bugs , several performance issues and multiple lights :

With the help from the nvidia developers forum i corrected a bug in my random generator. I passed my random generator "seed" from hop to hop in the path by value, whereas by reference was the best solution to update the seed variable.

On top of that I have made several performance enhancements so the project in the simple cornel scene runs at about twice the speed(and some "change") at 33fps (512X512 scene with 4 hops at each path) instead of 13 at the same configuration Rendering is here 

I have also made spherical lights and organized the Light Class so that the addition of new types will be quick and easy


Here is the rendering with the three lights at 1024X1024 resolution

Next step will be to correct my errors in the BRDFs of the reflective and refractive materials

Monday, March 12, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 3 (Simple Refractions)

Hello !

Today i managed to create the first simple refractions into my project.The refractions are far from finished yet but i think they are good enough to show them to you. As you can see i have also implemented spherical lights

The material has refractions only , without anything else and it is also simple ,without any tricks yet.

_____________________________________________________________________
SAMPLE CODE :


 //refraction coefficient


current_prd.countEmitted = true;
float ior = 0.0;
 if(!current_prd.inside)
ior=1.33;
 else
ior=1/1.33;

if(refract(current_prd.direction, ray.direction, ffnormal, ior))
{
if(current_prd.inside)
{
current_prd.cos1 = dot( -ffnormal, -ray.direction );
current_prd.cos2 = dot( ffnormal, current_prd.direction );
}
else
{
current_prd.cos1 = dot( ffnormal, -ray.direction );
current_prd.cos2 = dot( -ffnormal, current_prd.direction );
}

}
else//internal reflection
{
current_prd.direction = reflect(ray.direction,- ffnormal);

current_prd.cos1 = dot( -ffnormal, -ray.direction );
current_prd.cos2 = dot(- ffnormal, current_prd.direction );
}


current_prd.attenuation = diffuse_color*Kt;

if(current_prd.inside)
{
 //Compute Beer's law
current_prd.attenuation = current_prd.attenuation * powf( diffuse_color , t_hit);
}

current_prd.inside = !current_prd.inside;

current_prd.hitDistance =   length(ray.origin - hitpoint);
current_prd.ffnormal = ffnormal;

 _________________________________________

Please , i need your comments to make it better and find any mistakes that i make !

Render 2

Nvidia Optix 2.5 is out !

Two weeks ago , nvidia has updated Optix. The new version is way faster than 2.1 and has several bugfixes and new features ... Update your system as soon as possible!

It will speedup your applications by 40% to 3 times faster on the same hardware , depending on the code.

The 2 features that are still missing and would be useful to have in a future release are:

*Compatibility with Nvidia's Nsight debugging utility
* And mainly the ability to declare buffers within the optix code.

That would be very handy in my application!