未验证 提交 5be52675 编写于 作者: M Mr.doob 提交者: GitHub

ShaderChunk: Fixed transmission crash when using flat shading (#21897)

上级 a5d903ff
......@@ -16,7 +16,6 @@ export default /* glsl */`
vec3 pos = vWorldPosition.xyz / vWorldPosition.w;
vec3 v = normalize( cameraPosition - pos );
vec3 viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 n = normalize( vNormal );
float ior = ( 1.0 + 0.4 * reflectivity ) / ( 1.0 - 0.4 * reflectivity );
// From https://google.github.io/filament/Filament.html#materialsystem/parameterization/remapping
......@@ -24,7 +23,7 @@ export default /* glsl */`
vec3 f90 = vec3( 1.0 );
vec3 f_transmission = totalTransmission * getIBLVolumeRefraction(
n, v, viewDir, roughnessFactor, diffuseColor.rgb, f0, f90,
normal, v, viewDir, roughnessFactor, diffuseColor.rgb, f0, f90,
pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,
attenuationColor, attenuationDistance);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册