Skip to content

Commit

Permalink
defineからconst halfに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
CA-Tatami committed Mar 15, 2024
1 parent ada84f7 commit 10abd50
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ inline void ApplyEmissionColor(in out half4 color, half2 emissionMapUv, float in
half emissionChannelsX)
{
// Texture compression may introduce an error of 1/256, so it's advisable to allow for some margin
#define TEX_COMP_ERR_MARGIN 0.004
const half tex_comp_err_margin = 0.004;

half emissionIntensity = 0;
half emissionColorRampU = 0;
Expand All @@ -501,13 +501,13 @@ inline void ApplyEmissionColor(in out half4 color, half2 emissionMapUv, float in
#if defined(_EMISSION_COLOR_COLOR) || defined(_EMISSION_COLOR_BASECOLOR)
emissionIntensity = emissionMapValue;
#elif _EMISSION_COLOR_MAP
emissionIntensity = step(TEX_COMP_ERR_MARGIN, emissionMapValue);
emissionIntensity = step(tex_comp_err_margin, emissionMapValue);
emissionColorRampU = emissionMapValue;
#endif
#elif _EMISSION_AREA_ALPHA
emissionIntensity = step(TEX_COMP_ERR_MARGIN, 1.0 - color.a);
emissionIntensity = step(tex_comp_err_margin, 1.0 - color.a);
emissionColorRampU = color.a;
color.a = _KeepEdgeTransparency >= 0.5f ? color.a : step(TEX_COMP_ERR_MARGIN, color.a);
color.a = _KeepEdgeTransparency >= 0.5f ? color.a : step(tex_comp_err_margin, color.a);
#endif

half3 emissionColor = 0;
Expand All @@ -521,8 +521,6 @@ inline void ApplyEmissionColor(in out half4 color, half2 emissionMapUv, float in

emissionIntensity *= intensity;
color.rgb += emissionColor * emissionIntensity;

#undef TEX_COMP_ERR_MARGIN
}

// Returns the value defined by rim.
Expand Down

0 comments on commit 10abd50

Please sign in to comment.