what is the role of optixPipelineLinkOptions.maxTraceDepth? and how to use Callable in OWL? #168
-
If I wand to calculate the indirect light, shold I set the maxTraceDepth equal with the prd.maxDepth in shader? I notice that in OWL, it seems the value is always 2. I'd be appreciate if someone and solve my doubts... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Re maxTraceDepth: maxTraceDepth is an optix flag the specifies how deeply you can nest optixTrace calls: in optix, you can launch new rays in two places - raygen and closest hit program - and that flag configures the pipeline to specify how deep you can nest those calls. If you only ever trace rays in the raygen program, then your nesting depth is only 1; if you want to trace a ray from raygen, and want that ray's CH program to trace another ray (say, a shadow ray) then you'll have depth of 2; if you want the CH program to implemen path tracing by recursively tracing more rays from CH programs, then you'll have to use even more of a depth. Note this is expensive, though, since optix has to keep some state around to realize this nesting/recursion. Usually (well, IMHO) it is usually better to realize any sort of recursion in the raygen program, using a while loop around a single, one-deep trace call in raygen. Eg., the typical way I'd implemnet a path tracer is:
which, though it allows for tracing as many "deep" paths as you want, will only have a optix trace depth of 1. The only reason that the default depth in OWL is 2 (rather than my personally preferred 1) is that we have a sample or two that trace shadow rays from CH program. The ideal situation was that the default would be 1, and that there was a function that allowed setting it to another value before pipeline creation .... but that hasn't been done yet. Re callables: I have never yet used callables, so OWL does not yet suppor tem. You can of course take the optix context that owl creates, and do the native optix related calls for callables in your program yourself, but not sure how good of an idea that is. Do you really need callables? |
Beta Was this translation helpful? Give feedback.
Re maxTraceDepth: maxTraceDepth is an optix flag the specifies how deeply you can nest optixTrace calls: in optix, you can launch new rays in two places - raygen and closest hit program - and that flag configures the pipeline to specify how deep you can nest those calls. If you only ever trace rays in the raygen program, then your nesting depth is only 1; if you want to trace a ray from raygen, and want that ray's CH program to trace another ray (say, a shadow ray) then you'll have depth of 2; if you want the CH program to implemen path tracing by recursively tracing more rays from CH programs, then you'll have to use even more of a depth.
Note this is expensive, though, since optix has t…