Skip to content

Commit

Permalink
2枚目のテクスチャとのブレンド方式について文言修正:Additive⇒Average
Browse files Browse the repository at this point in the history
  • Loading branch information
CA-Tatami committed Aug 8, 2024
1 parent 595e7d8 commit f3e9da4
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Nova.Editor.Core.Scripts
public enum AlphaTransitionBlendMode
{
None,
Additive,
Average,
Multiply
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// --------------------------------------------------------------
// Copyright 2022 CyberAgent, Inc.
// Copyright 2024 CyberAgent, Inc.
// --------------------------------------------------------------

using System;
Expand Down Expand Up @@ -307,8 +307,8 @@ private static void SetupAlphaTransitionMaterialKeywords(Material material)
|| material.GetTexture(AlphaTransitionMapSecondTexture2DArrayId) != null
|| material.GetTexture(AlphaTransitionMapSecondTexture3DId) != null;
var blendMode = (AlphaTransitionBlendMode)material.GetFloat(AlphaTransitionSecondTextureBlendMode);
MaterialEditorUtility.SetKeyword(material, ShaderKeywords.AlphaTransitionBlendSecondTexAdditive,
secondTexEnabled && blendMode == AlphaTransitionBlendMode.Additive);
MaterialEditorUtility.SetKeyword(material, ShaderKeywords.AlphaTransitionBlendSecondTexAverage,
secondTexEnabled && blendMode == AlphaTransitionBlendMode.Average);
MaterialEditorUtility.SetKeyword(material, ShaderKeywords.AlphaTransitionBlendSecondTexMultiply,
secondTexEnabled && blendMode == AlphaTransitionBlendMode.Multiply);
}
Expand Down
10 changes: 5 additions & 5 deletions Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// --------------------------------------------------------------
// Copyright 2022 CyberAgent, Inc.
// Copyright 2024 CyberAgent, Inc.
// --------------------------------------------------------------

using System;
Expand Down Expand Up @@ -46,7 +46,7 @@ public static class ShaderKeywords
public const string FlowMapTargetTint = "_FLOW_MAP_TARGET_TINT";
public const string FlowMapTargetEmission = "_FLOW_MAP_TARGET_EMISSION";
public const string FlowMapTargetAlphaTransition = "_FLOW_MAP_TARGET_ALPHA_TRANSITION";

// Parallax Map
public const string ParallaxMapTargetBase = "_PARALLAX_MAP_TARGET_BASE";
public const string ParallaxMapTargetTint = "_PARALLAX_MAP_TARGET_TINT";
Expand All @@ -61,7 +61,7 @@ public static class ShaderKeywords
public const string AlphaTransitionMapMode2D = "_ALPHA_TRANSITION_MAP_MODE_2D";
public const string AlphaTransitionMapMode2DArray = "_ALPHA_TRANSITION_MAP_MODE_2D_ARRAY";
public const string AlphaTransitionMapMode3D = "_ALPHA_TRANSITION_MAP_MODE_3D";
public const string AlphaTransitionBlendSecondTexAdditive = "_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE";
public const string AlphaTransitionBlendSecondTexAverage = "_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE";
public const string AlphaTransitionBlendSecondTexMultiply = "_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY";

// Emission
Expand All @@ -80,7 +80,7 @@ public static class ShaderKeywords
public const string TransparencyByLuminance = "_TRANSPARENCY_BY_LUMINANCE";
public const string SoftParticlesEnabled = "_SOFT_PARTICLES_ENABLED";
public const string DepthFadeEnabled = "_DEPTH_FADE_ENABLED";

// Vertex Deformation
public const string VertexDeformationEnabled = "_VERTEX_DEFORMATION_ENABLED";

Expand Down Expand Up @@ -224,4 +224,4 @@ public static string GetShaderKeyword(this ParallaxMapMode parallaxMapMode)
}
}
}
}
}
16 changes: 8 additions & 8 deletions Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,17 @@ SamplerState GetEmissionMapSamplerState()
// Transforms the alpha transition map UV by the scale/bias property
#ifdef _ALPHA_TRANSITION_MAP_MODE_2D
#define TRANSFORM_ALPHA_TRANSITION_MAP(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMap);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#define TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMapSecondTexture);
#endif
#elif _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY
#define TRANSFORM_ALPHA_TRANSITION_MAP(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMap2DArray);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#define TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMapSecondTexture2DArray);
#endif
#elif _ALPHA_TRANSITION_MAP_MODE_3D
#define TRANSFORM_ALPHA_TRANSITION_MAP(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMap3D);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#define TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMapSecondTexture3D);
#endif
#endif
Expand Down Expand Up @@ -461,17 +461,17 @@ void ApplyColorCorrection(in out float3 color)
// Sample the alpha transition map.
#ifdef _ALPHA_TRANSITION_MAP_MODE_2D
#define SAMPLE_ALPHA_TRANSITION_MAP(uv, progress) SAMPLE_TEXTURE2D(_AlphaTransitionMap, sampler_AlphaTransitionMap, uv);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE2D(_AlphaTransitionMapSecondTexture, sampler_AlphaTransitionMapSecondTexture, uv);
#endif
#elif _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY
#define SAMPLE_ALPHA_TRANSITION_MAP(uv, progress) SAMPLE_TEXTURE2D_ARRAY(_AlphaTransitionMap2DArray, sampler_AlphaTransitionMap2DArray, uv, progress);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE2D_ARRAY(_AlphaTransitionMapSecondTexture2DArray, sampler_AlphaTransitionMapSecondTexture2DArray, uv, progress);
#endif
#elif _ALPHA_TRANSITION_MAP_MODE_3D
#define SAMPLE_ALPHA_TRANSITION_MAP(uv, progress) SAMPLE_TEXTURE3D_LOD(_AlphaTransitionMap3D, sampler_AlphaTransitionMap3D, float3(uv, progress), 0);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE3D_LOD(_AlphaTransitionMapSecondTexture3D, sampler_AlphaTransitionMapSecondTexture3D, float3(uv, progress), 0);
#endif
#endif
Expand Down Expand Up @@ -506,15 +506,15 @@ half GetTransitionAlphaImpl(half4 map, uint channel, half transitionProgress, fl
return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress, dissolveSharpness);
}

