From dae0f55fec9aa35b5496e55f8aff15fea21eaa82 Mon Sep 17 00:00:00 2001 From: jk20012001 Date: Tue, 19 Sep 2023 15:41:49 +0800 Subject: [PATCH] fix albedoScaleAndCutOff type mismatch (#16282) --- .../util/dcc/imported-metallic-roughness.effect | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/editor/assets/effects/util/dcc/imported-metallic-roughness.effect b/editor/assets/effects/util/dcc/imported-metallic-roughness.effect index a385d707dde..2ab10f99fb8 100644 --- a/editor/assets/effects/util/dcc/imported-metallic-roughness.effect +++ b/editor/assets/effects/util/dcc/imported-metallic-roughness.effect @@ -25,7 +25,7 @@ CCEffect %{ emissiveMap: { value: grey, editor: { displayName: EmissiveColorMap } } alphaSource: { value: 1.0, editor: { slide: true, range: [0, 1.0], step: 0.001 } } alphaSourceMap: { value: grey, editor: { parent: USE_OPACITY_MAP } } - alphaThreshold: { value: 0.5, target: albedoScaleAndCutoff.w, editor: { parent: USE_ALPHA_TEST, slide: true, range: [0, 1.0], step: 0.001 } } + alphaThreshold: { value: 0.5, editor: { parent: USE_ALPHA_TEST, slide: true, range: [0, 1.0], step: 0.001 } } normalStrength: { value: 1.0, editor: { parent: USE_NORMAL_MAP, slide: true, range: [0, 1.0], step: 0.001 } } normalMap: { value: normal } - &forward-add @@ -55,8 +55,8 @@ CCEffect %{ properties: tilingOffset: { value: [1.0, 1.0, 0.0, 0.0] } mainColor: { value: [1.0, 1.0, 1.0, 1.0], target: albedo, editor: { displayName: Albedo, type: color } } - albedoScale: { value: [1.0, 1.0, 1.0], target: albedoScaleAndCutoff.xyz } - alphaThreshold: { value: 0.5, target: albedoScaleAndCutoff.w, editor: { parent: USE_ALPHA_TEST } } + albedoScale: { value: 1.0, editor: { displayName: BaseWeight } } + alphaThreshold: { value: 0.5, editor: { parent: USE_ALPHA_TEST } } mainTexture: { value: grey, target: albedoMap, editor: { displayName: AlbedoMap } } alphaSource: { value: 1.0, editor: { slide: true, range: [0, 1.0], step: 0.001 } } alphaSourceMap: { value: grey, editor: { parent: USE_OPACITY_MAP } } @@ -96,7 +96,6 @@ CCProgram shared-ubos %{ uniform Constants { vec4 tilingOffset; vec4 albedo; - vec4 albedoScaleAndCutoff; vec4 emissive; float emissiveScale; float occlusion; @@ -105,6 +104,7 @@ CCProgram shared-ubos %{ float normalStrength; float alphaSource; float albedoScale; + float alphaThreshold; float specularIntensity; }; }% @@ -237,7 +237,7 @@ CCProgram surface-fragment %{ #endif #endif #if USE_ALPHA_TEST - if (baseColor.a < albedoScaleAndCutoff.w) discard; + if (baseColor.a < alphaThreshold) discard; #endif return baseColor; } @@ -265,7 +265,7 @@ CCProgram surface-fragment %{ #endif #endif - if (alpha < albedoScaleAndCutoff.w) discard; + if (alpha < alphaThreshold) discard; #endif }