提交 602a9811 编写于 作者: B Ben Houston

Implements approach agreed to here:...

Implements approach agreed to here: https://github.com/mrdoob/three.js/issues/10691 Support Substance OcclusionRoughnessMetallic maps.
上级 a4e4b181
#ifdef USE_AOMAP #ifdef USE_AOMAP
// reads channel R, intended to be used with a combined OcclusionRoughnessMetallic (RGB) texture
float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
reflectedLight.indirectDiffuse *= ambientOcclusion; reflectedLight.indirectDiffuse *= ambientOcclusion;
......
...@@ -3,6 +3,8 @@ float metalnessFactor = metalness; ...@@ -3,6 +3,8 @@ float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP #ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vUv ); vec4 texelMetalness = texture2D( metalnessMap, vUv );
metalnessFactor *= texelMetalness.r;
// reads channel B, intended to be used with a combined OcclusionRoughnessMetallic (RGB) texture
metalnessFactor *= texelMetalness.b;
#endif #endif
...@@ -3,6 +3,8 @@ float roughnessFactor = roughness; ...@@ -3,6 +3,8 @@ float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP #ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vUv ); vec4 texelRoughness = texture2D( roughnessMap, vUv );
roughnessFactor *= texelRoughness.r;
// reads channel G, intended to be used with a combined OcclusionRoughnessMetallic (RGB) texture
roughnessFactor *= texelRoughness.g;
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册