# The New Volumetric Rendering is Beautiful (Also Happy Halloween)

**URL:** https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675
**Category:** Support
**Created:** [October 25, 2022, 11:57am UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675 "2022-10-25T11:57:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fraseyboo](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fraseyboo/32/2411_2.png) [@fraseyboo](https://discourse.vtk.org/u/fraseyboo)
#### Post date: [October 25, 2022, 11:57am UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675/1 "2022-10-25T11:57:36Z")

</div>

So this isn’t really a support post but I just wanted to say how impressive the volumetric rendering is now, the effort you guys put into visual effects like PBR & SSAO is really impressive and has helped me make some really beautiful visualizations of data for my group.

 ![raytraced](https://discourse.vtk.org/uploads/default/original/2X/7/70cc92867a5a4c101cad5d6b121d025de8bc4ea8.jpeg)  
I’m still trying to figure out how to enable SSAO for translucent objects but otherwise things are looking really nice.

I’ve also been exploring some of the more complex features of VTK and now that I understand more about interaction callbacks I made a quick animation in the spirit of the season.  
 ![happy_halloween](https://discourse.vtk.org/uploads/default/original/2X/e/e7cce5eee7682d7fd412994678417d1ef7161211.gif)

Happy Halloween guys.

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [October 25, 2022, 12:12pm UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675/2 "2022-10-25T12:12:50Z")

</div>

Thanks for the kind words, and love that animation!

---

<div class="post-metadata">

### Author: ![Timothee\_Chabat](https://discourse.vtk.org/user_avatar/discourse.vtk.org/timothee_chabat/32/3234_2.png) [@Timothee\_Chabat](https://discourse.vtk.org/u/Timothee_Chabat)
#### Post date: [October 25, 2022, 12:22pm UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675/3 "2022-10-25T12:22:12Z")

</div>

haha very nice usage or callbacks there !

> [@fraseyboo](#):
>
> I’m still trying to figure out how to enable SSAO for translucent objects but otherwise things are looking really nice.

As for this question I don’t think the current implementation of SSAO supports translucent surfaces. I am not sure how relevant SSAO would be relevant for translucents surfaces. Also supporting it would be a bit tricky for cases like the one below because you’d have multiple depth value per pixel

 ![image](https://discourse.vtk.org/uploads/default/original/2X/2/2ac797c61c94404156e6ac87be448831c14f6190.jpeg)

Happy halloween !

---

<div class="post-metadata">

### Author: ![fraseyboo](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fraseyboo/32/2411_2.png) [@fraseyboo](https://discourse.vtk.org/u/fraseyboo)
#### Post date: [October 25, 2022, 1:07pm UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675/4 "2022-10-25T13:07:45Z")

</div>

> [@Timothee\_Chabat](#):
>
> As for this question I don’t think the current implementation of SSAO supports translucent surfaces. I am not sure how relevant SSAO would be relevant for translucents surfaces. Also supporting it would be a bit tricky for cases like the one below because you’d have multiple depth value per pixel
> 
> ![image](https://discourse.vtk.org/uploads/default/original/2X/2/2ac797c61c94404156e6ac87be448831c14f6190.jpeg)

I think you’re right, originally I was thinking of using dual rendering with the translucent actor either being fully opaque or transparent, extracting the SSAO from both & scaling them by the actor opacity but that’d only really work for simple convex objects and scenes. In this case it’d probably look like the image below (just a mock-up I did in PS), not really much of an improvement.

![mockup](https://discourse.vtk.org/uploads/default/original/2X/b/bb4342dd84578410f0ebc4aa2415086aabcd3da7.jpeg)

I imagine you’d need to have a new SSAO layer and depth map for every new region a pixel’s ray path could go through which could get incredibly complex.

---

<div class="post-metadata">

### Author: ![Timothee\_Chabat](https://discourse.vtk.org/user_avatar/discourse.vtk.org/timothee_chabat/32/3234_2.png) [@Timothee\_Chabat](https://discourse.vtk.org/u/Timothee_Chabat)
#### Post date: [October 25, 2022, 2:05pm UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675/5 "2022-10-25T14:05:55Z")

</div>

> [@fraseyboo](#):
>
> originally I was thinking of using dual rendering with the translucent actor either being fully opaque or transparent, extracting the SSAO from both & scaling them by the actor opacity but that’d only really work for simple convex objects and scenes.

yep that could indeed work. It may be possible to keep it simple but I would worry about the perfomance of such an approach when having lots of translucent objects. Feel free to experiment though 🙂

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [October 25, 2022, 5:03pm UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675/6 "2022-10-25T17:03:54Z")

</div>

Super cool!! Coul you share the data to make the original graphics? Would love to toy with this

---

<div class="post-metadata">

### Author: ![fraseyboo](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fraseyboo/32/2411_2.png) [@fraseyboo](https://discourse.vtk.org/u/fraseyboo)
#### Post date: [October 25, 2022, 5:37pm UTC](https://discourse.vtk.org/t/the-new-volumetric-rendering-is-beautiful-also-happy-halloween/9675/8 "2022-10-25T17:37:15Z")

</div>

So the original data comes from one of the example datasets hosted on the Kitware data repo, you can browse all the files in your web browser [here](https://data.kitware.com/#collections) or use the following Python code to grab the exact file I used. There’s also a really interesting chest CT scan on there that I’d recommend checking out too.

```auto
data_url = "https://data.kitware.com/api/v1/file/62daaa69bddec9d0c4bfd42a/download"
data_file = "head_and_neck_ct.vtk"

if not Path(data_file).exists():
    print(f"Downloading {data_file}...")

    # Download the data
    import urllib.request
    urllib.request.urlretrieve(data_url, data_file)

    print("Download complete")

```

I used the same light setup as seen in [this example code](https://github.com/Kitware/LookingGlassVTKModule/blob/master/Examples/Python/cinematic_rendering/head_and_neck_animation.py) however changed some of the illumination parameters and removed the dithering.