#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half transitionProgress, half2 transitionMapSecondUv, half transitionProgressSecond)
{
half4 mainTexMap = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress);
half4 secondTexMap = SAMPLE_ALPHA_TRANSITION_MAP_SECOND(transitionMapSecondUv, transitionMapProgress);
half mainTexAlpha = GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress, _DissolveSharpness);
half secondTexAlpha = GetTransitionAlphaImpl(secondTexMap, (uint)_AlphaTransitionMapSecondTextureChannelsX, transitionProgressSecond, _DissolveSharpnessSecondTexture);

#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE)
mainTexAlpha = (mainTexAlpha + secondTexAlpha) * 0.5;
#endif
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct VaryingsDrawDepth
#endif
#endif

#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
float4 flowTransitionSecondUVs : TEXCOORD8; // xy: FlowMap UV, zw: TransitionMap UV
#endif

Expand Down Expand Up @@ -200,7 +200,7 @@ VaryingsDrawDepth vert(AttributesDrawDepth input)
output.flowTransitionUVs.zw = TRANSFORM_ALPHA_TRANSITION_MAP(input.texcoord.xy);
output.flowTransitionUVs.z += GET_CUSTOM_COORD(_AlphaTransitionMapOffsetXCoord)
output.flowTransitionUVs.w += GET_CUSTOM_COORD(_AlphaTransitionMapOffsetYCoord)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
output.flowTransitionSecondUVs.zw = TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(input.texcoord.xy);
output.flowTransitionSecondUVs.z += GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetXCoord)
output.flowTransitionSecondUVs.w += GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetYCoord)
Expand Down Expand Up @@ -233,7 +233,7 @@ VaryingsDrawDepth vert(AttributesDrawDepth input)

// Transition Map Progress
#if defined(_ALPHA_TRANSITION_MAP_MODE_2D_ARRAY) || defined(_ALPHA_TRANSITION_MAP_MODE_2D_ARRAY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
float transitionMapProgress = _AlphaTransitionMapSecondTextureProgress + GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord);
float sliceCount = _AlphaTransitionMapSecondTextureSliceCount;
#else
Expand Down Expand Up @@ -308,7 +308,7 @@ half4 frag(VaryingsDrawDepth input) : SV_Target
#endif
#ifdef _FLOW_MAP_TARGET_ALPHA_TRANSITION
input.flowTransitionUVs.zw += flowMapUvOffset;
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
input.flowTransitionSecondUVs.zw += flowMapUvOffset;
#endif
#endif
Expand All @@ -334,7 +334,7 @@ half4 frag(VaryingsDrawDepth input) : SV_Target
#ifdef _USE_TRANSITION_MAP
half alphaTransitionProgress = _AlphaTransitionProgress + GET_CUSTOM_COORD(_AlphaTransitionProgressCoord);
ModulateAlphaTransitionProgress(alphaTransitionProgress, input.color.a);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
half alphaTransitionProgressSecondTexture = _AlphaTransitionProgressSecondTexture + GET_CUSTOM_COORD(_AlphaTransitionProgressCoordSecondTexture);
ModulateAlphaTransitionProgress(alphaTransitionProgressSecondTexture, input.color.a);
color.a *= GetTransitionAlpha(input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, alphaTransitionProgress, input.flowTransitionSecondUVs.zw, alphaTransitionProgressSecondTexture);
Expand Down
12 changes: 6 additions & 6 deletions Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Shader "Nova/Particles/UberLit"
// Alpha Transition
#pragma shader_feature_local _ _FADE_TRANSITION_ENABLED _DISSOLVE_TRANSITION_ENABLED
#pragma shader_feature_local _ALPHA_TRANSITION_MAP_MODE_2D _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY _ALPHA_TRANSITION_MAP_MODE_3D
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY

// Emission
#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA
Expand Down Expand Up @@ -355,7 +355,7 @@ Shader "Nova/Particles/UberLit"
// Alpha Transition
#pragma shader_feature_local _ _FADE_TRANSITION_ENABLED _DISSOLVE_TRANSITION_ENABLED
#pragma shader_feature_local _ALPHA_TRANSITION_MAP_MODE_2D _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY _ALPHA_TRANSITION_MAP_MODE_3D
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY

