MeshPhysicalMaterial should use the thin surface model when thickness is zero
See original GitHub issueThe thin-surface model and the volume model should be separate models in the MeshPhysicalMaterial
shader.
Currently, only the volume model is implemented, and if thickness is 0, all components of attenuation color must be non-zero, otherwise the material renders black. A properly-implemented thin-surface model would prevent that.
Maybe define USE_VOLUME
if ( .thickness > 0 )
. Then something like:
#ifdef USE_TRANSMISSION
#ifdef USE_TRANSMISSIONMAP
transmissionFactor *= texture2D( transmissionMap, vUv ).r;
#endif
#ifdef USE_THICKNESSMAP
thicknessFactor *= texture2D( thicknessMap, vUv ).g;
#endif
#ifdef USE_VOLUME
vec4 transmission = getIBLVolumeRefraction( ... );
#else
vec4 transmission = getIBLThinSurfaceRefraction( ... );
#endif
totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );
#endif
three.js version: r.137
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
MeshPhysicalMaterial – three.js docs
The thickness of the volume beneath the surface. The value is given in the coordinate space of the mesh. If the value is...
Read more >MeshPhysicalMaterial - Three.js Tutorials - sbcode.net
In this lecture we experiment with the Three.js MeshPhysicalMaterial. It is an extension of the MeshStandardMaterial which gives more reflectivity options.
Read more >MeshPhysicalMaterial - Verge3D User Manual - Soft8Soft
Represents the thickness of the clear coat layer, from 0.0 to 1.0. Use clear coat related properties to enable multilayer materials that have...
Read more >Creating the Effect of Transparent Glass and Plastic in Three.js
They can be used to set the stage for how our material responds to ... MeshPhysicalMaterial({ roughness: 0, transmission: 1, thickness: 0.5 ......
Read more >Surface Type | High Definition RP | 14.0.4 - Unity - Manual
Transparent, Simulates a transparent Material that light can penetrate, ... Use the thin refraction model with thin objects if you use the Path...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can give it a go. Where do I find
getIBLThinSurfaceRefraction
?Thanks @WestLangley! I haven’t run into this problem yet in working with MeshPhysicalMaterial, but I agree with your suggestions here. 👍