# OSPRay pathtracer: How to get more vivid colors

**URL:** https://discourse.paraview.org/t/ospray-pathtracer-how-to-get-more-vivid-colors/7951
**Category:** ParaView Support
**Created:** [September 7, 2021, 3:14pm UTC](https://discourse.paraview.org/t/ospray-pathtracer-how-to-get-more-vivid-colors/7951 "2021-09-07T15:14:06Z")
**Posts on this page:** 5
**Page:** 1

<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: [September 7, 2021, 3:14pm UTC](https://discourse.paraview.org/t/ospray-pathtracer-how-to-get-more-vivid-colors/7951/1 "2021-09-07T15:14:06Z")

</div>

With the OSPRay pathtracer I am observing that surfaces are generally less saturated than the actual color they are painted with.

I guess that this has to do with the color of the lighting, and that it could also be tackled by choosing a more sophisticated material than the default.

I am wondering though if there is a quick and easy way of shifting colors more towards the actual color. Even enhancing the overall saturation could help.

Here is a small example: [state.pvsm](https://discourse.paraview.org/uploads/short-url/50kA11LXpwEHHfdMW8IlIsbQwyO.pvsm) (1.2 MB)

After turning on raytracing in the left view one gets the following representation:

 ![screenshot](https://discourse.paraview.org/uploads/default/original/2X/2/2e24d55e66722bcc7003562dfad3c38c7d562ed7.png)

In the right view, colors in the slice match those in the colorbar exactly (via Ambient=1 and Diffuse=0).  
In the left view this is not the case making it difficult to interpret the representation:  
I wouldn’t guess that the darkest blue in the slice matches the darkest blue in the colorbar.

---

<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: [September 8, 2021, 12:05pm UTC](https://discourse.paraview.org/t/ospray-pathtracer-how-to-get-more-vivid-colors/7951/2 "2021-09-08T12:05:23Z")

</div>

Interesting.

I thought at first that this was due to secondary lighting effects. That is ParaView’s default background and lights are set up nicely for primary illumination but result in too much energy overall when the secondary rays are added in. I.e. the default lights and colors are too white for the path tracers.

However I wasn’t able to compensate for that by doing things like making the environmental color black and replacing the lightkit with a single white headlight light. Also, the OSPRay ray caster and OptiX path tracers both make better, more saturated colors than OSPRay path tracer does.

So I think this is an aspect of OSPRay’s OBJ material implementation. If you could file a bug report over on OSPRay github that will help us keep it in mind to improve it.

Note to self, simply bypassing the normalization [here](https://github.com/ospray/ospray/blob/master/ospray/render/materials/OBJ.cpp#L34) doesn’t help.

---

<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: [September 8, 2021, 12:33pm UTC](https://discourse.paraview.org/t/ospray-pathtracer-how-to-get-more-vivid-colors/7951/3 "2021-09-08T12:33:45Z")

</div>

Thank you @Dave_DeMarle.

> [@Dave\_DeMarle](#):
>
> So I think this is an aspect of OSPRay’s OBJ material implementation. If you could file a bug report over on OSPRay github that will help us keep it in mind to improve it.

→ [pathtracer: colors look faded (desaturated) · Issue #492 · ospray/ospray · GitHub](https://github.com/ospray/ospray/issues/492)

---

<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: [September 9, 2021, 4:26pm UTC](https://discourse.paraview.org/t/ospray-pathtracer-how-to-get-more-vivid-colors/7951/4 "2021-09-09T16:26:38Z")

</div>

This is probably related

> [@Different colors using OSPRay pathtracer since PV 5.9](https://discourse.paraview.org/t/7282):
>
> Dear ParaView-Team, I noticed that ParaView 5.9.0 renders images with different colors compared to ParaView 5.8.0 when using the OSPRay pathtracer. Please see the attached screenshots. I used the following PV binaries from your website and ran it on Ubuntu 20.04: ParaView-5.9.0-MPI-Linux-Python3.8-64bit ParaView-5.8.0-MPI-Linux-Python3.7-64bit I used the following steps to obtain the screenshots: started PV with paraview output/soma-clustering/soma-clusterin.pvsm (data files attached) cli…

---

<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: [October 28, 2021, 1:13pm UTC](https://discourse.paraview.org/t/ospray-pathtracer-how-to-get-more-vivid-colors/7951/5 "2021-10-28T13:13:17Z")

</div>

This change seems to address the issue.

[https://gitlab.kitware.com/vtk/vtk/-/merge\_requests/8577](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8577)

I suspect that what happened was OSP 1-2 changed the SRGB default, which obviated the need for this adaptation in VTK. We should confirm that and look for other related bits of code before merging this to avoid breaking something else unintentionally.
