GPU style shaders in raytracing

Practical and theoretical implementation discussion.
mrluzeiro
Posts: 28
Joined: Tue May 26, 2015 2:27 pm

GPU style shaders in raytracing

Postby mrluzeiro » Tue Oct 13, 2015 9:37 am

Hello all,
I was wondering if there are any experiences or discussions on using 'GPU style shaders' in raytracing.
I was thinking to try to use SSAO (screen space ambient occlusion) in my CPU raytracing.

Also, couldn't that technics be used in GPU raytracers as well?

szellmann
Posts: 51
Joined: Fri Oct 10, 2014 9:15 am
Contact:

Re: GPU style shaders in raytracing

Postby szellmann » Tue Oct 13, 2015 10:28 am

SSAO is computed in a fragment shader. You will have to pass a depth buffer texture to the shader. A depth buffer is fairly simple to generate as a ray tracing result, you basically just store first hit positions in world/object space and later transform them to OpenGL window coordinates.

I wouldn't consider such a rendering pass part of the ray tracing pipeline, but rather a post processing step, similar to the compositing step you perform when you render geometry e.g. from both ray tracing and OpenGL in a single frame.

If you treat it as such - a post processing step that is independent from ray tracing and implemented with shaders - yes, this is applicable to a GPU ray tracer. Say you do direct rendering, you will unmap/unbind the rendering PBO in your compute context, and pass it over to the OpenGL/DirectX realm for further processing.

Shaders in general are entry points to a fixed function pipeline. The ray tracing pipeline differs from the rasterization pipeline, thus I would expect other types of "shaders", e.g. ones that determine how a ray is treated that just left the scene (a "miss" program/shader). Have a look at Nvidia Optix for such an approach.


Return to “General Development”

Who is online

Users browsing this forum: No registered users and 8 guests