// Emission
//#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA
Expand Down Expand Up @@ -433,7 +433,7 @@ Shader "Nova/Particles/UberLit"
// Alpha Transition
#pragma shader_feature_local _ _FADE_TRANSITION_ENABLED _DISSOLVE_TRANSITION_ENABLED
#pragma shader_feature_local _ALPHA_TRANSITION_MAP_MODE_2D _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY _ALPHA_TRANSITION_MAP_MODE_3D
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY

// Emission
//#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA
Expand Down Expand Up @@ -517,7 +517,7 @@ Shader "Nova/Particles/UberLit"
// Alpha Transition
#pragma shader_feature_local _ _FADE_TRANSITION_ENABLED _DISSOLVE_TRANSITION_ENABLED
#pragma shader_feature_local _ALPHA_TRANSITION_MAP_MODE_2D _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY _ALPHA_TRANSITION_MAP_MODE_3D
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY

// Emission
#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA
Expand Down Expand Up @@ -595,7 +595,7 @@ Shader "Nova/Particles/UberLit"
// Alpha Transition
#pragma shader_feature_local _ _FADE_TRANSITION_ENABLED _DISSOLVE_TRANSITION_ENABLED
#pragma shader_feature_local _ALPHA_TRANSITION_MAP_MODE_2D _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY _ALPHA_TRANSITION_MAP_MODE_3D
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY

// Emission
#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA
Expand Down Expand Up @@ -658,7 +658,7 @@ Shader "Nova/Particles/UberLit"
// Alpha Transition
#pragma shader_feature_local _ _FADE_TRANSITION_ENABLED _DISSOLVE_TRANSITION_ENABLED
#pragma shader_feature_local _ALPHA_TRANSITION_MAP_MODE_2D _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY _ALPHA_TRANSITION_MAP_MODE_3D
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY
#pragma shader_feature_local _ _ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE _ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY

// Transparency
#pragma shader_feature_local _TRANSPARENCY_BY_LUMINANCE
Expand Down
10 changes: 5 additions & 5 deletions Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct Varyings
float2 tintUV : TEXCOORD4; // xy: TintMap UV, zw: EmissionMap UV
#endif
float transitionProgress : TEXCOORD5;
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
float4 flowTransitionSecondUVs : TEXCOORD6; // xy: FlowMap UV, zw: TransitionMap UV
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
Expand Down Expand Up @@ -141,7 +141,7 @@ Varyings ShadowPassVertex(Attributes input)
output.flowTransitionUVs.zw = TRANSFORM_ALPHA_TRANSITION_MAP(input.texcoord.xy);
output.flowTransitionUVs.z += GET_CUSTOM_COORD(_AlphaTransitionMapOffsetXCoord)
output.flowTransitionUVs.w += GET_CUSTOM_COORD(_AlphaTransitionMapOffsetYCoord)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
output.flowTransitionSecondUVs.zw = TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(input.texcoord.xy);
output.flowTransitionSecondUVs.z += GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetXCoord)
output.flowTransitionSecondUVs.w += GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetYCoord)
Expand All @@ -150,7 +150,7 @@ Varyings ShadowPassVertex(Attributes input)

// Transition Map Progress
#if defined(_ALPHA_TRANSITION_MAP_MODE_2D_ARRAY) || defined(_ALPHA_TRANSITION_MAP_MODE_2D_ARRAY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
float transitionMapProgress = _AlphaTransitionMapSecondTextureProgress + GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord);
float sliceCount = _AlphaTransitionMapSecondTextureSliceCount;
#else
Expand Down Expand Up @@ -194,7 +194,7 @@ half4 ShadowPassFragment(Varyings input) : SV_TARGET
#endif
#ifdef _FLOW_MAP_TARGET_ALPHA_TRANSITION
input.flowTransitionUVs.zw += flowMapUvOffset;
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
input.flowTransitionSecondUVs.zw += flowMapUvOffset;
#endif
#endif
Expand Down Expand Up @@ -223,7 +223,7 @@ half4 ShadowPassFragment(Varyings input) : SV_TARGET
{
half alphaTransitionProgress = _AlphaTransitionProgress + GET_CUSTOM_COORD(_AlphaTransitionProgressCoord);
ModulateAlphaTransitionProgress(alphaTransitionProgress, input.color.a);
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_AVERAGE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY)
half alphaTransitionProgressSecondTexture = _AlphaTransitionProgressSecondTexture + GET_CUSTOM_COORD(_AlphaTransitionProgressCoordSecondTexture);
ModulateAlphaTransitionProgress(alphaTransitionProgressSecondTexture, input.color.a);
color.a *= GetTransitionAlpha(input.flowTransitionUVs.zw, input.transitionProgress, alphaTransitionProgress, input.flowTransitionSecondUVs.xy, alphaTransitionProgressSecondTexture);
Expand Down
Loading

0 comments on commit f3e9da4

Please sign in to comment.