-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Open
Labels
Milestone
Description
The 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
Mugen87