Jump to content


Alienizer

Member Since 09 Nov 2010
Offline Last Active Today, 05:29 AM
-----

Posts I've Made

In Topic: Basic path tracing in OpenCL

18 May 2013 - 01:39 AM

Thanks Vilem and as you suspected, it isn't running on NVIdia, it says...

Initializing OpenGL
Error

I'm looking at your cl code so I can understand how you do it. But what about the main loop, how does it call the kernel(s)? Will you provide the sample c code (or the pseudo code) for the loop (please :rolleyes: )? Thanks Vilem

In Topic: Basic path tracing in OpenCL

17 May 2013 - 05:25 PM

how did the swimming go Vilem ? hope you didn't drawn, didn't hear from you for a while :lol: :lol: :lol:

In Topic: Require help on admission to SMU

04 May 2013 - 07:07 PM

Basically, you do not want to write only your knowledge and what you are capable of just to get the job, this is not a résumé. What you need to write is what you think the industry need from which this is what you believe and want to pursue and in turn will impact this industry, and if your believes are correct, the impact will be positive and so will your career.

More like an astronomer who believe there are aliens on the dark side of the moon and devote his life to prove it. When he proves it, the impact on humans would be astronomical.

I can only hope I'm correct and this will help you.

In Topic: Basic path tracing in OpenCL

04 May 2013 - 04:44 AM

swimming? you are so lucky. Me I'm still in the snow right now.

oh yes! I was doing it that way, but I did it wrong in my message, sorry!

>sample pathtracer in OpenCL
Yes please, I would really like that, thank you.

I didn't know about the GPU not being that much faster than a CPU. So how do they have all those videos on Youtube about real-time path tracing where they get 10+ FPS with millions of triangles???

In Topic: Basic path tracing in OpenCL

03 May 2013 - 09:00 PM

ok, I see what you mean. So what I have done so far is this...

for (int spp=0; spp<32; spp++) {
 
    Init_Info_Buffer; // reset path termination flag along other things.
 
    for (int depth=0; depth<3; depth++) {
 
	    Kernel_Gen_Cam_Rays;
	    Kernel_Shoot_Rays;
 
	    // begin direct illumination for none terminating paths.
	    // discard camera rays to sky for example but still record sky color.
 
	    Kernel_Gen_Rays_To_Random_Light;
	    Kernel_Shoot_Rays; // for none terminating paths, discard rays not hitting any lights.
 
	    Kernel_Gen_Random_Hemi_Rays; // diffused rays
	    Kernel_Shoot_Rays; // if hit sky, record color, else keep path for next depth.
 
    }
 
    Send_Pixels_To_Screen;
 
}


I have it working that way on my GTX with 960 cores, but it's not all that much faster than on a Quad Core (8 threads) CPU, maybe 2x faster at most. It does not do reflection or refraction, only diffuse, no texture, only material colors. I can only get 1 FPS maybe with a 512x512 Cornell scene with 2 spheres, 4K triangles.

I think I'm doing this all wrong still, 1 FPS for 4K triangles is more than bad. I have my KD-Tree data uploaded to the GPU along with the vertices, normal, UVs, and colors, all as READ_ONLY and uploaded only once. (I'm doing static scenes only right now, I don't think I'm ready for animation yet!)

All my Kernel_ call do have to re-upload the info buffer, but that buffer only has ray (dir, org) information and a few other things like skip the ray or not, accumulated color and that's about it.