# path tracer rendering bug with low opacity overlapping objects?

**URL:** https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279
**Category:** Development
**Created:** [March 27, 2024, 11:53pm UTC](https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279 "2024-03-27T23:53:08Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pgges24](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@pgges24](https://discourse.paraview.org/u/pgges24)
#### Post date: [March 27, 2024, 11:53pm UTC](https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279/1 "2024-03-27T23:53:09Z")

</div>

Hi,  
I found some strange image artifacts when using the pathtracing render mode together with many overlapping objects at low opacity. Could this be some bug on the paraview side or is this a general ospray issue?

I initially discovered this when trying to gracefully blank out low values in a dense streamline visualization but have simplified the reproducer as follows:

Start with the points source with “radius” 1 and some high number of points. Add a calculator filter that outputs Component\_X in order to have some spatially varying value across the points and set “point size” to some high enough value to get some nice large spheres in the raytracer. (The problem also appears when using the glyph filter instead of relying on the implicit sphere rendering of the raytracers via point size).

With the raycaster the scene then looks like this:

 ![snap_no_opacity](https://discourse.paraview.org/uploads/default/original/2X/4/4050bbb2ca88e371206d2ba2b1a88ef13f12ff1d.png)

Activating “opacity mapping for surfaces” and mapping opacity values below about half the color range to zero looks as expected in the raycaster:

 ![snap_opacity_raycast](https://discourse.paraview.org/uploads/default/original/2X/e/e07505733f897d1ad45f341d08be0de23e133af5.png)

Switching to the pathtracer results in black artefacts in low opacity regions where many spheres overlap:

 ![snap_opacity_pathtrace](https://discourse.paraview.org/uploads/default/original/2X/e/e5b999cee8075558d09cba54fdc9ac65725d5c6e.jpeg)

Trying this out with fewer larger spheres works out fine:

 ![snap_opacity_pathtrace_few](https://discourse.paraview.org/uploads/default/original/2X/b/b090d80e25e1475b3d53014c4d5d438da1ca8c02.png)

But increasing their number we are back to black:

 ![snap_opacity_pathtrace_many](https://discourse.paraview.org/uploads/default/original/2X/5/5eae8641cf142a08e49d6f623f164873d6a6db44.jpeg)

The issue seems to be mainly with very low opacity values. If i just use an opacity ramp across the whole color range no black spots appear as the opacity is not low enough:

 ![snap_opacity_pathtrace_many_ramp](https://discourse.paraview.org/uploads/default/original/2X/f/fcfeeba2f6671037be5d8e47c0ccae2365bb8283.jpeg)

You can actually get the artifacts just by setting the opacity value of the point source object to low values directly so this does not seem to be related to the opacity mapping for surfaces via the color map but more of a general opacity issue.  
Is this something i should file a paraview issue for? Maybe there is some hidden ospray setting i can modify to get rid of this effect?

The images were generated using a linux build of paraview 5.11 but I see the same on a variety of versions of the official windows binaries on a different machine. Earliest i tested was 5.6

---

<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 28, 2024, 8:40am UTC](https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279/2 "2024-03-28T08:40:58Z")

</div>

I confirm this behavior.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/7/73b240894575eba3a229930d2ae19350f9469d85.jpeg)

Steps to reproduce:

- PointSource, 1000 points, 1 radius, Apply
- Elevation, Apply
- Color by elevation, enable opacity for surface
- PointSize 20
- Enable Raytracing, Enable pathtracer

---

<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 28, 2024, 8:41am UTC](https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279/3 "2024-03-28T08:41:36Z")

</div>

@pgges24 please open an issue: [https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

FYI @Charles_Gueunet @Lucas_Givord @Dave_DeMarle

---

<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 28, 2024, 2:17pm UTC](https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279/4 "2024-03-28T14:17:49Z")

</div>

Not sure why but it doesn’t appear that this is exposed in the ParaView GUI.  
[Rendering/RayTracing/vtkOSPRayRendererNode.cxx · master · VTK / VTK · GitLab (kitware.com)](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/RayTracing/vtkOSPRayRendererNode.cxx?ref_type=heads#L1222)

---

<div class="post-metadata">

### Author: ![pgges24](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@pgges24](https://discourse.paraview.org/u/pgges24)
#### Post date: [March 28, 2024, 9:20pm UTC](https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279/5 "2024-03-28T21:20:30Z")

</div>

Thanks for looking into this. I’ll submit an issue later.

So you are suggesting this could be solved by increasing the maxPathLength? I tried to expose this setting in the gui but increasing the value to something like 5000 did not affect the issue: [https://gitlab.kitware.com/pgges/paraview/-/commit/938b4d83fec50c15b683d70498148a2293805c93](https://gitlab.kitware.com/pgges/paraview/-/commit/938b4d83fec50c15b683d70498148a2293805c93)  
Is what i did sufficient to hook up the paraview ui side to the vtk ospray setting?

---

<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: [April 19, 2024, 12:00pm UTC](https://discourse.paraview.org/t/path-tracer-rendering-bug-with-low-opacity-overlapping-objects/14279/6 "2024-04-19T12:00:45Z")

</div>

posted by @pgges24 [https://gitlab.kitware.com/paraview/paraview/-/issues/22566](https://gitlab.kitware.com/paraview/paraview/-/issues/22566)
