# Ray tracing with volume rendering

**URL:** https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498
**Category:** ParaView Support
**Created:** [June 4, 2020, 12:19am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498 "2020-06-04T00:19:59Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Gwang-Jin\_Lee](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gwang-jin_lee/32/3689_2.png) [@Gwang-Jin\_Lee](https://discourse.paraview.org/u/Gwang-Jin_Lee)
#### Post date: [June 4, 2020, 12:19am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/1 "2020-06-04T00:19:59Z")

</div>

Hello.

I am trying to render my wavefront obj files with netCDF. And I would like to apply the ray tracing to the obj files. But, when I applied the ray tracing with OptiX, the volume-rendered netCDF data disappeared:

 ![raytracing](https://discourse.paraview.org/uploads/default/original/2X/c/cc7129dbb0fe5be6801d95de123bf3a814ff6384.jpeg)

Is it impossible to use OptiX with volume ray casting (or IndeX)?  
Thank you.

Version : Paraview 5.8.0  
CPU : AMD Ryzen Threadripper 2990WX 32-Core Processor  
GPU : NVIDIA TITAN RTX 24G

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 4, 2020, 2:13am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/2 "2020-06-04T02:13:57Z")

</div>

Afaik, not ray tracing backend in ParaView support volume rendering (yet).

---

<div class="post-metadata">

### Author: ![Gwang-Jin\_Lee](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gwang-jin_lee/32/3689_2.png) [@Gwang-Jin\_Lee](https://discourse.paraview.org/u/Gwang-Jin_Lee)
#### Post date: [June 4, 2020, 2:20am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/3 "2020-06-04T02:20:33Z")

</div>

Thank you for explanations. I look forward to the feature.

---

<div class="post-metadata">

### Author: ![Michael](https://discourse.paraview.org/user_avatar/discourse.paraview.org/michael/32/16_2.png) [@Michael](https://discourse.paraview.org/u/Michael)
#### Post date: [June 4, 2020, 7:09am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/4 "2020-06-04T07:09:54Z")

</div>

You can use OSPRay raycaster backend to visualize volumes. It is not possible with OSPRay pathtracer yet but we are working on it.

---

<div class="post-metadata">

### Author: ![estan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/estan/32/6230_2.png) [@estan](https://discourse.paraview.org/u/estan)
#### Post date: [March 20, 2021, 8:42am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/5 "2021-03-20T08:42:57Z")

</div>

I’m curious whether this is still the case. Or is it possible to use the OSPRay pathtracer for volume rendering nowadays?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 22, 2021, 11:44am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/6 "2021-03-22T11:44:50Z")

</div>

> is it possible to use the OSPRay pathtracer for volume rendering nowadays?

No, not yet.

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)
#### Post date: [March 25, 2021, 2:13pm UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/7 "2021-03-25T14:13:10Z")

</div>

Just an update, it is possible with OSPRay path tracer since PV 5.9.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 25, 2021, 2:15pm UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/8 "2021-03-25T14:15:57Z")

</div>

I just tried with pv 5.9 without success on a wavelet source. Am i missing something ?

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)
#### Post date: [March 25, 2021, 2:20pm UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/9 "2021-03-25T14:20:24Z")

</div>

Shouldn’t be anything tricky, just turn on ray tracing. Default is ospray ray caster, volume rendering there has worked since 5.2 or so. The difference in 5.9 is that when you change to ospray path tracer the volume rendering now appears where as up to 5.8 it disappeared as it wasn’t supported.

I’ll check too.

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)
#### Post date: [March 25, 2021, 2:23pm UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/10 "2021-03-25T14:23:43Z")

</div>

Works for me on Linux and Windows (and should on pre M1 macs). Note with path tracer speckling is worse, so you will want more samples per pixel.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 30, 2021, 8:38am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/11 "2021-03-30T08:38:52Z")

</div>

Indeed, it works !

---

<div class="post-metadata">

### Author: ![bastian](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bastian/32/7513_2.png) [@bastian](https://discourse.paraview.org/u/bastian)
#### Post date: [March 14, 2022, 10:40am UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/12 "2022-03-14T10:40:34Z")

</div>

Ospray pathtracer does not volume-render rectilinear grid data. So a ResampleToImage filter may be required.

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)
#### Post date: [March 15, 2022, 2:50pm UTC](https://discourse.paraview.org/t/ray-tracing-with-volume-rendering/4498/13 "2022-03-15T14:50:43Z")

</div>

OpenVKL does not yet have a rectilinear grid data type, so users have to either resample to image or convert to unstructured for scivis or pathtracer backends to volume render it.

Supporting it natively would entail adding rectgrid to OpenVKL and OSPRay and adding a vtkOSPRayRectGridMapper to VTK that maps VTK’s RectGrid mapper state to corresponding OSPRay API calls.
