visit-dav / visit

VisIt - Visualization and Data Analysis for Mesh-based Scientific Data
https://visit.llnl.gov
BSD 3-Clause "New" or "Revised" License
437 stars 116 forks source link

Trilinear RC lighting is very dark #4136

Closed aowen87 closed 4 years ago

aowen87 commented 4 years ago

Describe the bug

When performing trilinear ray casting/compositing, enabling the lighting option results in a very dark rendering (from any angle). The ambient, diffuse, specular, and shininess options are available, but they have no noticeable affect (which may be due to the fact that it's just so dark).

Helpful additional information

Impact

Likelihood

To Reproduce

Steps to reproduce the behavior. For example:

  1. Open globe.silo (or any of our test datasets)
  2. Add a volume plot, and set the rendering method to trilinear compositing.
  3. Enable lighting, and render.

Expected behavior

The rendering shouldn't be so dark.

Attachments

This is globe.silo rendered with trilinear compositing and lighting enabled: Screen Shot 2019-12-03 at 2 47 29 PM

This is noise.silo rendered with trilinear compositing and lighting enabled: Screen Shot 2019-12-03 at 2 48 43 PM

This is noise.silo rendered with rasterization and lighting enabled. The camera position is the same as above: Screen Shot 2019-12-03 at 2 48 55 PM

aowen87 commented 4 years ago

This appears to be related to calling AddLightingHeadlight instead of AddLighting. This is the only volume rendering method I can find that uses this method; all the others use AddLighting. If I switch the trilinear method to AddLighting, the shading/lighting looks correct.

aowen87 commented 4 years ago

In the rendering options for ray casting, there is a reduction factor with a default value of "Lower", which generates the lighting power used in phong shading. It looks like this lighting power has a much greater affect on shading in AddLightingHeadlight than the standard AddLighting. As a result, the default setting makes it look black. If you change this setting to a higher value, the shading looks correct.

aowen87 commented 4 years ago

Incorporating the lighting power into diffuse only (similar to how it's handled in AddLighting) gives a much smoother and more reasonable result.