Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix albedoScaleAndCutOff type mismatch #16282

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 } }
Expand Down Expand Up @@ -96,7 +96,6 @@ CCProgram shared-ubos %{
uniform Constants {
vec4 tilingOffset;
vec4 albedo;
vec4 albedoScaleAndCutoff;
vec4 emissive;
float emissiveScale;
float occlusion;
Expand All @@ -105,6 +104,7 @@ CCProgram shared-ubos %{
float normalStrength;
float alphaSource;
float albedoScale;
float alphaThreshold;
float specularIntensity;
};
}%
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -265,7 +265,7 @@ CCProgram surface-fragment %{
#endif
#endif

if (alpha < albedoScaleAndCutoff.w) discard;
if (alpha < alphaThreshold) discard;
#endif
}

Expand Down
Loading