Experimental Development Framework (C++ and ray tracing)

Practical and theoretical implementation discussion.
Emphy
Posts: 5
Joined: Tue Sep 02, 2014 7:36 am

Experimental Development Framework (C++ and ray tracing)

Post by Emphy » Mon Sep 29, 2014 8:53 am

Dear all,

Currently I am working on my master thesis that is about Global Illumination, with a focus on efficient path tracing methods. At first, my implementation for my experiments was done with Nvidia's OptiX. However the structure and nature of OptiX (CUDA) makes it hard for me to debug everything that happens. Ideally I would like to setup a scene using OBJ-files (or whatever) that I can view in realtime with just some diffuse lighting and textures. When I start implementing path tracing I will require acceleration structures which will efficiently handle/return ray-object intersections, the rest I can handle myself I guess with lots of coding. Now the problem for me is the following: I would really require some means of visual debugging in combination with the existing ray tracing framework. Draw certain rays, how they are bouncing, adding spheres on the intersections, etc. Draw lines between connected nodes, all that stuff. In some seperate window I will output the current rendering of the scene I'm watching, preferably in realtime. A bit like Unity3D where you have your debug window that allows for editting/manipulation and the Game window where the 'real' thing happens.

I'm having some trouble finding the right combination of frameworks / packages to use together and was hoping some of you may have stumbled upon the same problem and found a suitable solution. Intel's Embree seems pretty suitable but it's documentation is fairly limited; I'm afraid I will hit another brick wall with that.

TL;DR: How to combine openGL/D3D application with good ray tracing framework to realtime debug ray-casts, bounces etc.

Thank you for your time, hope it makes sense!

P.S. Sorry if this has to go in the Tools section

Emphy

MohamedSakr
Posts: 83
Joined: Thu Apr 24, 2014 2:27 am

Re: Experimental Development Framework (C++ and ray tracing)

Post by MohamedSakr » Mon Sep 29, 2014 1:03 pm

check Timo Aila framework :) , https://mediatech.aalto.fi/~timo/ , paper: Understanding the Efficiency of Ray Traversal on GPUs.

implementation: https://code.google.com/p/understanding ... l-on-gpus/
much simpler than Optix, more controllable, you can modify anything

AranHase
Posts: 9
Joined: Fri May 16, 2014 11:00 pm

Re: Experimental Development Framework (C++ and ray tracing)

Post by AranHase » Mon Sep 29, 2014 8:36 pm

Emphy wrote:Intel's Embree seems pretty suitable but it's documentation is fairly limited; I'm afraid I will hit another brick wall with that.
I don't think the documentation is limited, but it may look like that because Embree is a low-level library. In practice, all it does is calculate the intersection between a ray and the scene, so no shaders, OpenGL, model loading, textures, etc. It doesn't even give you a parallel implementation (the tutorials use a task-based multi-core approach, but not the library itself). But, since it is a low-level library you can build your own debug drawings on top of it, all you have to do is to calculate the intersection between your "debug object" and the ray.

Emphy
Posts: 5
Joined: Tue Sep 02, 2014 7:36 am

Re: Experimental Development Framework (C++ and ray tracing)

Post by Emphy » Tue Sep 30, 2014 12:18 pm

Would that make Embree a good choice? Referring back to my original post, I want to make a preview window with my models etc, and then an output window where the path tracer result is shown. I have previously built some simple GPU path tracers in D3D and ofcourse OptiX but I prefer to make my new implementation platform independent while still getting nice performance in the area of looking up intersections. This leads me to believe that maybe a CPU path tracer might be a better idea than one on the GPU.

I have looked also at Nori which was developed for a university but I'm not sure that's really suitable. It looks nice, though.

friedlinguini
Posts: 89
Joined: Thu Apr 11, 2013 5:15 pm

Re: Experimental Development Framework (C++ and ray tracing)

Post by friedlinguini » Tue Sep 30, 2014 1:51 pm


AranHase
Posts: 9
Joined: Fri May 16, 2014 11:00 pm

Re: Experimental Development Framework (C++ and ray tracing)

Post by AranHase » Tue Sep 30, 2014 10:45 pm

Emphy wrote:Would that make Embree a good choice? Referring back to my original post, I want to make a preview window with my models etc, and then an output window where the path tracer result is shown. I have previously built some simple GPU path tracers in D3D and ofcourse OptiX but I prefer to make my new implementation platform independent while still getting nice performance in the area of looking up intersections. This leads me to believe that maybe a CPU path tracer might be a better idea than one on the GPU.
I had a realtime Whitted Raytracer in OpenCL (GPU), but decided to try Embree after it was suggested to me in this forum and I really liked it. Note that my opinion about Embree is biased because my application is suited for a CPU renderer. I'm dealing with models with 10+GB of memory and an absurd amount of data going between the renderer and the logic task, something that would be very trick to solve using GPU (and is not your typical 3D application).

Embree was extremely easy to start using compared to OpenCL. For me, developing entirely on CPU was a more pleasant experience. You get better tools to debug and profile your code, as you can use your usual set of tools for the task. On OpenCL I had lots of systems crash, display freezing requiring a full reboot each time something went wrong (thanks AMD?).

Embree is also very fast. Depending on your application you can get realtime raytracing even on an i7 4770k CPU. I recommend checking the "tutorials" accompanying the library. There is a path tracer included.

Now, although Embree is fast, it is not as fast as my OpenCL implementation, specially at the intersection tests. Note that I'm comparing an i7 4770k CPU to a RadeonHD 7990 GPU.

cgribble
Posts: 2
Joined: Tue Sep 30, 2014 7:05 pm

Re: Experimental Development Framework (C++ and ray tracing)

Post by cgribble » Tue Sep 30, 2014 11:52 pm

Not surprisingly, I like rtVTK: http://www.rtvtk.org

I've been overhauling the entire system, which includes an Embree plugin, but that's been delayed due to some other projects. However, it should be straightforward to integrate your own ray tracer---based on Embree or otherwise---in the existing release (v1.3.7).

joulsoun
Posts: 8
Joined: Wed Aug 20, 2014 6:56 am

Re: Experimental Development Framework (C++ and ray tracing)

Post by joulsoun » Wed Oct 01, 2014 1:57 pm

Have you considered Mitsuba? Quite popular in research currently, there's a Qt-GUI with a realtime GL renderer, it should be hackable to do what you want. The big points for me is that it is maintained, very readable code, has quite awesome features to be honest, and I managed to build it myself (idiot test so to say).

ypoissant
Posts: 97
Joined: Wed Nov 30, 2011 12:44 pm

Re: Experimental Development Framework (C++ and ray tracing)

Post by ypoissant » Wed Oct 01, 2014 6:00 pm

cgribble wrote:Not surprisingly, I like rtVTK: http://www.rtvtk.org
That looks cool. I'll take a look at this. Thanks.

Emphy
Posts: 5
Joined: Tue Sep 02, 2014 7:36 am

Re: Experimental Development Framework (C++ and ray tracing)

Post by Emphy » Thu Oct 02, 2014 10:47 pm

joulsoun wrote:Have you considered Mitsuba? Quite popular in research currently, there's a Qt-GUI with a realtime GL renderer, it should be hackable to do what you want. The big points for me is that it is maintained, very readable code, has quite awesome features to be honest, and I managed to build it myself (idiot test so to say).
It looks quite nice indeed, however it just seems to me it already does it all... so not much learning for me to be done :)

Post Reply