# Ray tracing in paraview

**URL:** https://discourse.paraview.org/t/ray-tracing-in-paraview/6761
**Category:** ParaView Support
**Tags:** opengl, vtk
**Created:** [March 22, 2021, 11:32am UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761 "2021-03-22T11:32:25Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rohitch13](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@rohitch13](https://discourse.paraview.org/u/rohitch13)
#### Post date: [March 22, 2021, 11:32am UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761/1 "2021-03-22T11:32:25Z")

</div>

Hello everyone,  
After LIGGGHTS simulation of tablets, I want to spray coat them. I have read that it can be possible with use of ray-tracing (OpenGL). Can it be done in paraview? or is there a better method out there?

Thanks  
Rohit

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [March 22, 2021, 4:59pm UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761/2 "2021-03-22T16:59:48Z")

</div>

Hi @rohitch13, ParaView does offer some materials rendering capabilities via ray tracing backends. If you are aiming to compute a result of a physical simulation of a spray coating process, ParaView is not the right tool - but if you want to render images of the tablets with a realistic surface, ParaView could be useful.

---

<div class="post-metadata">

### Author: ![rohitch13](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@rohitch13](https://discourse.paraview.org/u/rohitch13)
#### Post date: [March 23, 2021, 4:11am UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761/3 "2021-03-23T04:11:04Z")

</div>

Thanks @cory.quammen , I do want to do a physical simulation of a spray coating process. Do you have any idea what might be the right tool for this? I’m fairly new to this.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [March 23, 2021, 2:50pm UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761/4 "2021-03-23T14:50:27Z")

</div>

I don’t, but maybe someone who sees this who works in this domain will be able to recommend something.

---

<div class="post-metadata">

### Author: ![Thomas\_Caissard](https://discourse.paraview.org/user_avatar/discourse.paraview.org/thomas_caissard/32/5950_2.png) [@Thomas\_Caissard](https://discourse.paraview.org/u/Thomas_Caissard)
#### Post date: [March 23, 2021, 3:57pm UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761/5 "2021-03-23T15:57:40Z")

</div>

I think what you are looking for is some kind of car paint material (which simulates the coating effect on a surface) from OSPray ([Intel OSPRay Documentation](https://www.ospray.org/documentation.html#materials)).

It is feasible to do that in paraview, as we support PBR rendering using the OSPray library. I will ask a colleague and come back to you with details on how to achieve that kind of rendering.

In the meatime, you should try to enable PBR in paraview looking at, for example, this blog post [Introducing Physically Based Rendering with VTK - Kitware Blog](https://blog.kitware.com/vtk-pbr/).

---

<div class="post-metadata">

### Author: ![LfxPaul](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lfxpaul/32/3703_2.png) [@LfxPaul](https://discourse.paraview.org/u/LfxPaul)
#### Post date: [March 23, 2021, 4:22pm UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761/6 "2021-03-23T16:22:13Z")

</div>

Hi,

Coating with the PBR shader of ParaView is not yet merged but should come in few weeks, but you can use OSPray with Principled Material + Clear Coat, or with a CarPaint material.

To use custom OSPray materials in ParaView, you must load a json file that contains material definition. Look at [this repository](https://gitlab.kitware.com/paraview/materials) in the file **ospray\_mats.json**.

This file has to be loaded in ParaView (with RayTracing enabled of course) by clicking on **“File… Load Path Tracer Material”**. Then, you can choose a defined material under the _material_ property as seen below :

![17_19_11-23_03](https://discourse.paraview.org/uploads/default/original/2X/4/4cf4a0f2fca4198e4971baaadc46c978b23de2ef.png)

---

<div class="post-metadata">

### Author: ![Bushra](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bushra/32/6954_2.png) [@Bushra](https://discourse.paraview.org/u/Bushra)
#### Post date: [June 23, 2021, 8:47am UTC](https://discourse.paraview.org/t/ray-tracing-in-paraview/6761/7 "2021-06-23T08:47:17Z")

</div>

Hi Lafoix!  
I am trying to use osray materials as you mentioned but it’s giving me the following error:

```auto
Generic Warning: In /builds/gitlab-kitware-sciviz-ci/build/superbuild/paraview/src/VTK/Rendering/RayTracing/vtkOSPRayMaterialHelpers.cxx, line 259
No material Library in this renderer. Using obj by default.

```

I have loaded the json file as well and it’s showing me materials too but when I select them, I gives me this error. Kindly help.

Thanks
