question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

envMaps = refraction not working in r131 for PBR materials

See original GitHub issue

Describe the bug

Since release 131 it’s not possible to change the mapping of the envMap to RefractionMapping for PBR materials.

r130 r131
r130 r131

Probably it is related to the following adjustment:

The envMap property of MeshStandardMaterial and MeshPhysicalMaterial is now internally converted to a PMREM.

See also:

To Reproduce

Steps to reproduce the behavior:

  1. Checkout tag r130 or r131
  2. Run three.js/docs/scenes/material-browser.html#MeshStandardMaterial
  3. Change parameter (roughness: 0, metalness: 1, color: ffffff, envMaps: refraction

(or run material-browser: https://threejs.org/docs/scenes/material-browser.html#MeshStandardMaterial directly)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Mar 9, 2022

This means that mapping type refraction has no longer an effect for PBR materials?

When CubeUVRefractionMapping is removed, yes. The automatic PMREM conversion does already support only reflection.

I have not achieved a comparable effect with PBR materials and transmission properties.

The effect of CubeUVRefractionMapping is physically not correct so using refraction based on transmission will look different.

And is the parameter refractionRatio for PBR materials still relevant?

When CubeUVRefractionMapping is removed, then no.

As I understand it, all other mappings (CubeRefractionMapping, EquirectangularRefractionMapping) are also affected (for PBR materials) when refraction is no longer supported?

PBR materials only supports the cubeUV format. Meaning CubeRefractionMapping, CubeReflectionMapping as well as EquirectangularRefractionMapping and EquirectangularReflectionMapping are no valid mappings.

1reaction
mrdoobcommented, Mar 7, 2022

Oh wait, I guess you mean removing it only from the PBR materials but still keep the code for the other materials?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the Refractiontexture with a PBR Material - Questions
The refraction is made based on a screen texture without the related object. However when using two of these, the result is a...
Read more >
Topics tagged pbr - three.js forum
Topics tagged pbr. ... 2, 404, October 13, 2021. Problems with envMaps when updating from r130 to r131 ... PBR material looks too...
Read more >
The PBR Guide - Part 1 - 3D & AR - Adobe
As with metals, we need to use real-world measured values, but it can be difficult to find an index of refraction (IOR) for...
Read more >
Cinema 4D: PBR Workflow And ProRender - YouTube
In this video tutorial we go over the PBR workflow within Cinema 4D, we will cover what PBR is and isn't, and we...
Read more >
PBR Nodes in Node Materials Part 4 - YouTube
Patrick is back with part 4 of our series on PBR nodes in the Babylon.js Node Material. In this one, he takes us...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found