• Advertisement
Sign in to follow this  

Is there any open source GPU ray tracer?

This topic is 1800 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It's my first post on GameDev. Exciting to find such a nice place!

I've started to write my ray tracer, but things are getting harder than I thought. Is there any opensource cuda ray tracer that I can take a look at? better to be with full whitted ray tracing functionality and accleration data structure. I've searched some but non of them work as I expected.

thank you very much!

Share this post


Link to post
Share on other sites
Advertisement

Certainly. Have a look here: https://github.com/peterkutz/GPUPathTracer. It's a physically based path tracer, I it uses a kd-tree but I am not sure if they actually got around to implementing it. Well, actually, CUDA already has kd-tree code (cukd). There's also tokaspt, which is a CUDA port of the "smallpt" program. An OpenCL port also exists, but has less features.

 

As for whitted ray tracing, though, I don't know of any, but that's probably because I don't look around for that. You should be able to modify the code to a whitted model fairly easily, though, the hardest part in a ray tracer is getting the initialization logic and various subsystems (ray-scene intersection, asset loading) up, the actual rendering code is very simple.

 

Plus, why would you implement whitted ray tracing on a GPU when rasterization can achieve pretty much the same visual results much faster? I believe that is why people prefer to implement realistic rendering methods on the GPU, rather than basic ray tracing, but there have been whitted benchmarks published so there must be some code somewhere.

 

Also, welcome to GameDev! smile.png

Edited by Bacterius

Share this post


Link to post
Share on other sites

Yeah, ray tracing is so demanding that I never use it in my work. It simply is not needed for a game with the alternatives. 

 

Someday, maybe within 10 to 20 years, computer power will allow significant ray tracing in any game with all the other assets, but until then it is relegated to image rendering for the most part.

 

Master shader technology and you will forget about ray tracing.  Usually you would get more real life, realistic appearance with shaders anyhow.

Share this post


Link to post
Share on other sites

Master shader technology and you will forget about ray tracing.  Usually you would get more real life, realistic appearance with shaders anyhow.

It might surprise you just how many shaders implement mini-raytracers internally, or use raytracing techniques...

Share this post


Link to post
Share on other sites

There are plenty of hybrid technologies out there, but fact is that raytracing is demanding on performance.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement