Page MenuHome

Fix T89984: Improve Icon previews reflective and transmissive materials.
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jul 21 2021, 2:57 PM.

Details

Summary

When rendering material icons the floor will not be rendered. This leads to less readability
of the preview icons for metallic and transmissive surfaces.

Master

As no other geometry is in the scene the metallic surfaces only reflect on the lights.
Master:

Cycles

This patch will switch the floor material that uses ray visibility tricks to render a floor for reflective rays.

This patch also works for transmissive materials.

Eevee

Eevee uses screen space reflections that makes this a different problem. There is nothing else drawn in
the scene in screen space so we need a different trick. Using math we convert a reflective ray to UV space
and generate a world that projects a checker pattern to infinity.

The world shader used for shows a checker pattern that act as a floor.

As now the floor is in the world it is being reflected via
a cubemap. As the film is transparent the background (including the floor isn't rendered)

In the future when Eevee supports vulkan raytracing we can re-evaluate and perhaps remove this
approximation.

Alternatives

We tried lightprobes but that wasn't able to do the trick.
Using the compositor would lead to more memory usage (render layers and intermediate buffers) and slower performance.
Solution has been validated with Simon

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Jul 21 2021, 2:57 PM
Jeroen Bakker (jbakker) created this revision.
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jul 21 2021, 3:19 PM
source/blender/editors/render/render_preview.c
290–317

preview_floor_material_name would be consistent with preview_world_name

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jul 21 2021, 6:14 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • Renamed get_preview_floor_material_name to preview_floor_material_name.

I don't think we should do the same trick for material preview as it is too obvious it is fake.

Jeroen Bakker (jbakker) retitled this revision from Fix T89984: Improve Icon previews reflective materials. to Fix T89984: Improve Icon previews reflective and transmissive materials..Jul 27 2021, 12:27 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Jul 27 2021, 1:24 PM

Rebased with latest master.

LGTM except one comment. No need to re-review just for that.

source/blender/editors/render/render_preview.c
400–403

This patch is meant to improve things, but the comment says the opposite (it says that not rendering the floor leads to less readability). This wording would solve that:

"... not be rendered, as this would lead to less readability ..."

This revision is now accepted and ready to land.Aug 9 2021, 10:56 AM
This revision now requires review to proceed.Aug 9 2021, 11:09 AM
This revision is now accepted and ready to land.Aug 11 2021, 2:57 PM