owl-project / NVISII

Apache License 2.0
319 stars 27 forks source link

Add render_ray function #129

Open TontonTremblay opened 2 years ago

TontonTremblay commented 2 years ago

I would like to be able to only sample single rays. I want to define the position and the direction and depending on the flag I pass you return me the resulting values. E.g., rgb, position, depth, material, etc.

I believe people have been mentioning returning the pdf as well from the brdf (not sure how that would look).

natevm commented 2 years ago

This should be doable. I’m thinking this would look very similar to the render_data function, but that it would take a ray origin and direction rather than a SPP. The return would always be a float4 color which would match what you’d get from the render_data function.

Re: pdf/BRDF, I don’t really see how it’d be possible to return a pdf / BRDF directly. For context, there are 10-20 different PDFs evaluated per ray, many of which come from the BRDF being sampled for the next direction, and many coming from light sampling during next event estimation. Many of these PDF evaluations are conditional, and aren’t guaranteed to be evaluated for a given ray. It also adds complexity to keep track of them all in order to return them to the user.