# BVTKNodes - photorealistic rendering of VTK data in Blender

**URL:** https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268
**Category:** Development
**Created:** [May 10, 2020, 5:52pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268 "2020-05-10T17:52:55Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [May 10, 2020, 5:52pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/1 "2020-05-10T17:52:55Z")

</div>

Hello all scientific visualization people interested in photorealistic rendering!

I’ve been upgrading this amazing add-on for Blender \>2.80 called BVTKNodes, originally created by Silvano Imboden and further developed by Lorenzo Celli for Blender 2.79. BVTKNodes makes it possible to create and execute VTK pipelines configured in Blender Node Editor, to produce surface mesh objects, which can be then visualized in Blender using it’s rendering engines. This makes it possible to create photorealistic images and animations of scientific data in Blender (provided that you know both Blender and VTK well enough!). For more information, have a look at [https://bvtknodes.readthedocs.io](https://bvtknodes.readthedocs.io)

BR,  
Tuomo

 ![isosurfaces](https://discourse.vtk.org/uploads/default/original/2X/f/f8120fb189d94d5220a09f5827d7825619380712.jpeg)

 ![motorbike102_cam01](https://discourse.vtk.org/uploads/default/original/2X/a/a05690677332fb9741c05f8fb2598e775768a9e7.jpeg)  
PS. More images at [https://blenderartists.org/t/bvtknodes-gallery/1161079](https://blenderartists.org/t/bvtknodes-gallery/1161079)

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [May 11, 2020, 12:36pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/2 "2020-05-11T12:36:08Z")

</div>

That is very cool!

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 12, 2020, 12:22am UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/3 "2020-05-12T00:22:07Z")

</div>

Thanks for sharing, this looks interesting. Can you send image data to Blender so that it can display it directly using volume rendering?

---

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [May 12, 2020, 2:13pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/4 "2020-05-12T14:13:10Z")

</div>

I must confess I don’t know too much about volumetrics in Blender. I know it can render volumes enclosed by surface meshes, and there are some interesting looking options like density in the Principled Volume shader, but I haven’t looked into that. Here is example for constant density emission:

 ![Screenshot_2020-05-12_17-00-26](https://discourse.vtk.org/uploads/default/original/2X/b/baf4c8aebc5b9845608aa5d8d7ab82fda748890d.png)

I think volumetrics was part of Lorenzo’s work, but I haven’t had time to look into it: [http://lorenzocelli.me/BVTK/presets/index.html](http://lorenzocelli.me/BVTK/presets/index.html)

BR,  
Tuomo

---

<div class="post-metadata">

### Author: ![Silvano](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Silvano](https://discourse.vtk.org/u/Silvano)
#### Post date: [May 13, 2020, 8:52am UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/5 "2020-05-13T08:52:49Z")

</div>

Hi Andras, thanks for the question.  
Last year Lorenzo Celli provided some support to volume rendering in BVTKNodes,  
but we weren’t completely satisfied due to some limitations in  
the blender python api giving access to the volume-data.  
The good news is that from version 2.83 Blender support the [openvdb](https://www.openvdb.org/) data format,even for time-variant data.  
The openvdb api are open source so you can easily write a vtkImageData to openvdb converter.  
Support for openvdb in Paraview has already been requested [here](https://discourse.paraview.org/t/vdb-files/640)  
Here are a couple of examples.

 ![volume_rendering_eevee](https://discourse.vtk.org/uploads/default/original/2X/1/1a5a00e734f3187cdb13bf552c90b228d16f7484.jpeg)  
(rendered with eevee)  
 ![volume_rendering_cycles](https://discourse.vtk.org/uploads/default/original/2X/b/b9b956b3ebbe1a522a8c79492acff7f76725800e.jpeg)  
(rendered with cycles)  
Under Linux openvdb is supported by the debian packages libopenvdb-dev and python-openvdb,  
but I didn’t found a corresponding packages for pip yet. When this will be available  
we may integrate this feature in BVTKNodes  
BR – Silvano

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 18, 2020, 2:14am UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/6 "2020-05-18T02:14:34Z")

</div>

Thanks for this additional information. All these volume renderings look like an isosurface is extracted from the volume and then rendered as a uniform material. However, this is not that useful for medical applications, because there the main advantage of volume rendering is that you don’t need to extract surfaces but you directly visualize the volume, by defining voxel value -\> (opacity, color) transfer functions. Does Blender support volume rendering of semi-transparent clouds (where each voxel has different opacity and color value)?

---

<div class="post-metadata">

### Author: ![Silvano](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Silvano](https://discourse.vtk.org/u/Silvano)
#### Post date: [May 18, 2020, 8:50am UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/7 "2020-05-18T08:50:16Z")

</div>

The rendering looks like isosurfaces but they are not, here there is another image of the same data with different settings. If you will install Blender 2.83 you can try by yourself, you can get my data and blender file [here](https://drive.google.com/open?id=1q53ztGB9_SETuCnFUWc9cvQZBOLO4Zaw)

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

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 18, 2020, 3:25pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/8 "2020-05-18T15:25:41Z")

</div>

Thanks a lot, I will give this a try!

---

<div class="post-metadata">

### Author: ![Blezek](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blezek/32/1201_2.png) [@Blezek](https://discourse.vtk.org/u/Blezek)
#### Post date: [May 21, 2020, 8:00pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/9 "2020-05-21T20:00:16Z")

</div>

Hi @Silvano, Very interested in volume rendering applications with Blender! Could you share the volume data and Blender file for the full head? I’m not familiar enough with the Volume settings in Blender to figure out how you added the clipping plane. Thanks!

---

<div class="post-metadata">

### Author: ![Blezek](https://discourse.vtk.org/user_avatar/discourse.vtk.org/blezek/32/1201_2.png) [@Blezek](https://discourse.vtk.org/u/Blezek)
#### Post date: [May 21, 2020, 8:31pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/10 "2020-05-21T20:31:55Z")

</div>

And nevermind, I figured out the camera clipping was the issue!

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 21, 2020, 9:22pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/11 "2020-05-21T21:22:08Z")

</div>

@Blezek if you manage to set up some nice volume renderings would you mind posting a few examples here?

---

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [May 24, 2020, 7:38am UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/12 "2020-05-24T07:38:16Z")

</div>

Hi, here’s my quick test using Cycles (path tracing engine). Looks like volume also adsorbs light from light source nicely. Material and render settings have a large effect on results. Quite interesting. 🙂

 ![volume_rendering_cycles_02](https://discourse.vtk.org/uploads/default/original/2X/f/f7afe472c55e74f9ef8e1b767e2f1d7fe0dec85b.jpeg)

---

<div class="post-metadata">

### Author: ![Silvano](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Silvano](https://discourse.vtk.org/u/Silvano)
#### Post date: [May 27, 2020, 10:32am UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/13 "2020-05-27T10:32:11Z")

</div>

nice work Tuomo

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 27, 2020, 5:46pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/14 "2020-05-27T17:46:30Z")

</div>

These examples are still not at the level what VTK’s plain volume raycast mapper can do.

For example, VTK can currently render a cardiac CT ([CTA-cardio.nrrd](https://github.com/Slicer/SlicerTestingData/releases/download/SHA256/3b0d4eb1a7d8ebb0c5a89cc0504640f76a030b4e869e33ff34c564c3d3b88ad2)) like this:

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

But instead we would like to see rendering with more realistic shadows and material appearance, like this (source: [Siemens Healthcare](https://static.healthcare.siemens.com/siemens_hwem-hwem_ssxa_websites-context-root/wcm/idc/groups/public/@global/documents/image/mda4/ndq5/~edisp/cinematic-rendering_16-9-2-05569324/~renditions/cinematic-rendering_16-9-2-05569324~7.jpg)):

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

It would be of course highly desirable if VTK could render such images directly, but in same cases it would be acceptable to export the scene to an external software, such as Blender, for photorealistic rendering or creating animations (with complex camera motion, lighting, etc.).

I’ll try to find time to experiment in Blender, but in the meantime it would be nice to see if anybody can make Blender render volumes with quality that surpasses VTK’s raycaster and approaches photorealistic rendering offered in commercial medical imaging software.

---

<div class="post-metadata">

### Author: ![tkeskita](https://discourse.vtk.org/user_avatar/discourse.vtk.org/tkeskita/32/1757_2.png) [@tkeskita](https://discourse.vtk.org/u/tkeskita)
#### Post date: [May 29, 2020, 2:20pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/15 "2020-05-29T14:20:20Z")

</div>

Hi,

OK here’s a more elaborate render. The trick is how to adjust color and opacities profile. Used 150 samples + denoising.

For more massive sciviz examples with Blender, see also this presentation: [https://www.youtube.com/watch?v=eiRO6vqZRUA](https://www.youtube.com/watch?v=eiRO6vqZRUA)

 ![test_005](https://discourse.vtk.org/uploads/default/original/2X/0/02d86718365f45705739a7bc84aefe2171261d2c.jpeg)

PS. Since Cycles is also a stand-alone render engine, you could theoretically incorporate it into VTK/Paraview. That might require some serious work, though, I’m guessing.

BR,  
Tuomo

---

<div class="post-metadata">

### Author: ![Silvano](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Silvano](https://discourse.vtk.org/u/Silvano)
#### Post date: [May 29, 2020, 5:12pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/16 "2020-05-29T17:12:30Z")

</div>

Thank you Andras for the interesting challenge and for providing the sample data ( is this data free ? can I reuse it ? ).  
Here follows the best result I achieved using your data and Paraview, probably it is possibile to do better but my knowledge of Paraview is limited

 ![pv_04](https://discourse.vtk.org/uploads/default/original/2X/e/ebfca76189ce1fdabefb0033876a03f3a87e0ec4.jpeg)  
The next Image is my best result using volume rendering on Blender, with a very simple light setup  
 ![CTA-blender_01](https://discourse.vtk.org/uploads/default/original/2X/d/db6c412f4891a3c7e01d706ef6d3304429f50f21.jpeg)  
This is the shader-network I used  
 ![CTA-blender](https://discourse.vtk.org/uploads/default/original/2X/a/a24e32ea34143569c52549b2d03d530aefc7e1a7.jpeg)  
and this is the same, with some tweaking from a friend of mine (thanks Daniele).  
 ![busto_1](https://discourse.vtk.org/uploads/default/original/2X/b/b0eee97b1f3eaa00de3bf18fe6361b1d5cfceee2.jpeg)  
[Here is the Blender file and the data converted in openvdb](https://drive.google.com/file/d/1E8IAC3YLfq1815FGRt1L0KqN7r330fOW/view?usp=sharing)

My personal conclusions:

- Matching the quality of the CTA-cardio-cinematic was not possible, but that image was created from a dataset of an higher quality (see for example the details on the surface of the bones ).
- Using Paraview you can reach a very good level of quality in short time, even with a limited knowledge of the tool.
- Using Blender you can probably go further, but you need a knowledge of the tool and is time consuming.

Beyond the challenge, we presented here VtkNodes not to compete against the Kitware tools, but to let you know that Blender and Vtk can play together nicely. Maybe a more interesting scenario for using VtkNodes is for people developing custom application requiring surface editing tools ( e.g. dental implant, ad-hoc prosthesis planning …) those tools are missing in Vtk by design, while there are a plenty of them in Blender. Using VtkNodes you can import your data in Blender, transform it in a blender mesh, use any of the tools provided, re-convert the data to VTK and export it, and all of this using only free applications and addons.

– Silvano

---

<div class="post-metadata">

### Author: ![pieper](https://discourse.vtk.org/user_avatar/discourse.vtk.org/pieper/32/17_2.png) [@pieper](https://discourse.vtk.org/u/pieper)
#### Post date: [May 29, 2020, 5:19pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/17 "2020-05-29T17:19:06Z")

</div>

Nice work 👍 Thank you for reporting.

> [@Silvano](#):
>
> Thank you Andras for the interesting challenge and for providing the sample data ( is this data free ? can I reuse it ? ).

Yes, that’s Slicer sample data distributed under the terms [of the Slicer license](https://github.com/Slicer/Slicer/blob/master/License.txt).

---

<div class="post-metadata">

### Author: ![Silvano](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Silvano](https://discourse.vtk.org/u/Silvano)
#### Post date: [May 29, 2020, 5:28pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/18 "2020-05-29T17:28:51Z")

</div>

yes – that was a cheap trick — if you are still interested, in my latest post you can find a link to another example an data

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 29, 2020, 6:12pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/19 "2020-05-29T18:12:10Z")

</div>

Thank you, these are very nice renderings.

Did you use OptiX renderer in Paraview? Can you share the ParaView state file?

What was the rendering time in Paraview and Blender?

The Siemens example may use slightly higher resolution image, but probably the main difference is due to that Siemens uses some automatic segmentation to distinguish bone, vasculature, tools, etc. and render them with different material properties.

> Maybe a more interesting scenario for using VtkNodes is for people developing custom application requiring surface editing tools ( e.g. dental implant, ad-hoc prosthesis planning …) those tools are missing in Vtk by design, while there are a plenty of them in Blender

Implant planning is more similar to CAD design and mostly done using parametric modeling, which Blender is probably not the best tool for. Also, implant planning does not require fancy rendering, but mostly relies on measurements on slice and projection views and simple 3D rendering.

But photorealistic rendering of a few nice images of the final plan could be useful for for communication with patients, training materials, and presentations.

---

<div class="post-metadata">

### Author: ![Silvano](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@Silvano](https://discourse.vtk.org/u/Silvano)
#### Post date: [May 29, 2020, 7:21pm UTC](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268/20 "2020-05-29T19:21:47Z")

</div>

Hi Andras – I used the OSPRaycaster, and [this](https://drive.google.com/file/d/1BgcdyfRXBZquWq-XNX52ivYOl-fOObrS/view?usp=sharing) is the link the statefile, not exaclty ‘that’ statefile, but the closest I have. About rendering time it is near real time in Paraview (seconds) and about 15 minutes for Cycles. You can have real time volume rendering in Blender by using EEVEE if sacrificing some quality. But I often spend much more time in tuning the visualization than in the rendering.  
About your consideration on possible usage of VtkNodes I get your point, nevertheless at each Blender Conference there are at least a couple of talk about using Blender for research pourpose, and some of them were using vtk too. Time will show 🙂 – thank you – Silvano

[Next page](https://discourse.vtk.org/t/bvtknodes-photorealistic-rendering-of-vtk-data-in-blender/3268.md?page=2)
