RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
985 stars 180 forks source link

Question: Any way to get depth to volume "surface"? #476

Closed estan closed 3 years ago

estan commented 3 years ago

Hi all,

Hope a question is OK here, otherwise please close and direct me to a forum/mailing list :)

I'm reading up about OSPRay and have a question: If I have a structured volume rendered, I assume that if I request the depth channel, it will be the depth to the volume bounding box? Is there some way to get the depth of the volume surface (first not-fully-transparent voxel along ray from camera), in order to get a picture showing the volume topography as seen from the camera?

Cheers, Elvis

estan commented 3 years ago

I should add: I'm hoping to be able to do this without first running an algo (e.g. marching cubes / flying edges) to create an isosurface.

johguenther commented 3 years ago

Currently volumes do not affect the depth buffer. The reason is mainly to agree on a good definition of what depth should mean for a volume

BTW: this is also a bit related to picking (ospPick()), where currently only geometries are taken into account.

johguenther commented 3 years ago

PS: As a workaround for now you could have a look into this module: https://github.com/cosmoscout/csp-volume-rendering/tree/develop/ospray_modules/volume_depth/ospray It implements a custom renderer that writes depth for volumes (with various different selectable modes or definitions what to take as depth).

carsonbrownlee commented 3 years ago

I would be concerned that if it were "hit of the bounding box" it may cause issues for the denoiser.

estan commented 3 years ago

Thanks @johguenther, question answered so closing issue :+1: And thanks for the pointer.