Invitation

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

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!

Sunday, February 19, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 2 (Diffuse + reflections)

After minimal changes , I present you my first reflections (Diffuse Coefficient is Kd=0.1 and reflectance coefficient Kr= 0.9 in this example, these probabilities are used in the Russian Roulette. )



In these two first posts, the intensity of the light is attenuating at each "hop" of the path ,  as a product  of : 
 BDpathEye[eyeIndex].contribution*BDpathEye[eyeIndex].cosin*2.0*M_PIf; 
(2*π is used because at this point only diffuse surfaces are concidered)

Contribution is the brdf of the ray-hitpoint. 



In the next post(s) , i will try to improve this factor by adding the attenuation from the traversed distance(r^2) into the mix , also i will add refraction and specular coefficient 

Wednesday, February 15, 2012

Bidirectional Path Tracing using Nvidia Optix , Part 1 (Diffuse only)

Greetings again after so long time,

In this post i will show you my first results from my implementation of  Bidirectional Path Tracing using Nvidia Optix , which I have started 3  weeks  ago, as a part of my CS Master Thesis in  A.U.E.B.  (Athens,Greece ) For a quick overview of the theory , see here .  Warning , Post in the Greek language :-)

I will try to give a hybrid approach to the problem (using both Optix on GPU and some computations being made on the CPU to balance the computational load )

In this first post, I will show you the first really good rendering ,after correcting some mistakes that i have encountered during these 20 days. The implementation includes at this POINT only the basics , diffuse only surfaces with no visual effects or importance sampling. Reflection and refraction are under construction right now. So you will have them in a later post.

The code is pretty straightforward , but i will not post it right now because it is not finished . I have only strictly implemented the theory which is described in the classic thesis of Veach and similar papers.



I have gathered the best material (theory and staff) that i gather here - >



Example snippet from the main Optix- Function:

______________________________________________________________
.....
unsigned int seed = tea<16>(screen.x*launch_index.y+launch_index.x, frame_number);
  do {
  
    unsigned int x = samples_per_pixel%sqrt_num_samples;
    unsigned int y = samples_per_pixel/sqrt_num_samples;
    float2 jitter = make_float2(x-rnd(seed), y-rnd(seed));
    float2 d = pixel + jitter*jitter_scale;
    float3 ray_origin = eye;
    float3 ray_direction = normalize(d.x*U + d.y*V + W);


//1st Step : Eye-Path 
unsigned int eyeDepth=0u;
float3 tmpres = pathtrace_camera(ray_origin,ray_direction,seed,eyeDepth);
  
//2nd Step : Light-Path
unsigned int lightDepth=0u;
tmpres = pathtrace_light(seed,lightDepth); 

//3rd Step : Combination
 float3 tmpColor=make_float3(0.0,0.0,0.0);

for(int light=0;light<lightDepth;light++)
{
for(int eye=0;eye<eyeDepth;eye++)
{
contrib=make_float3(1.0,1.0,1.0);

for(int i=0;i<light;i++)
{
uint3 lightIndex =make_uint3(launch_index,i);
contrib *= BDpathLight[lightIndex].contribution*BDpathLight[lightIndex].cosin*2.0*M_PIf;
}

contrib *= (BDconnection(light ,eye)*2.0*M_PIf*2.0*M_PIf);

for(int j=0;j<eye;j++)
{
uint3 eyeIndex =make_uint3(launch_index,j);
contrib *= BDpathEye[eyeIndex].contribution*BDpathEye[eyeIndex].cosin*2.0*M_PIf;

}
tmpColor+=contrib;
}
}

    
  tmpColor/=(float)(lightDepth*eyeDepth);
  
  color += tmpColor;
  } while (--samples_per_pixel);

//combination

  float3 pixel_color = color/(float)(sqrt_num_samples*sqrt_num_samples);
_______________________________________________________________________________

Tuesday, July 19, 2011

Bidirectional Path Tracing using Brilliance Engine #2

Our project is nearly over, stay tuned for the version  0.1 during this week


It is co-written with Christos Alatzidis , a jack-of-all-(informatics' )-trades, programmer , friend and classmate.
This is his personal site: http://www.alatzidis.gr/