From 456f490ff2bd89a32773a36e13d0d5aa0aeae11d Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Mon, 5 Aug 2024 21:30:50 +0900 Subject: [PATCH 01/12] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E7=9A=84=E3=81=AA?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=81=AE=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 5d2bd001e534dc31508738a7362f4c8f5de3e815) --- .../Materials/mat_demo_fade_edgeemission.mat | 20 +++++++- .../Demo00/Materials/mat_demo_flowmap.mat | 27 +++++++++- .../Core/Scripts/AlphaTransitionBlendMode.cs | 13 +++++ .../Scripts/AlphaTransitionBlendMode.cs.meta | 11 ++++ .../Core/Scripts/MaterialPropertyNames.cs | 7 +++ .../Core/Scripts/ParticlesUberCommonGUI.cs | 17 +++++++ .../ParticlesUberCommonMaterialProperties.cs | 26 ++++++++++ ...ParticlesUberUnlitMaterialPostProcessor.cs | 26 +++++++++- .../Editor/Core/Scripts/ShaderKeywords.cs | 2 + .../Runtime/Core/Shaders/ParticlesUber.hlsl | 51 +++++++++++++++++-- .../ParticlesUberDepthNormalsCore.hlsl | 2 +- .../Core/Shaders/ParticlesUberLit.shader | 15 +++++- .../Shaders/ParticlesUberShadowCaster.hlsl | 2 +- .../Core/Shaders/ParticlesUberUnlit.hlsl | 11 +++- .../Core/Shaders/ParticlesUberUnlit.shader | 13 +++++ 15 files changed, 233 insertions(+), 10 deletions(-) create mode 100644 Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs create mode 100644 Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs.meta diff --git a/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat b/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat index 4b96725f..b3e3d38c 100644 --- a/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat +++ b/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat @@ -10,6 +10,7 @@ Material: m_Name: mat_demo_fade_edgeemission m_Shader: {fileID: 4800000, guid: 1bc5c6a70411243779ce486a98012125, type: 3} m_ValidKeywords: + - _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE - _ALPHA_TRANSITION_MAP_MODE_2D - _BASE_MAP_MODE_2D - _EMISSION_AREA_ALPHA @@ -43,6 +44,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture: + m_Texture: {fileID: 2800000, guid: e5c1bb044a69c48868c1f381762bbcea, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture2DArray: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BaseMap: m_Texture: {fileID: 2800000, guid: cac707016af934ee5a416cab14da7246, type: 3} m_Scale: {x: 1, y: 1} @@ -72,7 +85,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _EmissionColorRamp: - m_Texture: {fileID: 2800000, guid: ad948d6c337974eff945b4e9670f88f3, type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _EmissionMap: @@ -156,10 +169,14 @@ Material: - _AlphaTransitionMapOffsetYCoord: 0 - _AlphaTransitionMapProgress: 0 - _AlphaTransitionMapProgressCoord: 0 + - _AlphaTransitionMapSecondTextureChannelsX: 1 + - _AlphaTransitionMapSecondTextureOffsetXCoord: 0 + - _AlphaTransitionMapSecondTextureOffsetYCoord: 0 - _AlphaTransitionMapSliceCount: 4 - _AlphaTransitionMode: 1 - _AlphaTransitionProgress: 0 - _AlphaTransitionProgressCoord: 1 + - _AlphaTransitionSecondTextureBlendMode: 1 - _BaseMapMirrorSampling: 0 - _BaseMapMode: 0 - _BaseMapOffsetXCoord: 0 @@ -259,6 +276,7 @@ Material: - _ShadowCasterAlphaEffectedByTransparencyLuminance: 0 - _ShadowCasterAlphaEffectedByTransparencySoftParticles: 0 - _ShadowCasterAlphaTestEnabled: 1 + - _ShadowCasterApplyVertexDeformation: 0 - _ShadowCasterEnabled: 1 - _ShadowCasterVertexDeformationEnabled: 0 - _Smoothness: 0.5 diff --git a/Assets/Demo/Demo00/Materials/mat_demo_flowmap.mat b/Assets/Demo/Demo00/Materials/mat_demo_flowmap.mat index 4fdd1d7a..048c68ab 100644 --- a/Assets/Demo/Demo00/Materials/mat_demo_flowmap.mat +++ b/Assets/Demo/Demo00/Materials/mat_demo_flowmap.mat @@ -37,7 +37,8 @@ Material: m_CustomRenderQueue: 3000 stringTagMap: RenderType: Transparent - disabledShaderPasses: [] + disabledShaderPasses: + - SHADOWCASTER m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -53,6 +54,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture2DArray: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BaseMap: m_Texture: {fileID: 2800000, guid: f4fa818b17f5d4014a924801d07cd980, type: 3} m_Scale: {x: 1, y: 1} @@ -166,10 +179,14 @@ Material: - _AlphaTransitionMapOffsetYCoord: 0 - _AlphaTransitionMapProgress: 0 - _AlphaTransitionMapProgressCoord: 0 + - _AlphaTransitionMapSecondTextureChannelsX: 0 + - _AlphaTransitionMapSecondTextureOffsetXCoord: 0 + - _AlphaTransitionMapSecondTextureOffsetYCoord: 0 - _AlphaTransitionMapSliceCount: 4 - _AlphaTransitionMode: 0 - _AlphaTransitionProgress: 0 - _AlphaTransitionProgressCoord: 0 + - _AlphaTransitionSecondTextureBlendMode: 0 - _BaseMapMirrorSampling: 0 - _BaseMapMode: 0 - _BaseMapOffsetXCoord: 0 @@ -247,6 +264,14 @@ Material: - _RimTransparencyProgressCoord: 0 - _RimTransparencySharpness: 0.5 - _RimTransparencySharpnessCoord: 0 + - _ShadowCasterAlphaAffectedByAlphaTransitionMap: 0 + - _ShadowCasterAlphaAffectedByFlowMap: 0 + - _ShadowCasterAlphaAffectedByTintColor: 0 + - _ShadowCasterAlphaAffectedByTransparencyLuminance: 0 + - _ShadowCasterAlphaCutoff: 0.5 + - _ShadowCasterAlphaTestEnabled: 0 + - _ShadowCasterApplyVertexDeformation: 0 + - _ShadowCasterEnabled: 0 - _Smoothness: 0.5 - _SmoothnessTextureChannel: 0 - _SoftParticlesEnabled: 0 diff --git a/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs new file mode 100644 index 00000000..3b4a0315 --- /dev/null +++ b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs @@ -0,0 +1,13 @@ +// -------------------------------------------------------------- +// Copyright 2021 CyberAgent, Inc. +// -------------------------------------------------------------- + +namespace Nova.Editor.Core.Scripts +{ + public enum AlphaTransitionBlendMode + { + None, + Additive, + Multiply + } +} \ No newline at end of file diff --git a/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs.meta b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs.meta new file mode 100644 index 00000000..165eb9d4 --- /dev/null +++ b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45568673416f62948b4e7cb51e45fc18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs index e66be087..0df640d6 100644 --- a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs +++ b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs @@ -120,6 +120,13 @@ public static class MaterialPropertyNames public const string AlphaTransitionMapOffsetYCoord = "_AlphaTransitionMapOffsetYCoord"; public const string AlphaTransitionMapChannelsX = "_AlphaTransitionMapChannelsX"; public const string AlphaTransitionMapSliceCount = "_AlphaTransitionMapSliceCount"; + public const string AlphaTransitionSecondTextureBlendMode = "_AlphaTransitionSecondTextureBlendMode"; + public const string AlphaTransitionMapSecondTexture = "_AlphaTransitionMapSecondTexture"; + public const string AlphaTransitionMapSecondTexture2DArray = "_AlphaTransitionMapSecondTexture2DArray"; + public const string AlphaTransitionMapSecondTexture3D = "_AlphaTransitionMapSecondTexture3D"; + public const string AlphaTransitionMapSecondTextureOffsetXCoord = "_AlphaTransitionMapSecondTextureOffsetXCoord"; + public const string AlphaTransitionMapSecondTextureOffsetYCoord = "_AlphaTransitionMapSecondTextureOffsetYCoord"; + public const string AlphaTransitionMapSecondTextureChannelsX = "_AlphaTransitionMapSecondTextureChannelsX"; public const string AlphaTransitionProgress = "_AlphaTransitionProgress"; public const string AlphaTransitionProgressCoord = "_AlphaTransitionProgressCoord"; public const string DissolveSharpness = "_DissolveSharpness"; diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs index 5b63c698..31949598 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs @@ -379,16 +379,20 @@ private void InternalDrawAlphaTransitionProperties() props.AlphaTransitionMapModeProp.Value); var alphaTransitionMapMode = (AlphaTransitionMapMode)props.AlphaTransitionMapModeProp.Value.floatValue; MaterialProperty alphaTransitionMapProp; + MaterialProperty alphaTransitionMapSecondTextureProp; switch (alphaTransitionMapMode) { case AlphaTransitionMapMode.SingleTexture: alphaTransitionMapProp = props.AlphaTransitionMapProp.Value; + alphaTransitionMapSecondTextureProp = props.AlphaTransitionMapSecondTextureProp.Value; break; case AlphaTransitionMapMode.FlipBook: alphaTransitionMapProp = props.AlphaTransitionMap2DArrayProp.Value; + alphaTransitionMapSecondTextureProp = props.AlphaTransitionMapSecondTexture2DArrayProp.Value; break; case AlphaTransitionMapMode.FlipBookBlending: alphaTransitionMapProp = props.AlphaTransitionMap3DProp.Value; + alphaTransitionMapSecondTextureProp = props.AlphaTransitionMapSecondTexture3DProp.Value; break; default: throw new ArgumentOutOfRangeException(); @@ -417,6 +421,19 @@ private void InternalDrawAlphaTransitionProperties() } } } + + // 2nd Texture + { + MaterialEditorUtility.DrawEnumProperty(_editor, "2nd Texture Blend Mode", + props.AlphaTransitionSecondTextureBlendModeProp.Value); + var alphaTransitionSecondTextureBlendMode = (AlphaTransitionBlendMode)props.AlphaTransitionSecondTextureBlendModeProp.Value.floatValue; + if (alphaTransitionSecondTextureBlendMode != AlphaTransitionBlendMode.None) + { + MaterialEditorUtility.DrawTexture(_editor, alphaTransitionMapSecondTextureProp, + props.AlphaTransitionMapSecondTextureOffsetXCoordProp.Value, props.AlphaTransitionMapSecondTextureOffsetYCoordProp.Value, + props.AlphaTransitionMapSecondTextureChannelsXProp.Value, null); + } + } if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook || alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending) diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs index 53bc9216..8a507f88 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs @@ -129,6 +129,13 @@ public void Setup(MaterialProperty[] properties) AlphaTransitionMapOffsetYCoordProp.Setup(properties); AlphaTransitionMapChannelsXProp.Setup(properties); AlphaTransitionMapSliceCountProp.Setup(properties); + AlphaTransitionSecondTextureBlendModeProp.Setup(properties); + AlphaTransitionMapSecondTextureProp.Setup(properties); + AlphaTransitionMapSecondTexture2DArrayProp.Setup(properties); + AlphaTransitionMapSecondTexture3DProp.Setup(properties); + AlphaTransitionMapSecondTextureOffsetXCoordProp.Setup(properties); + AlphaTransitionMapSecondTextureOffsetYCoordProp.Setup(properties); + AlphaTransitionMapSecondTextureChannelsXProp.Setup(properties); AlphaTransitionProgressProp.Setup(properties); AlphaTransitionProgressCoordProp.Setup(properties); DissolveSharpnessProp.Setup(properties); @@ -373,6 +380,25 @@ public void Setup(MaterialProperty[] properties) public ParticlesGUI.Property AlphaTransitionMapSliceCountProp { get; } = new(PropertyNames.AlphaTransitionMapSliceCount); + + public ParticlesGUI.Property AlphaTransitionSecondTextureBlendModeProp { get; } = + new(PropertyNames.AlphaTransitionSecondTextureBlendMode); + + public ParticlesGUI.Property AlphaTransitionMapSecondTextureProp { get; } = new(PropertyNames.AlphaTransitionMapSecondTexture); + + public ParticlesGUI.Property AlphaTransitionMapSecondTexture2DArrayProp { get; } = + new(PropertyNames.AlphaTransitionMapSecondTexture2DArray); + + public ParticlesGUI.Property AlphaTransitionMapSecondTexture3DProp { get; } = new(PropertyNames.AlphaTransitionMapSecondTexture3D); + + public ParticlesGUI.Property AlphaTransitionMapSecondTextureOffsetXCoordProp { get; } = + new(PropertyNames.AlphaTransitionMapSecondTextureOffsetXCoord); + + public ParticlesGUI.Property AlphaTransitionMapSecondTextureOffsetYCoordProp { get; } = + new(PropertyNames.AlphaTransitionMapSecondTextureOffsetYCoord); + + public ParticlesGUI.Property AlphaTransitionMapSecondTextureChannelsXProp { get; } = + new(PropertyNames.AlphaTransitionMapSecondTextureChannelsX); public ParticlesGUI.Property AlphaTransitionProgressProp { get; } = new(PropertyNames.AlphaTransitionProgress); diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs index 9de6eb36..64b3af72 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs @@ -53,6 +53,15 @@ public static class ParticlesUberUnlitMaterialPostProcessor private static readonly int AlphaTransitionMap3DId = Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionMap3D); + + private static readonly int AlphaTransitionMapSecondTextureId = + Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionMapSecondTexture); + + private static readonly int AlphaTransitionMapSecondTexture2DArrayId = + Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionMapSecondTexture2DArray); + + private static readonly int AlphaTransitionMapSecondTexture3DId = + Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionMapSecondTexture3D); private static readonly int AlphaTransitionProgressCoordId = Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionProgressCoord); @@ -63,6 +72,9 @@ public static class ParticlesUberUnlitMaterialPostProcessor private static readonly int AlphaTransitionMapModeId = Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionMapMode); + private static readonly int AlphaTransitionSecondTextureBlendMode = + Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionSecondTextureBlendMode); + private static readonly int EmissionAreaTypeId = Shader.PropertyToID(MaterialPropertyNames.EmissionAreaType); private static readonly int EmissionColorTypeId = Shader.PropertyToID(MaterialPropertyNames.EmissionColorType); private static readonly int EmissionMapModeId = Shader.PropertyToID(MaterialPropertyNames.EmissionMapMode); @@ -276,7 +288,7 @@ private static void SetupAlphaTransitionMaterialKeywords(Material material) MaterialEditorUtility.SetKeyword(material, ShaderKeywords.FadeTransitionEnabled, fadeTransitionEnabled); MaterialEditorUtility.SetKeyword(material, ShaderKeywords.DissolveTransitionEnabled, dissolveTransitionEnabled); - + var alphaTransitionMapMode = (AlphaTransitionMapMode)material.GetFloat(AlphaTransitionMapModeId); foreach (AlphaTransitionMapMode value in Enum.GetValues(typeof(AlphaTransitionMapMode))) { @@ -284,6 +296,18 @@ private static void SetupAlphaTransitionMaterialKeywords(Material material) var keyword = value.GetShaderKeyword(); MaterialEditorUtility.SetKeyword(material, keyword, isOn); } + + // 2nd Texture + { + bool secondTexEnabled = material.GetTexture(AlphaTransitionMapSecondTextureId) != null + || 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.AlphaTransitionBlendSecondTexMultiply, + secondTexEnabled && blendMode == AlphaTransitionBlendMode.Multiply); + } } private static void SetupEmissionMaterialKeywords(Material material) diff --git a/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs b/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs index 1d8a4c8a..b906ea0d 100644 --- a/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs +++ b/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs @@ -61,6 +61,8 @@ 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 AlphaTransitionBlendSecondTexMultiply = "_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY"; // Emission public const string EmissionAreaAll = "_EMISSION_AREA_ALL"; diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index 874f6a3b..fb80fe41 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -17,10 +17,16 @@ TEXTURE2D(_FlowMap); SAMPLER(sampler_FlowMap); TEXTURE2D(_AlphaTransitionMap); SAMPLER(sampler_AlphaTransitionMap); +TEXTURE2D(_AlphaTransitionMapSecondTexture); +SAMPLER(sampler_AlphaTransitionMapSecondTexture); TEXTURE2D_ARRAY(_AlphaTransitionMap2DArray); SAMPLER(sampler_AlphaTransitionMap2DArray); +TEXTURE2D_ARRAY(_AlphaTransitionMapSecondTexture2DArray); +SAMPLER(sampler_AlphaTransitionMapSecondTexture2DArray); TEXTURE3D(_AlphaTransitionMap3D); SAMPLER(sampler_AlphaTransitionMap3D); +TEXTURE3D(_AlphaTransitionMapSecondTexture3D); +SAMPLER(sampler_AlphaTransitionMapSecondTexture3D); TEXTURE2D(_EmissionMap); SAMPLER(sampler_EmissionMap); TEXTURE2D_ARRAY(_EmissionMap2DArray); @@ -109,12 +115,19 @@ DECLARE_CUSTOM_COORD(_FlowIntensityCoord); float4 _AlphaTransitionMap_ST; float4 _AlphaTransitionMap2DArray_ST; float4 _AlphaTransitionMap3D_ST; +float4 _AlphaTransitionMapSecondTexture_ST; +float4 _AlphaTransitionMapSecondTexture2DArray_ST; +float4 _AlphaTransitionMapSecondTexture3D_ST; + float _AlphaTransitionMapProgress; DECLARE_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); float _AlphaTransitionMapSliceCount; DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetXCoord); DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetYCoord); +DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetXCoord); +DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetYCoord); half _AlphaTransitionMapChannelsX; +half _AlphaTransitionMapSecondTextureChannelsX; float _AlphaTransitionProgress; DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoord); float _DissolveSharpness; @@ -330,10 +343,19 @@ 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) + #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) + #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) + #define TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMapSecondTexture3D); + #endif #endif // Transforms the alpha transition map UV by the scale/bias property @@ -433,10 +455,19 @@ 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) + #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) + #define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE2D_ARRAY(_AlphaTransitionMapSecondTexture2DArray, sampler_AlphaTransitionMapSecondTexture2D, uv); + #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) + #define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE3D_LOD(_AlphaTransitionMapSecondTexture3D, sampler_AlphaTransitionMapSecondTexture3D, uv); + #endif #endif void ModulateAlphaTransitionProgress(in out half progress, half vertexAlpha) @@ -450,11 +481,24 @@ void ModulateAlphaTransitionProgress(in out half progress, half vertexAlpha) } // Returns alpha value by the alpha transition. -half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half transitionMapProgress, - half transitionMapChannelsX) +half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half transitionMapProgress) { half4 map = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); - half transitionAlpha = map[(uint)transitionMapChannelsX]; + half transitionAlpha = map[(uint)_AlphaTransitionMapChannelsX]; + + #if defined(_FADE_TRANSITION_ENABLED) || defined(_DISSOLVE_TRANSITION_ENABLED) + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) + half4 secondMap = SAMPLE_ALPHA_TRANSITION_MAP_SECOND(transitionMapUv, transitionMapProgress); + half secondTransitionAlpha = secondMap[(uint)_AlphaTransitionMapSecondTextureChannelsX]; + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) + transitionAlpha = (transitionAlpha + secondTransitionAlpha) * 0.5; + #endif + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) + transitionAlpha = transitionAlpha * secondTransitionAlpha; + #endif + #endif + #endif + #ifdef _FADE_TRANSITION_ENABLED transitionProgress = (transitionProgress * 2 - 1) * -1; transitionAlpha += transitionProgress; @@ -464,6 +508,7 @@ half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half tra transitionProgress = lerp(-dissolveWidth, 1.0 + dissolveWidth, transitionProgress); transitionAlpha = smoothstep(transitionProgress - dissolveWidth, transitionProgress + dissolveWidth, transitionAlpha); #endif + return transitionAlpha; } diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl index 4fee81fb..0e9f7b3e 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl @@ -312,7 +312,7 @@ half4 frag(VaryingsDrawDepth input) : SV_Target #ifdef _USE_TRANSITION_MAP half alphaTransitionProgress = _AlphaTransitionProgress + GET_CUSTOM_COORD(_AlphaTransitionProgressCoord); ModulateAlphaTransitionProgress(alphaTransitionProgress, input.color.a); - color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, _AlphaTransitionMapChannelsX); + color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x); #endif // NOTE : Not need in DepthNormals pass. diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader index 768bffc1..b65a56db 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader @@ -114,6 +114,13 @@ Shader "Nova/Particles/UberLit" _AlphaTransitionMapOffsetYCoord("Alpha Transition Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapChannelsX("Alpha Transition Map Channes X", Float) = 0.0 _AlphaTransitionMapSliceCount("Alpha Transition Map Slice Count", Float) = 4.0 + _AlphaTransitionSecondTextureBlendMode("Alpha Transition Second Texture BlendMode", Float) = 0.0 + _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} + _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} + _AlphaTransitionMapSecondTexture3D("Alpha Transition Second Texture Map 3D", 3D) = "" {} + _AlphaTransitionMapSecondTextureOffsetXCoord("Alpha Transition Second Texture Map Offset X Coord", Float) = 0.0 + _AlphaTransitionMapSecondTextureOffsetYCoord("Alpha Transition Second Texture Map Offset Y Coord", Float) = 0.0 + _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 @@ -265,7 +272,8 @@ 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 + // Emission #pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA #pragma shader_feature_local _EMISSION_MAP_MODE_2D _EMISSION_MAP_MODE_2D_ARRAY _EMISSION_MAP_MODE_3D @@ -341,6 +349,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 // Emission //#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -418,6 +427,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 // Emission //#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -501,6 +511,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 // Emission #pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -578,6 +589,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 // Emission #pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -637,6 +649,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 // Transparency #pragma shader_feature_local _TRANSPARENCY_BY_LUMINANCE diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl index 543f2b95..1e5adab1 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl @@ -204,7 +204,7 @@ half4 ShadowPassFragment(Varyings input) : SV_TARGET { half alphaTransitionProgress = _AlphaTransitionProgress + GET_CUSTOM_COORD(_AlphaTransitionProgressCoord); ModulateAlphaTransitionProgress(alphaTransitionProgress, input.color.a); - color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionProgress, _AlphaTransitionMapChannelsX); + color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionProgress); } #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl index 3737d8d4..098ec3be 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl @@ -46,6 +46,9 @@ struct Varyings float3 viewDirTS : TEXCOORD9; float3 parallaxMapUVAndProgress : TEXCOORD10; #endif + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) + float4 flowTransitionSecondUVs : TEXCOORD11; // xy: FlowMap UV, zw: TransitionMap UV + #endif UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -166,6 +169,11 @@ Varyings vertUnlit(Attributes input, out float3 positionWS, uniform bool useEmis 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) + 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) + #endif #endif // Transition Map Progress @@ -281,7 +289,8 @@ half4 fragUnlit(in out Varyings input, uniform bool useEmission) #if defined(_FADE_TRANSITION_ENABLED) || defined(_DISSOLVE_TRANSITION_ENABLED) half alphaTransitionProgress = _AlphaTransitionProgress + GET_CUSTOM_COORD(_AlphaTransitionProgressCoord); ModulateAlphaTransitionProgress(alphaTransitionProgress, input.color.a); - color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, _AlphaTransitionMapChannelsX); + half transition_alpha = GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x); + color.a *= transition_alpha; #endif // Vertex Color diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader index 4928cc39..e8a56bfb 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader @@ -89,6 +89,13 @@ Shader "Nova/Particles/UberUnlit" _AlphaTransitionMapOffsetYCoord("Alpha Transition Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapChannelsX("Alpha Transition Map Channes X", Float) = 0.0 _AlphaTransitionMapSliceCount("Alpha Transition Map Slice Count", Float) = 4.0 + _AlphaTransitionSecondTextureBlendMode("Alpha Transition Second Texture BlendMode", Float) = 0.0 + _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} + _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} + _AlphaTransitionMapSecondTexture3D("Alpha Transition Second Texture Map 3D", 3D) = "" {} + _AlphaTransitionMapSecondTextureOffsetXCoord("Alpha Transition Second Texture Map Offset X Coord", Float) = 0.0 + _AlphaTransitionMapSecondTextureOffsetYCoord("Alpha Transition Second Texture Map Offset Y Coord", Float) = 0.0 + _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 @@ -221,6 +228,7 @@ Shader "Nova/Particles/UberUnlit" // 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 // Emission #pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -296,6 +304,7 @@ Shader "Nova/Particles/UberUnlit" // 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 // Emission //#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -371,6 +380,7 @@ Shader "Nova/Particles/UberUnlit" // 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 // Emission //#pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -449,6 +459,7 @@ Shader "Nova/Particles/UberUnlit" // 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 // Emission #pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -527,6 +538,7 @@ Shader "Nova/Particles/UberUnlit" // 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 // Emission #pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA @@ -584,6 +596,7 @@ Shader "Nova/Particles/UberUnlit" // 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 // Transparency #pragma shader_feature_local _TRANSPARENCY_BY_LUMINANCE From 393fe8f781010c876df7bdc1a4d775bcf58b3fa1 Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Tue, 6 Aug 2024 11:53:32 +0900 Subject: [PATCH 02/12] =?UTF-8?q?Texture=E3=81=AE=E3=82=B9=E3=82=B1?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=83=BB=E3=82=AA=E3=83=95=E3=82=BB=E3=83=83?= =?UTF-8?q?=E3=83=88=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runtime/Core/Shaders/ParticlesUber.hlsl | 46 +++++++++++-------- .../ParticlesUberDepthNormalsCore.hlsl | 18 ++++++++ .../Shaders/ParticlesUberShadowCaster.hlsl | 15 ++++++ .../Core/Shaders/ParticlesUberUnlit.hlsl | 7 +++ 4 files changed, 67 insertions(+), 19 deletions(-) diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index fb80fe41..fd6a69f5 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -480,25 +480,8 @@ void ModulateAlphaTransitionProgress(in out half progress, half vertexAlpha) #endif } -// Returns alpha value by the alpha transition. -half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half transitionMapProgress) +half ApplyAlphaTransitionProgress(in out half transitionAlpha, half transitionProgress) { - half4 map = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); - half transitionAlpha = map[(uint)_AlphaTransitionMapChannelsX]; - - #if defined(_FADE_TRANSITION_ENABLED) || defined(_DISSOLVE_TRANSITION_ENABLED) - #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) - half4 secondMap = SAMPLE_ALPHA_TRANSITION_MAP_SECOND(transitionMapUv, transitionMapProgress); - half secondTransitionAlpha = secondMap[(uint)_AlphaTransitionMapSecondTextureChannelsX]; - #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) - transitionAlpha = (transitionAlpha + secondTransitionAlpha) * 0.5; - #endif - #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) - transitionAlpha = transitionAlpha * secondTransitionAlpha; - #endif - #endif - #endif - #ifdef _FADE_TRANSITION_ENABLED transitionProgress = (transitionProgress * 2 - 1) * -1; transitionAlpha += transitionProgress; @@ -508,10 +491,35 @@ half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half tra transitionProgress = lerp(-dissolveWidth, 1.0 + dissolveWidth, transitionProgress); transitionAlpha = smoothstep(transitionProgress - dissolveWidth, transitionProgress + dissolveWidth, transitionAlpha); #endif - return transitionAlpha; } +#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) +half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half transitionMapProgress, half2 transitionMapSecondUv) +{ + half4 map = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); + half transitionAlpha = map[(uint)_AlphaTransitionMapChannelsX]; + half4 secondMap = SAMPLE_ALPHA_TRANSITION_MAP_SECOND(transitionMapSecondUv, transitionMapProgress); + half secondTransitionAlpha = secondMap[(uint)_AlphaTransitionMapSecondTextureChannelsX]; + + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) + transitionAlpha = (transitionAlpha + secondTransitionAlpha) * 0.5; + #endif + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) + transitionAlpha = transitionAlpha * secondTransitionAlpha; + #endif + + return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress); +} +#else +half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half transitionMapProgress) +{ + half4 map = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); + half transitionAlpha = map[(uint)_AlphaTransitionMapChannelsX]; + return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress); +} +#endif + // Apply the vertex color. inline void ApplyVertexColor(in out half4 color, in half4 vertexColor) { diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl index 0e9f7b3e..1c4ac12e 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl @@ -104,6 +104,11 @@ struct VaryingsDrawDepth float4 projectedPosition : TEXCOORD7; #endif #endif + + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) + float4 flowTransitionSecondUVs : TEXCOORD8; // xy: FlowMap UV, zw: TransitionMap UV + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -195,7 +200,13 @@ 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) + 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) + #endif #endif + #ifdef _ALPHATEST_ENABLED // This code is not used for opaque objects. // Base Map Progress @@ -289,6 +300,9 @@ 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) + input.flowTransitionSecondUVs.zw += flowMapUvOffset; + #endif #endif #endif @@ -312,8 +326,12 @@ 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) + color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, input.flowTransitionSecondUVs.zw); + #else color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x); #endif + #endif // NOTE : Not need in DepthNormals pass. // Color Correction diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl index 1e5adab1..78d1b88b 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl @@ -37,6 +37,9 @@ 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) + float4 flowTransitionSecondUVs : TEXCOORD6; // xy: FlowMap UV, zw: TransitionMap UV + #endif UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -138,6 +141,11 @@ 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) + 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) + #endif #endif // Transition Map Progress @@ -178,6 +186,9 @@ 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) + input.flowTransitionSecondUVs.zw += flowMapUvOffset; + #endif #endif } #endif @@ -204,7 +215,11 @@ 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) + color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionProgress, input.flowTransitionSecondUVs.xy); + #else color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionProgress); + #endif } #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl index 098ec3be..62d6113d 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl @@ -241,6 +241,9 @@ half4 fragUnlit(in out Varyings input, uniform bool useEmission) #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) + input.flowTransitionSecondUVs.zw += flowMapUvOffset; + #endif #endif #endif @@ -289,7 +292,11 @@ half4 fragUnlit(in out Varyings input, uniform bool useEmission) #if defined(_FADE_TRANSITION_ENABLED) || defined(_DISSOLVE_TRANSITION_ENABLED) 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) + half transition_alpha = GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, input.flowTransitionSecondUVs.zw); + #else half transition_alpha = GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x); + #endif color.a *= transition_alpha; #endif From 5e54b4176a3d7a3bd339a2271315e08e4ce34e2a Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Tue, 6 Aug 2024 15:43:21 +0900 Subject: [PATCH 03/12] =?UTF-8?q?Map=20Mode=E3=81=8CFlip=20Book=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=82=B7=E3=82=A7=E3=83=BC=E3=83=80=E3=83=BC=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=91=E3=82=A4=E3=83=A9=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index fd6a69f5..f1955617 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -461,12 +461,12 @@ void ApplyColorCorrection(in out float3 color) #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) - #define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE2D_ARRAY(_AlphaTransitionMapSecondTexture2DArray, sampler_AlphaTransitionMapSecondTexture2D, uv); + #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) - #define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE3D_LOD(_AlphaTransitionMapSecondTexture3D, sampler_AlphaTransitionMapSecondTexture3D, uv); + #define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE3D_LOD(_AlphaTransitionMapSecondTexture3D, sampler_AlphaTransitionMapSecondTexture3D, float3(uv, progress), 0); #endif #endif From ae150fa6f20f5ceb303bd7faadf1dca807cf2682 Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Tue, 6 Aug 2024 18:17:35 +0900 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BA=8C=E6=9E=9A=E7=9B=AE=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=AF=E3=82=B9=E3=83=81=E3=83=A3=E7=94=A8=E3=81=AE?= =?UTF-8?q?Transition=20Progress=E3=81=AE=E3=83=91=E3=83=A9=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Scripts/MaterialPropertyNames.cs | 6 ++-- .../Core/Scripts/ParticlesUberCommonGUI.cs | 22 +++++++------ .../ParticlesUberCommonMaterialProperties.cs | 11 +++++-- .../Runtime/Core/Shaders/ParticlesUber.hlsl | 33 +++++++++++-------- .../ParticlesUberDepthNormalsCore.hlsl | 6 ++-- .../Core/Shaders/ParticlesUberLit.shader | 6 ++-- .../Shaders/ParticlesUberShadowCaster.hlsl | 6 ++-- .../Core/Shaders/ParticlesUberUnlit.hlsl | 7 ++-- .../Core/Shaders/ParticlesUberUnlit.shader | 6 ++-- 9 files changed, 65 insertions(+), 38 deletions(-) diff --git a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs index 0df640d6..70a92fa8 100644 --- a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs +++ b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs @@ -121,14 +121,16 @@ public static class MaterialPropertyNames public const string AlphaTransitionMapChannelsX = "_AlphaTransitionMapChannelsX"; public const string AlphaTransitionMapSliceCount = "_AlphaTransitionMapSliceCount"; public const string AlphaTransitionSecondTextureBlendMode = "_AlphaTransitionSecondTextureBlendMode"; + public const string AlphaTransitionProgress = "_AlphaTransitionProgress"; + public const string AlphaTransitionProgressCoord = "_AlphaTransitionProgressCoord"; public const string AlphaTransitionMapSecondTexture = "_AlphaTransitionMapSecondTexture"; public const string AlphaTransitionMapSecondTexture2DArray = "_AlphaTransitionMapSecondTexture2DArray"; public const string AlphaTransitionMapSecondTexture3D = "_AlphaTransitionMapSecondTexture3D"; public const string AlphaTransitionMapSecondTextureOffsetXCoord = "_AlphaTransitionMapSecondTextureOffsetXCoord"; public const string AlphaTransitionMapSecondTextureOffsetYCoord = "_AlphaTransitionMapSecondTextureOffsetYCoord"; public const string AlphaTransitionMapSecondTextureChannelsX = "_AlphaTransitionMapSecondTextureChannelsX"; - public const string AlphaTransitionProgress = "_AlphaTransitionProgress"; - public const string AlphaTransitionProgressCoord = "_AlphaTransitionProgressCoord"; + public const string AlphaTransitionProgressSecondTexture = "_AlphaTransitionProgressSecondTexture"; + public const string AlphaTransitionProgressCoordSecondTexture = "_AlphaTransitionProgressCoordSecondTexture"; public const string DissolveSharpness = "_DissolveSharpness"; // Emission diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs index 31949598..d6049690 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs @@ -422,6 +422,16 @@ private void InternalDrawAlphaTransitionProperties() } } + if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook + || alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending) + MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Flip-Book Progress", + props.AlphaTransitionMapProgressProp.Value, props.AlphaTransitionMapProgressCoordProp.Value); + + MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Transition Progress", + props.AlphaTransitionProgressProp.Value, props.AlphaTransitionProgressCoordProp.Value); + if (mode == AlphaTransitionMode.Dissolve) + _editor.ShaderProperty(props.DissolveSharpnessProp.Value, "Edge Sharpness"); + // 2nd Texture { MaterialEditorUtility.DrawEnumProperty(_editor, "2nd Texture Blend Mode", @@ -432,18 +442,10 @@ private void InternalDrawAlphaTransitionProperties() MaterialEditorUtility.DrawTexture(_editor, alphaTransitionMapSecondTextureProp, props.AlphaTransitionMapSecondTextureOffsetXCoordProp.Value, props.AlphaTransitionMapSecondTextureOffsetYCoordProp.Value, props.AlphaTransitionMapSecondTextureChannelsXProp.Value, null); + MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Transition Progress", + props.AlphaTransitionProgressSecondTextureProp.Value, props.AlphaTransitionProgressCoordSecondTextureProp.Value); } } - - if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook - || alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending) - MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Flip-Book Progress", - props.AlphaTransitionMapProgressProp.Value, props.AlphaTransitionMapProgressCoordProp.Value); - - MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Transition Progress", - props.AlphaTransitionProgressProp.Value, props.AlphaTransitionProgressCoordProp.Value); - if (mode == AlphaTransitionMode.Dissolve) - _editor.ShaderProperty(props.DissolveSharpnessProp.Value, "Edge Sharpness"); } } diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs index 8a507f88..43e1e06d 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs @@ -129,6 +129,8 @@ public void Setup(MaterialProperty[] properties) AlphaTransitionMapOffsetYCoordProp.Setup(properties); AlphaTransitionMapChannelsXProp.Setup(properties); AlphaTransitionMapSliceCountProp.Setup(properties); + AlphaTransitionProgressProp.Setup(properties); + AlphaTransitionProgressCoordProp.Setup(properties); AlphaTransitionSecondTextureBlendModeProp.Setup(properties); AlphaTransitionMapSecondTextureProp.Setup(properties); AlphaTransitionMapSecondTexture2DArrayProp.Setup(properties); @@ -136,8 +138,8 @@ public void Setup(MaterialProperty[] properties) AlphaTransitionMapSecondTextureOffsetXCoordProp.Setup(properties); AlphaTransitionMapSecondTextureOffsetYCoordProp.Setup(properties); AlphaTransitionMapSecondTextureChannelsXProp.Setup(properties); - AlphaTransitionProgressProp.Setup(properties); - AlphaTransitionProgressCoordProp.Setup(properties); + AlphaTransitionProgressSecondTextureProp.Setup(properties); + AlphaTransitionProgressCoordSecondTextureProp.Setup(properties); DissolveSharpnessProp.Setup(properties); // Emission @@ -404,6 +406,11 @@ public void Setup(MaterialProperty[] properties) public ParticlesGUI.Property AlphaTransitionProgressCoordProp { get; } = new(PropertyNames.AlphaTransitionProgressCoord); + + public ParticlesGUI.Property AlphaTransitionProgressSecondTextureProp { get; } = new(PropertyNames.AlphaTransitionProgressSecondTexture); + + public ParticlesGUI.Property AlphaTransitionProgressCoordSecondTextureProp { get; } = + new(PropertyNames.AlphaTransitionProgressCoordSecondTexture); public ParticlesGUI.Property DissolveSharpnessProp { get; } = new(PropertyNames.DissolveSharpness); diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index f1955617..2e29d10e 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -130,6 +130,8 @@ half _AlphaTransitionMapChannelsX; half _AlphaTransitionMapSecondTextureChannelsX; float _AlphaTransitionProgress; DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoord); +float _AlphaTransitionProgressSecondTexture; +DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoordSecondTexture); float _DissolveSharpness; float4 _EmissionMap_ST; @@ -494,29 +496,34 @@ half ApplyAlphaTransitionProgress(in out half transitionAlpha, half transitionPr return transitionAlpha; } +half GetTransitionAlphaImpl(half4 map, uint channel, half transitionProgress) +{ + half transitionAlpha = map[channel]; + return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress); +} + #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) -half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half transitionMapProgress, half2 transitionMapSecondUv) +half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half transitionProgress, half2 transitionMapSecondUv, half transitionProgressSecond) { - half4 map = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); - half transitionAlpha = map[(uint)_AlphaTransitionMapChannelsX]; - half4 secondMap = SAMPLE_ALPHA_TRANSITION_MAP_SECOND(transitionMapSecondUv, transitionMapProgress); - half secondTransitionAlpha = secondMap[(uint)_AlphaTransitionMapSecondTextureChannelsX]; + half4 mainTexMap = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); + half4 secondTexMap = SAMPLE_ALPHA_TRANSITION_MAP_SECOND(transitionMapSecondUv, transitionMapProgress); + half mainTexAlpha = GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress); + half secondTexAlpha = GetTransitionAlphaImpl(secondTexMap, (uint)_AlphaTransitionMapSecondTextureChannelsX, transitionProgressSecond); #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) - transitionAlpha = (transitionAlpha + secondTransitionAlpha) * 0.5; + mainTexAlpha = (mainTexAlpha + secondTexAlpha) * 0.5; #endif #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) - transitionAlpha = transitionAlpha * secondTransitionAlpha; + mainTexAlpha = mainTexAlpha * secondTexAlpha; #endif - - return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress); + + return mainTexAlpha; } #else -half GetTransitionAlpha(half transitionProgress, half2 transitionMapUv, half transitionMapProgress) +half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half transitionProgress) { - half4 map = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); - half transitionAlpha = map[(uint)_AlphaTransitionMapChannelsX]; - return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress); + half4 mainTexMap = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); + return GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress); } #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl index 1c4ac12e..16d6a6b6 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl @@ -327,9 +327,11 @@ half4 frag(VaryingsDrawDepth 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) - color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, input.flowTransitionSecondUVs.zw); + 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); #else - color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x); + color.a *= GetTransitionAlpha(input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, alphaTransitionProgress); #endif #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader index b65a56db..e6f0ece4 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader @@ -114,6 +114,8 @@ Shader "Nova/Particles/UberLit" _AlphaTransitionMapOffsetYCoord("Alpha Transition Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapChannelsX("Alpha Transition Map Channes X", Float) = 0.0 _AlphaTransitionMapSliceCount("Alpha Transition Map Slice Count", Float) = 4.0 + _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 + _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 _AlphaTransitionSecondTextureBlendMode("Alpha Transition Second Texture BlendMode", Float) = 0.0 _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} @@ -121,8 +123,8 @@ Shader "Nova/Particles/UberLit" _AlphaTransitionMapSecondTextureOffsetXCoord("Alpha Transition Second Texture Map Offset X Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureOffsetYCoord("Alpha Transition Second Texture Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 - _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 - _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 + _AlphaTransitionProgressSecondTexture("Alpha Transition Second Texture Progress", Range(0.0, 1.0)) = 0.0 + _AlphaTransitionProgressCoordSecondTexture("Alpha Transition Second Texture Progress Coord", Float) = 0.0 _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 // Emission diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl index 78d1b88b..751a8942 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl @@ -216,9 +216,11 @@ 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) - color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionProgress, input.flowTransitionSecondUVs.xy); + 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); #else - color.a *= GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionProgress); + color.a *= GetTransitionAlpha(input.flowTransitionUVs.zw, input.transitionProgress, alphaTransitionProgress); #endif } #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl index 62d6113d..5ce6ffe8 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl @@ -293,11 +293,12 @@ half4 fragUnlit(in out Varyings input, uniform bool useEmission) 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) - half transition_alpha = GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, input.flowTransitionSecondUVs.zw); + 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); #else - half transition_alpha = GetTransitionAlpha(alphaTransitionProgress, input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x); + color.a *= GetTransitionAlpha(input.flowTransitionUVs.zw, input.transitionEmissionProgresses.x, alphaTransitionProgress); #endif - color.a *= transition_alpha; #endif // Vertex Color diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader index e8a56bfb..c76322ad 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader @@ -89,6 +89,8 @@ Shader "Nova/Particles/UberUnlit" _AlphaTransitionMapOffsetYCoord("Alpha Transition Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapChannelsX("Alpha Transition Map Channes X", Float) = 0.0 _AlphaTransitionMapSliceCount("Alpha Transition Map Slice Count", Float) = 4.0 + _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 + _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 _AlphaTransitionSecondTextureBlendMode("Alpha Transition Second Texture BlendMode", Float) = 0.0 _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} @@ -96,8 +98,8 @@ Shader "Nova/Particles/UberUnlit" _AlphaTransitionMapSecondTextureOffsetXCoord("Alpha Transition Second Texture Map Offset X Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureOffsetYCoord("Alpha Transition Second Texture Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 - _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 - _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 + _AlphaTransitionProgressSecondTexture("Alpha Transition Second Texture Progress", Range(0.0, 1.0)) = 0.0 + _AlphaTransitionProgressCoordSecondTexture("Alpha Transition Second Texture Progress Coord", Float) = 0.0 _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 // Emission From 84d4dccd334ce36c247c3833154e36e3cd51dfab Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Wed, 7 Aug 2024 10:55:07 +0900 Subject: [PATCH 05/12] =?UTF-8?q?Transition=20Progress=E3=81=A8EdgeSharpne?= =?UTF-8?q?ss=E3=81=AE=E9=A0=85=E7=9B=AE=E3=82=92=E3=83=86=E3=82=AF?= =?UTF-8?q?=E3=82=B9=E3=83=81=E3=83=A3=E6=AF=8E=E3=81=AB=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=82=88=E3=81=86=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Scripts/MaterialPropertyNames.cs | 3 ++- .../Core/Scripts/ParticlesUberCommonGUI.cs | 2 ++ .../ParticlesUberCommonMaterialProperties.cs | 9 ++++++--- .../Runtime/Core/Shaders/ParticlesUber.hlsl | 17 +++++++++-------- .../Core/Shaders/ParticlesUberLit.shader | 3 ++- .../Core/Shaders/ParticlesUberUnlit.shader | 3 ++- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs index 70a92fa8..1bd593c5 100644 --- a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs +++ b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs @@ -123,6 +123,7 @@ public static class MaterialPropertyNames public const string AlphaTransitionSecondTextureBlendMode = "_AlphaTransitionSecondTextureBlendMode"; public const string AlphaTransitionProgress = "_AlphaTransitionProgress"; public const string AlphaTransitionProgressCoord = "_AlphaTransitionProgressCoord"; + public const string DissolveSharpness = "_DissolveSharpness"; public const string AlphaTransitionMapSecondTexture = "_AlphaTransitionMapSecondTexture"; public const string AlphaTransitionMapSecondTexture2DArray = "_AlphaTransitionMapSecondTexture2DArray"; public const string AlphaTransitionMapSecondTexture3D = "_AlphaTransitionMapSecondTexture3D"; @@ -131,7 +132,7 @@ public static class MaterialPropertyNames public const string AlphaTransitionMapSecondTextureChannelsX = "_AlphaTransitionMapSecondTextureChannelsX"; public const string AlphaTransitionProgressSecondTexture = "_AlphaTransitionProgressSecondTexture"; public const string AlphaTransitionProgressCoordSecondTexture = "_AlphaTransitionProgressCoordSecondTexture"; - public const string DissolveSharpness = "_DissolveSharpness"; + public const string DissolveSharpnessSecondTexture = "_DissolveSharpnessSecondTexture"; // Emission public const string EmissionAreaType = "_EmissionAreaType"; diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs index d6049690..d93a4887 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs @@ -444,6 +444,8 @@ private void InternalDrawAlphaTransitionProperties() props.AlphaTransitionMapSecondTextureChannelsXProp.Value, null); MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Transition Progress", props.AlphaTransitionProgressSecondTextureProp.Value, props.AlphaTransitionProgressCoordSecondTextureProp.Value); + if (mode == AlphaTransitionMode.Dissolve) + _editor.ShaderProperty(props.DissolveSharpnessSecondTextureProp.Value, "Edge Sharpness"); } } } diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs index 43e1e06d..c75a902c 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs @@ -131,6 +131,7 @@ public void Setup(MaterialProperty[] properties) AlphaTransitionMapSliceCountProp.Setup(properties); AlphaTransitionProgressProp.Setup(properties); AlphaTransitionProgressCoordProp.Setup(properties); + DissolveSharpnessProp.Setup(properties); AlphaTransitionSecondTextureBlendModeProp.Setup(properties); AlphaTransitionMapSecondTextureProp.Setup(properties); AlphaTransitionMapSecondTexture2DArrayProp.Setup(properties); @@ -140,7 +141,7 @@ public void Setup(MaterialProperty[] properties) AlphaTransitionMapSecondTextureChannelsXProp.Setup(properties); AlphaTransitionProgressSecondTextureProp.Setup(properties); AlphaTransitionProgressCoordSecondTextureProp.Setup(properties); - DissolveSharpnessProp.Setup(properties); + DissolveSharpnessSecondTextureProp.Setup(properties); // Emission EmissionAreaTypeProp.Setup(properties); @@ -383,6 +384,8 @@ public void Setup(MaterialProperty[] properties) public ParticlesGUI.Property AlphaTransitionMapSliceCountProp { get; } = new(PropertyNames.AlphaTransitionMapSliceCount); + public ParticlesGUI.Property DissolveSharpnessProp { get; } = new(PropertyNames.DissolveSharpness); + public ParticlesGUI.Property AlphaTransitionSecondTextureBlendModeProp { get; } = new(PropertyNames.AlphaTransitionSecondTextureBlendMode); @@ -412,8 +415,8 @@ public void Setup(MaterialProperty[] properties) public ParticlesGUI.Property AlphaTransitionProgressCoordSecondTextureProp { get; } = new(PropertyNames.AlphaTransitionProgressCoordSecondTexture); - public ParticlesGUI.Property DissolveSharpnessProp { get; } = new(PropertyNames.DissolveSharpness); - + public ParticlesGUI.Property DissolveSharpnessSecondTextureProp { get; } = new(PropertyNames.DissolveSharpnessSecondTexture); + #endregion #region Emission Material Properties diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index 2e29d10e..9bcfdf9f 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -127,12 +127,13 @@ DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetYCoord); DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetXCoord); DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetYCoord); half _AlphaTransitionMapChannelsX; +float _DissolveSharpness; half _AlphaTransitionMapSecondTextureChannelsX; float _AlphaTransitionProgress; DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoord); float _AlphaTransitionProgressSecondTexture; DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoordSecondTexture); -float _DissolveSharpness; +float _DissolveSharpnessSecondTexture; float4 _EmissionMap_ST; float4 _EmissionMap2DArray_ST; @@ -482,24 +483,24 @@ void ModulateAlphaTransitionProgress(in out half progress, half vertexAlpha) #endif } -half ApplyAlphaTransitionProgress(in out half transitionAlpha, half transitionProgress) +half ApplyAlphaTransitionProgress(in out half transitionAlpha, half transitionProgress, float dissolveSharpness) { #ifdef _FADE_TRANSITION_ENABLED transitionProgress = (transitionProgress * 2 - 1) * -1; transitionAlpha += transitionProgress; transitionAlpha = saturate(transitionAlpha); #elif _DISSOLVE_TRANSITION_ENABLED - half dissolveWidth = lerp(0.5, 0.0001, _DissolveSharpness); + half dissolveWidth = lerp(0.5, 0.0001, dissolveSharpness); transitionProgress = lerp(-dissolveWidth, 1.0 + dissolveWidth, transitionProgress); transitionAlpha = smoothstep(transitionProgress - dissolveWidth, transitionProgress + dissolveWidth, transitionAlpha); #endif return transitionAlpha; } -half GetTransitionAlphaImpl(half4 map, uint channel, half transitionProgress) +half GetTransitionAlphaImpl(half4 map, uint channel, half transitionProgress, float dissolveSharpness) { half transitionAlpha = map[channel]; - return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress); + return ApplyAlphaTransitionProgress(transitionAlpha, transitionProgress, dissolveSharpness); } #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) @@ -507,8 +508,8 @@ half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half { half4 mainTexMap = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); half4 secondTexMap = SAMPLE_ALPHA_TRANSITION_MAP_SECOND(transitionMapSecondUv, transitionMapProgress); - half mainTexAlpha = GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress); - half secondTexAlpha = GetTransitionAlphaImpl(secondTexMap, (uint)_AlphaTransitionMapSecondTextureChannelsX, transitionProgressSecond); + half mainTexAlpha = GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress, _DissolveSharpness); + half secondTexAlpha = GetTransitionAlphaImpl(secondTexMap, (uint)_AlphaTransitionMapSecondTextureChannelsX, transitionProgressSecond, _DissolveSharpnessSecondTexture); #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) mainTexAlpha = (mainTexAlpha + secondTexAlpha) * 0.5; @@ -523,7 +524,7 @@ half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half transitionProgress) { half4 mainTexMap = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); - return GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress); + return GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress, _DissolveSharpness); } #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader index e6f0ece4..835f6ae7 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader @@ -116,6 +116,7 @@ Shader "Nova/Particles/UberLit" _AlphaTransitionMapSliceCount("Alpha Transition Map Slice Count", Float) = 4.0 _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 + _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 _AlphaTransitionSecondTextureBlendMode("Alpha Transition Second Texture BlendMode", Float) = 0.0 _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} @@ -125,7 +126,7 @@ Shader "Nova/Particles/UberLit" _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 _AlphaTransitionProgressSecondTexture("Alpha Transition Second Texture Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoordSecondTexture("Alpha Transition Second Texture Progress Coord", Float) = 0.0 - _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 + _DissolveSharpnessSecondTexture("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 // Emission _EmissionAreaType("Emission Area Type", Float) = 0.0 diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader index c76322ad..1291d623 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader @@ -91,6 +91,7 @@ Shader "Nova/Particles/UberUnlit" _AlphaTransitionMapSliceCount("Alpha Transition Map Slice Count", Float) = 4.0 _AlphaTransitionProgress("Alpha Transition Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoord("Alpha Transition Progress Coord", Float) = 0.0 + _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 _AlphaTransitionSecondTextureBlendMode("Alpha Transition Second Texture BlendMode", Float) = 0.0 _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} @@ -100,7 +101,7 @@ Shader "Nova/Particles/UberUnlit" _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 _AlphaTransitionProgressSecondTexture("Alpha Transition Second Texture Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoordSecondTexture("Alpha Transition Second Texture Progress Coord", Float) = 0.0 - _DissolveSharpness("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 + _DissolveSharpnessSecondTexture("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 // Emission _EmissionAreaType("Emission Area Type", Float) = 0.0 From e8ebea8e7ee2101bfc64a3fb26c3d28e710b705e Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Wed, 7 Aug 2024 13:26:48 +0900 Subject: [PATCH 06/12] =?UTF-8?q?Flip=20Book=20Progress=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=82=82=E5=90=84=E3=83=86=E3=82=AF=E3=82=B9?= =?UTF-8?q?=E3=83=81=E3=83=A3=E6=AF=8E=E3=81=AB=E7=94=A8=E6=84=8F=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Scripts/MaterialPropertyNames.cs | 3 ++ .../Core/Scripts/ParticlesUberCommonGUI.cs | 29 ++++++++++++++++++- .../ParticlesUberCommonMaterialProperties.cs | 11 +++++++ .../Runtime/Core/Shaders/ParticlesUber.hlsl | 3 ++ .../ParticlesUberDepthNormalsCore.hlsl | 16 +++++++--- .../Core/Shaders/ParticlesUberLit.shader | 3 ++ .../Shaders/ParticlesUberShadowCaster.hlsl | 16 +++++++--- .../Core/Shaders/ParticlesUberUnlit.hlsl | 16 +++++++--- .../Core/Shaders/ParticlesUberUnlit.shader | 3 ++ 9 files changed, 87 insertions(+), 13 deletions(-) diff --git a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs index 1bd593c5..8160c386 100644 --- a/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs +++ b/Assets/Nova/Editor/Core/Scripts/MaterialPropertyNames.cs @@ -127,9 +127,12 @@ public static class MaterialPropertyNames public const string AlphaTransitionMapSecondTexture = "_AlphaTransitionMapSecondTexture"; public const string AlphaTransitionMapSecondTexture2DArray = "_AlphaTransitionMapSecondTexture2DArray"; public const string AlphaTransitionMapSecondTexture3D = "_AlphaTransitionMapSecondTexture3D"; + public const string AlphaTransitionMapSecondTextureProgress = "_AlphaTransitionMapSecondTextureProgress"; + public const string AlphaTransitionMapSecondTextureProgressCoord = "_AlphaTransitionMapSecondTextureProgressCoord"; public const string AlphaTransitionMapSecondTextureOffsetXCoord = "_AlphaTransitionMapSecondTextureOffsetXCoord"; public const string AlphaTransitionMapSecondTextureOffsetYCoord = "_AlphaTransitionMapSecondTextureOffsetYCoord"; public const string AlphaTransitionMapSecondTextureChannelsX = "_AlphaTransitionMapSecondTextureChannelsX"; + public const string AlphaTransitionMapSecondTextureSliceCount = "_AlphaTransitionMapSecondTextureSliceCount"; public const string AlphaTransitionProgressSecondTexture = "_AlphaTransitionProgressSecondTexture"; public const string AlphaTransitionProgressCoordSecondTexture = "_AlphaTransitionProgressCoordSecondTexture"; public const string DissolveSharpnessSecondTexture = "_DissolveSharpnessSecondTexture"; diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs index d93a4887..0b068f39 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs @@ -439,11 +439,38 @@ private void InternalDrawAlphaTransitionProperties() var alphaTransitionSecondTextureBlendMode = (AlphaTransitionBlendMode)props.AlphaTransitionSecondTextureBlendModeProp.Value.floatValue; if (alphaTransitionSecondTextureBlendMode != AlphaTransitionBlendMode.None) { - MaterialEditorUtility.DrawTexture(_editor, alphaTransitionMapSecondTextureProp, + using (var changeCheckScope = new EditorGUI.ChangeCheckScope()) + { + MaterialEditorUtility.DrawTexture(_editor, alphaTransitionMapSecondTextureProp, props.AlphaTransitionMapSecondTextureOffsetXCoordProp.Value, props.AlphaTransitionMapSecondTextureOffsetYCoordProp.Value, props.AlphaTransitionMapSecondTextureChannelsXProp.Value, null); + + if (changeCheckScope.changed) + { + if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook + && props.AlphaTransitionMapSecondTexture2DArrayProp.Value.textureValue != null) + { + var tex2DArray = (Texture2DArray)props.AlphaTransitionMapSecondTexture2DArrayProp.Value.textureValue; + props.AlphaTransitionMapSecondTextureSliceCountProp.Value.floatValue = tex2DArray.depth; + } + + if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending + && props.AlphaTransitionMapSecondTexture3DProp.Value.textureValue != null) + { + var tex3D = (Texture3D)props.AlphaTransitionMapSecondTexture3DProp.Value.textureValue; + props.AlphaTransitionMapSecondTextureSliceCountProp.Value.floatValue = tex3D.depth; + } + } + } + + if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook + || alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending) + MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Flip-Book Progress", + props.AlphaTransitionMapSecondTextureProgressProp.Value, props.AlphaTransitionMapSecondTextureProgressCoordProp.Value); + MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Transition Progress", props.AlphaTransitionProgressSecondTextureProp.Value, props.AlphaTransitionProgressCoordSecondTextureProp.Value); + if (mode == AlphaTransitionMode.Dissolve) _editor.ShaderProperty(props.DissolveSharpnessSecondTextureProp.Value, "Edge Sharpness"); } diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs index c75a902c..ebf7f85a 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonMaterialProperties.cs @@ -136,6 +136,8 @@ public void Setup(MaterialProperty[] properties) AlphaTransitionMapSecondTextureProp.Setup(properties); AlphaTransitionMapSecondTexture2DArrayProp.Setup(properties); AlphaTransitionMapSecondTexture3DProp.Setup(properties); + AlphaTransitionMapSecondTextureProgressProp.Setup(properties); + AlphaTransitionMapSecondTextureProgressCoordProp.Setup(properties); AlphaTransitionMapSecondTextureOffsetXCoordProp.Setup(properties); AlphaTransitionMapSecondTextureOffsetYCoordProp.Setup(properties); AlphaTransitionMapSecondTextureChannelsXProp.Setup(properties); @@ -396,6 +398,12 @@ public void Setup(MaterialProperty[] properties) public ParticlesGUI.Property AlphaTransitionMapSecondTexture3DProp { get; } = new(PropertyNames.AlphaTransitionMapSecondTexture3D); + public ParticlesGUI.Property AlphaTransitionMapSecondTextureProgressProp { get; } = + new(PropertyNames.AlphaTransitionMapSecondTextureProgress); + + public ParticlesGUI.Property AlphaTransitionMapSecondTextureProgressCoordProp { get; } = + new(PropertyNames.AlphaTransitionMapSecondTextureProgressCoord); + public ParticlesGUI.Property AlphaTransitionMapSecondTextureOffsetXCoordProp { get; } = new(PropertyNames.AlphaTransitionMapSecondTextureOffsetXCoord); @@ -405,6 +413,9 @@ public void Setup(MaterialProperty[] properties) public ParticlesGUI.Property AlphaTransitionMapSecondTextureChannelsXProp { get; } = new(PropertyNames.AlphaTransitionMapSecondTextureChannelsX); + public ParticlesGUI.Property AlphaTransitionMapSecondTextureSliceCountProp { get; } = + new(PropertyNames.AlphaTransitionMapSecondTextureSliceCount); + public ParticlesGUI.Property AlphaTransitionProgressProp { get; } = new(PropertyNames.AlphaTransitionProgress); public ParticlesGUI.Property AlphaTransitionProgressCoordProp { get; } = diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index 9bcfdf9f..5ace13c5 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -121,7 +121,10 @@ float4 _AlphaTransitionMapSecondTexture3D_ST; float _AlphaTransitionMapProgress; DECLARE_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); +float _AlphaTransitionMapSecondTextureProgress; +DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord); float _AlphaTransitionMapSliceCount; +float _AlphaTransitionMapSecondTextureSliceCount; DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetXCoord); DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetYCoord); DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetXCoord); diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl index 16d6a6b6..4cde6adf 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl @@ -232,12 +232,20 @@ VaryingsDrawDepth vert(AttributesDrawDepth input) #endif // Transition Map Progress - #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY + #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) + float transitionMapProgress = _AlphaTransitionMapSecondTextureProgress + GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord); + float sliceCount = _AlphaTransitionMapSecondTextureSliceCount; + #else float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); - output.transitionEmissionProgresses.x = FlipBookProgress(transitionMapProgress, _AlphaTransitionMapSliceCount); + float sliceCount = _AlphaTransitionMapSliceCount; + #endif + + #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY + output.transitionEmissionProgresses.x = FlipBookProgress(transitionMapProgress, sliceCount); #elif _ALPHA_TRANSITION_MAP_MODE_3D - float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); - output.transitionEmissionProgresses.x = FlipBookBlendingProgress(transitionMapProgress, _AlphaTransitionMapSliceCount); + output.transitionEmissionProgresses.x = FlipBookBlendingProgress(transitionMapProgress, sliceCount); + #endif #endif // Emission Map UV diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader index 835f6ae7..a31b12b6 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader @@ -121,9 +121,12 @@ Shader "Nova/Particles/UberLit" _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} _AlphaTransitionMapSecondTexture3D("Alpha Transition Second Texture Map 3D", 3D) = "" {} + _AlphaTransitionMapSecondTextureProgress("Alpha Transition Map Second Texture Progress", Range(0.0, 1.0)) = 0.0 + _AlphaTransitionMapSecondTextureProgressCoord("Alpha Transition Map Second Texture Progress Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureOffsetXCoord("Alpha Transition Second Texture Map Offset X Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureOffsetYCoord("Alpha Transition Second Texture Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 + _AlphaTransitionMapSecondTextureSliceCount("Alpha Transition Map Second Texture Slice Count", Float) = 4.0 _AlphaTransitionProgressSecondTexture("Alpha Transition Second Texture Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoordSecondTexture("Alpha Transition Second Texture Progress Coord", Float) = 0.0 _DissolveSharpnessSecondTexture("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl index 751a8942..ee3a7de9 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl @@ -149,12 +149,20 @@ Varyings ShadowPassVertex(Attributes input) #endif // Transition Map Progress - #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY + #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) + float transitionMapProgress = _AlphaTransitionMapSecondTextureProgress + GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord); + float sliceCount = _AlphaTransitionMapSecondTextureSliceCount; + #else float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); - output.transitionProgress = FlipBookProgress(transitionMapProgress, _AlphaTransitionMapSliceCount); + float sliceCount = _AlphaTransitionMapSliceCount; + #endif + + #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY + output.transitionProgress = FlipBookProgress(transitionMapProgress, sliceCount); #elif _ALPHA_TRANSITION_MAP_MODE_3D - float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); - output.transitionProgress = FlipBookBlendingProgress(transitionMapProgress, _AlphaTransitionMapSliceCount); + output.transitionProgress = FlipBookBlendingProgress(transitionMapProgress, sliceCount); + #endif #endif #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl index 5ce6ffe8..3b68b5c3 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl @@ -177,12 +177,20 @@ Varyings vertUnlit(Attributes input, out float3 positionWS, uniform bool useEmis #endif // Transition Map Progress - #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY + #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) + float transitionMapProgress = _AlphaTransitionMapSecondTextureProgress + GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord); + float sliceCount = _AlphaTransitionMapSecondTextureSliceCount; + #else float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); - output.transitionEmissionProgresses.x = FlipBookProgress(transitionMapProgress, _AlphaTransitionMapSliceCount); + float sliceCount = _AlphaTransitionMapSliceCount; + #endif + + #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY + output.transitionEmissionProgresses.x = FlipBookProgress(transitionMapProgress, sliceCount); #elif _ALPHA_TRANSITION_MAP_MODE_3D - float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); - output.transitionEmissionProgresses.x = FlipBookBlendingProgress(transitionMapProgress, _AlphaTransitionMapSliceCount); + output.transitionEmissionProgresses.x = FlipBookBlendingProgress(transitionMapProgress, sliceCount); + #endif #endif if (useEmission) diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader index 1291d623..d4592c9e 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader @@ -96,9 +96,12 @@ Shader "Nova/Particles/UberUnlit" _AlphaTransitionMapSecondTexture("Alpha Transition Second Texture Map", 2D) = "white" {} _AlphaTransitionMapSecondTexture2DArray("Alpha Transition Second Texture Map 2D Array", 2DArray) = "" {} _AlphaTransitionMapSecondTexture3D("Alpha Transition Second Texture Map 3D", 3D) = "" {} + _AlphaTransitionMapSecondTextureProgress("Alpha Transition Map Second Texture Progress", Range(0.0, 1.0)) = 0.0 + _AlphaTransitionMapSecondTextureProgressCoord("Alpha Transition Map Second Texture Progress Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureOffsetXCoord("Alpha Transition Second Texture Map Offset X Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureOffsetYCoord("Alpha Transition Second Texture Map Offset Y Coord", Float) = 0.0 _AlphaTransitionMapSecondTextureChannelsX("Alpha Transition Second Texture Map Channes X", Float) = 0.0 + _AlphaTransitionMapSecondTextureSliceCount("Alpha Transition Map Second Texture Slice Count", Float) = 4.0 _AlphaTransitionProgressSecondTexture("Alpha Transition Second Texture Progress", Range(0.0, 1.0)) = 0.0 _AlphaTransitionProgressCoordSecondTexture("Alpha Transition Second Texture Progress Coord", Float) = 0.0 _DissolveSharpnessSecondTexture("Dissolve Sharpness", Range(0.0, 1.0)) = 0.5 From bf80f3295ab68b1fd2f4cf7b004af6cc995638f4 Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Wed, 7 Aug 2024 13:28:51 +0900 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BD=9C=E6=A5=AD=E7=94=A8=E3=81=AB?= =?UTF-8?q?=E7=B7=A8=E9=9B=86=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=82=B7?= =?UTF-8?q?=E3=83=BC=E3=83=B3=E3=83=BB=E3=83=9E=E3=83=86=E3=83=AA=E3=82=A2?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E5=A4=89=E6=9B=B4=E3=82=92=E7=A0=B4=E6=A3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mat_demo_dissolve_edgeemission.mat | 24 +++++++++++++++++++ .../Materials/mat_demo_fade_edgeemission.mat | 15 ++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/Assets/Demo/Demo00/Materials/mat_demo_dissolve_edgeemission.mat b/Assets/Demo/Demo00/Materials/mat_demo_dissolve_edgeemission.mat index 8fd5cb22..f6fda43a 100644 --- a/Assets/Demo/Demo00/Materials/mat_demo_dissolve_edgeemission.mat +++ b/Assets/Demo/Demo00/Materials/mat_demo_dissolve_edgeemission.mat @@ -43,6 +43,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture2DArray: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AlphaTransitionMapSecondTexture3D: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _BaseMap: m_Texture: {fileID: 2800000, guid: cac707016af934ee5a416cab14da7246, type: 3} m_Scale: {x: 1, y: 1} @@ -156,10 +168,19 @@ Material: - _AlphaTransitionMapOffsetYCoord: 0 - _AlphaTransitionMapProgress: 0 - _AlphaTransitionMapProgressCoord: 0 + - _AlphaTransitionMapSecondTextureChannelsX: 0 + - _AlphaTransitionMapSecondTextureOffsetXCoord: 0 + - _AlphaTransitionMapSecondTextureOffsetYCoord: 0 + - _AlphaTransitionMapSecondTextureProgress: 0 + - _AlphaTransitionMapSecondTextureProgressCoord: 0 + - _AlphaTransitionMapSecondTextureSliceCount: 4 - _AlphaTransitionMapSliceCount: 4 - _AlphaTransitionMode: 2 - _AlphaTransitionProgress: 0 - _AlphaTransitionProgressCoord: 1 + - _AlphaTransitionProgressCoordSecondTexture: 0 + - _AlphaTransitionProgressSecondTexture: 0 + - _AlphaTransitionSecondTextureBlendMode: 1 - _BaseMapMirrorSampling: 0 - _BaseMapMode: 0 - _BaseMapOffsetXCoord: 0 @@ -186,6 +207,7 @@ Material: - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DissolveSharpness: 0.913 + - _DissolveSharpnessSecondTexture: 0.5 - _DstBlend: 0 - _EmissionAreaType: 3 - _EmissionColorType: 2 @@ -276,6 +298,8 @@ Material: - _TintMap3DProgress: 0 - _TintMap3DProgressCoord: 0 - _TintMapMode: 0 + - _TintMapOffsetXCoord: 0 + - _TintMapOffsetYCoord: 0 - _TintMapSliceCount: 4 - _TintRimProgress: 0.5 - _TintRimProgressCoord: 0 diff --git a/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat b/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat index b3e3d38c..f89fa6a3 100644 --- a/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat +++ b/Assets/Demo/Demo00/Materials/mat_demo_fade_edgeemission.mat @@ -10,7 +10,6 @@ Material: m_Name: mat_demo_fade_edgeemission m_Shader: {fileID: 4800000, guid: 1bc5c6a70411243779ce486a98012125, type: 3} m_ValidKeywords: - - _ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE - _ALPHA_TRANSITION_MAP_MODE_2D - _BASE_MAP_MODE_2D - _EMISSION_AREA_ALPHA @@ -45,7 +44,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _AlphaTransitionMapSecondTexture: - m_Texture: {fileID: 2800000, guid: e5c1bb044a69c48868c1f381762bbcea, type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _AlphaTransitionMapSecondTexture2DArray: @@ -85,7 +84,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _EmissionColorRamp: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: ad948d6c337974eff945b4e9670f88f3, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _EmissionMap: @@ -172,11 +171,16 @@ Material: - _AlphaTransitionMapSecondTextureChannelsX: 1 - _AlphaTransitionMapSecondTextureOffsetXCoord: 0 - _AlphaTransitionMapSecondTextureOffsetYCoord: 0 + - _AlphaTransitionMapSecondTextureProgress: 0 + - _AlphaTransitionMapSecondTextureProgressCoord: 0 + - _AlphaTransitionMapSecondTextureSliceCount: 4 - _AlphaTransitionMapSliceCount: 4 - _AlphaTransitionMode: 1 - _AlphaTransitionProgress: 0 - _AlphaTransitionProgressCoord: 1 - - _AlphaTransitionSecondTextureBlendMode: 1 + - _AlphaTransitionProgressCoordSecondTexture: 0 + - _AlphaTransitionProgressSecondTexture: 0 + - _AlphaTransitionSecondTextureBlendMode: 0 - _BaseMapMirrorSampling: 0 - _BaseMapMode: 0 - _BaseMapOffsetXCoord: 0 @@ -203,6 +207,7 @@ Material: - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DissolveSharpness: 0.913 + - _DissolveSharpnessSecondTexture: 0.5 - _DstBlend: 0 - _EmissionAreaType: 3 - _EmissionColorType: 2 @@ -293,6 +298,8 @@ Material: - _TintMap3DProgress: 0 - _TintMap3DProgressCoord: 0 - _TintMapMode: 0 + - _TintMapOffsetXCoord: 0 + - _TintMapOffsetYCoord: 0 - _TintMapSliceCount: 4 - _TintRimProgress: 0.5 - _TintRimProgressCoord: 0 From 791f68484a64383da11fb5c0916a21cbd61894d6 Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Wed, 7 Aug 2024 14:20:59 +0900 Subject: [PATCH 08/12] =?UTF-8?q?README=E3=81=B8=E3=81=AEAlpha=20Transitio?= =?UTF-8?q?n=E3=81=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Images/unlit_alpha_transition.png | Bin 0 -> 32129 bytes README.md | 13 ++++++++++++- README_JA.md | 13 ++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Documentation~/Images/unlit_alpha_transition.png diff --git a/Documentation~/Images/unlit_alpha_transition.png b/Documentation~/Images/unlit_alpha_transition.png new file mode 100644 index 0000000000000000000000000000000000000000..33337e1cfe20d4cec86ff8a398f8810895994e17 GIT binary patch literal 32129 zcmb@uXIN8P7%mvpprVLJDT;zvklvesG^x^iZ_--;h0sD1jvydKr6awE-V!<@Qbc;M zK?Lcc7crDsn{&?0y?5^XnVI}J&v|0lS$plZzVB@-A*#xUs&1*w0=FcCogqx3B95EIGrurWF7DpE~h>e~@)GK>zzMs5{L4}K;_P-ue_cN+zy%qf7e|~K-v~q2%tc6y^xUUvz zKUiU{QsFSpUGZ{G#>sx<=ONA6m#8{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UxH_^WOXzsxy*ao^axYrTtl3*xtc<Y_mdTwc z6HDgy1p8AnD!c+GESy3eRH=N>5p43fx zPDHIMLWUu%J}51E5uFYguc6tZuE~$aj~T=$R}_NNX=f1zD8_~opHfNW_h0M7%-Q#snQaQ?O6wJhoX}P%l z=OFxCY5=(!pDGlE~ z!ciLb8y{e>Z1$J*gV!r^0laJan8Tm - Alpha Transition
+ Alpha Transition
Alpha Transition

@@ -722,6 +722,17 @@ Sets the progress of Flip-Book or Flip-Book Blending. Sets the progress of Transition.

+2nd Texture Blend Mode +

+You can specify how to composite the second texture from the following options. +

+

+

    +
  • None: Don't use The second texture (Default).
  • +
  • Additive: Referring to the average of two textures.
  • +
  • Multiply
  • +
+

Edge Sharpness

This property is visible only when the Mode is set to Dissolve. diff --git a/README_JA.md b/README_JA.md index 35fc4de0..b7c69051 100644 --- a/README_JA.md +++ b/README_JA.md @@ -664,7 +664,7 @@ Color Correctionはここまでの色を補正します。 Alpha Transitionは徐々に消えていく表現に使用します。

- Alpha Transition
+ Alpha Transition
Alpha Transition

@@ -730,6 +730,17 @@ Flip-BookあるいはFlip-Book Blendingの進行度を設定します。 トランジションの進行度を設定します。

+2nd Texture Blend Mode +

+2枚目のテクスチャの合成方法を以下の選択肢から指定できます。 +

+

+

    +
  • None: 利用しない(デフォルト)
  • +
  • Additive: 加算。2つのテクスチャの平均値を参照します。
  • +
  • Multiply: 乗算
  • +
+

Edge Sharpness

ModeをDissolveに設定した時のみ表示されます。 From d267505d7746f621e1753a81912b8d8b21b1505b Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Wed, 7 Aug 2024 18:46:25 +0900 Subject: [PATCH 09/12] =?UTF-8?q?=E5=85=A8=E4=BD=93=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4=E5=BD=A2=E3=81=A8=E3=82=AF?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=83=B3=E3=83=8A=E3=83=83=E3=83=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runtime/Core/Shaders/ParticlesUber.hlsl | 302 +++++++++--------- .../ParticlesUberDepthNormalsCore.hlsl | 8 +- .../Core/Shaders/ParticlesUberLit.shader | 2 +- .../Shaders/ParticlesUberShadowCaster.hlsl | 46 +-- .../Core/Shaders/ParticlesUberUnlit.hlsl | 2 +- 5 files changed, 182 insertions(+), 178 deletions(-) diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index 5ace13c5..a9306985 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -76,137 +76,137 @@ TEXTURE3D(_SmoothnessMap3D); SAMPLER(sampler_SmoothnessMap3D); CBUFFER_START(UnityPerMaterial) -float4 _BaseMap_ST; -float4 _BaseMap2DArray_ST; -float4 _BaseMap3D_ST; -float _BaseMapProgress; -float _BaseMapProgressCoord; -float _BaseMapSliceCount; -DECLARE_CUSTOM_COORD(_BaseMapOffsetXCoord); -DECLARE_CUSTOM_COORD(_BaseMapOffsetYCoord); -float _BaseMapRotation; -DECLARE_CUSTOM_COORD(_BaseMapRotationCoord); -float4 _BaseMapRotationOffsets; - -half4 _TintColor; -float4 _TintMap_ST; -float4 _TintMap3D_ST; -float _TintMap3DProgress; -DECLARE_CUSTOM_COORD(_TintMap3DProgressCoord); -float _TintMapSliceCount; -DECLARE_CUSTOM_COORD(_TintMapOffsetXCoord); -DECLARE_CUSTOM_COORD(_TintMapOffsetYCoord); -float _TintBlendRate; -float _TintBlendRateCoord; -float _TintRimProgress; -float _TintRimProgressCoord; -float _TintRimSharpness; -float _TintRimSharpnessCoord; -float _InverseTintRim; - -float4 _FlowMap_ST; -DECLARE_CUSTOM_COORD(_FlowMapOffsetXCoord); -DECLARE_CUSTOM_COORD(_FlowMapOffsetYCoord); -half _FlowMapChannelsX; -half _FlowMapChannelsY; -float _FlowIntensity; -DECLARE_CUSTOM_COORD(_FlowIntensityCoord); - -float4 _AlphaTransitionMap_ST; -float4 _AlphaTransitionMap2DArray_ST; -float4 _AlphaTransitionMap3D_ST; -float4 _AlphaTransitionMapSecondTexture_ST; -float4 _AlphaTransitionMapSecondTexture2DArray_ST; -float4 _AlphaTransitionMapSecondTexture3D_ST; - -float _AlphaTransitionMapProgress; -DECLARE_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); -float _AlphaTransitionMapSecondTextureProgress; -DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord); -float _AlphaTransitionMapSliceCount; -float _AlphaTransitionMapSecondTextureSliceCount; -DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetXCoord); -DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetYCoord); -DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetXCoord); -DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetYCoord); -half _AlphaTransitionMapChannelsX; -float _DissolveSharpness; -half _AlphaTransitionMapSecondTextureChannelsX; -float _AlphaTransitionProgress; -DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoord); -float _AlphaTransitionProgressSecondTexture; -DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoordSecondTexture); -float _DissolveSharpnessSecondTexture; - -float4 _EmissionMap_ST; -float4 _EmissionMap2DArray_ST; -float4 _EmissionMap3D_ST; -float _EmissionMapProgress; -DECLARE_CUSTOM_COORD(_EmissionMapProgressCoord); -float _EmissionMapSliceCount; -DECLARE_CUSTOM_COORD(_EmissionMapOffsetXCoord); -DECLARE_CUSTOM_COORD(_EmissionMapOffsetYCoord); -half _EmissionMapChannelsX; - -float3 _EmissionColor; -float _EmissionIntensity; -DECLARE_CUSTOM_COORD(_EmissionIntensityCoord); -float _KeepEdgeTransparency; - -float _Cutoff; -float _Greyscale; -float _InverseRimTransparency; -float _RimTransparencyProgress; -DECLARE_CUSTOM_COORD(_RimTransparencyProgressCoord); -float _RimTransparencySharpness; -DECLARE_CUSTOM_COORD(_RimTransparencySharpnessCoord); -float _InverseLuminanceTransparency; -float _LuminanceTransparencyProgress; -DECLARE_CUSTOM_COORD(_LuminanceTransparencyProgressCoord); -float _LuminanceTransparencySharpness; -DECLARE_CUSTOM_COORD(_LuminanceTransparencySharpnessCoord); - -float4 _VertexDeformationMap_ST; -DECLARE_CUSTOM_COORD(_VertexDeformationMapOffsetXCoord); -DECLARE_CUSTOM_COORD(_VertexDeformationMapOffsetYCoord); -half _VertexDeformationMapChannel; -float _VertexDeformationIntensity; -DECLARE_CUSTOM_COORD(_VertexDeformationIntensityCoord); - -float _SoftParticlesIntensity; -float _DepthFadeNear; -float _DepthFadeFar; -float _DepthFadeWidth; -// Normal map -half _NormalMapBumpScale; -// Parallax Map -half _ParallaxMapChannel; -half _ParallaxStrength; -float4 _ParallaxMap_ST; -float4 _ParallaxMap2DArray_ST; -float4 _ParallaxMap3D_ST; -float _ParallaxMapProgress; -DECLARE_CUSTOM_COORD(_ParallaxMapProgressCoord); -float _ParallaxMapSliceCount; -DECLARE_CUSTOM_COORD(_ParallaxMapOffsetXCoord); -DECLARE_CUSTOM_COORD(_ParallaxMapOffsetYCoord); -// Specular Map -half4 _SpecularColor; -// Metallic Map -half _MetallicMapChannelsX; -float _Metallic; -// Smoothness Map -half _SmoothnessMapChannelsX; -float _Smoothness; -// Shadow Caster -half _ShadowCasterEnabled; -half _ShadowCasterApplyVertexDeformation; -half _ShadowCasterAlphaTestEnabled; -half _ShadowCasterAlphaCutoff; -half _ShadowCasterAlphaAffectedByTintColor; -half _ShadowCasterAlphaAffectedByFlowMap; -half _ShadowCasterAlphaAffectedByAlphaTransitionMap; -half _ShadowCasterAlphaAffectedByTransparencyLuminance; + float4 _BaseMap_ST; + float4 _BaseMap2DArray_ST; + float4 _BaseMap3D_ST; + float _BaseMapProgress; + float _BaseMapProgressCoord; + float _BaseMapSliceCount; + DECLARE_CUSTOM_COORD(_BaseMapOffsetXCoord); + DECLARE_CUSTOM_COORD(_BaseMapOffsetYCoord); + float _BaseMapRotation; + DECLARE_CUSTOM_COORD(_BaseMapRotationCoord); + float4 _BaseMapRotationOffsets; + + half4 _TintColor; + float4 _TintMap_ST; + float4 _TintMap3D_ST; + float _TintMap3DProgress; + DECLARE_CUSTOM_COORD(_TintMap3DProgressCoord); + float _TintMapSliceCount; + DECLARE_CUSTOM_COORD(_TintMapOffsetXCoord); + DECLARE_CUSTOM_COORD(_TintMapOffsetYCoord); + float _TintBlendRate; + float _TintBlendRateCoord; + float _TintRimProgress; + float _TintRimProgressCoord; + float _TintRimSharpness; + float _TintRimSharpnessCoord; + float _InverseTintRim; + + float4 _FlowMap_ST; + DECLARE_CUSTOM_COORD(_FlowMapOffsetXCoord); + DECLARE_CUSTOM_COORD(_FlowMapOffsetYCoord); + half _FlowMapChannelsX; + half _FlowMapChannelsY; + float _FlowIntensity; + DECLARE_CUSTOM_COORD(_FlowIntensityCoord); + + float4 _AlphaTransitionMap_ST; + float4 _AlphaTransitionMap2DArray_ST; + float4 _AlphaTransitionMap3D_ST; + float4 _AlphaTransitionMapSecondTexture_ST; + float4 _AlphaTransitionMapSecondTexture2DArray_ST; + float4 _AlphaTransitionMapSecondTexture3D_ST; + + float _AlphaTransitionMapProgress; + DECLARE_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); + float _AlphaTransitionMapSecondTextureProgress; + DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureProgressCoord); + float _AlphaTransitionMapSliceCount; + float _AlphaTransitionMapSecondTextureSliceCount; + DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetXCoord); + DECLARE_CUSTOM_COORD(_AlphaTransitionMapOffsetYCoord); + DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetXCoord); + DECLARE_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetYCoord); + half _AlphaTransitionMapChannelsX; + float _DissolveSharpness; + half _AlphaTransitionMapSecondTextureChannelsX; + float _AlphaTransitionProgress; + DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoord); + float _AlphaTransitionProgressSecondTexture; + DECLARE_CUSTOM_COORD(_AlphaTransitionProgressCoordSecondTexture); + float _DissolveSharpnessSecondTexture; + + float4 _EmissionMap_ST; + float4 _EmissionMap2DArray_ST; + float4 _EmissionMap3D_ST; + float _EmissionMapProgress; + DECLARE_CUSTOM_COORD(_EmissionMapProgressCoord); + float _EmissionMapSliceCount; + DECLARE_CUSTOM_COORD(_EmissionMapOffsetXCoord); + DECLARE_CUSTOM_COORD(_EmissionMapOffsetYCoord); + half _EmissionMapChannelsX; + + float3 _EmissionColor; + float _EmissionIntensity; + DECLARE_CUSTOM_COORD(_EmissionIntensityCoord); + float _KeepEdgeTransparency; + + float _Cutoff; + float _Greyscale; + float _InverseRimTransparency; + float _RimTransparencyProgress; + DECLARE_CUSTOM_COORD(_RimTransparencyProgressCoord); + float _RimTransparencySharpness; + DECLARE_CUSTOM_COORD(_RimTransparencySharpnessCoord); + float _InverseLuminanceTransparency; + float _LuminanceTransparencyProgress; + DECLARE_CUSTOM_COORD(_LuminanceTransparencyProgressCoord); + float _LuminanceTransparencySharpness; + DECLARE_CUSTOM_COORD(_LuminanceTransparencySharpnessCoord); + + float4 _VertexDeformationMap_ST; + DECLARE_CUSTOM_COORD(_VertexDeformationMapOffsetXCoord); + DECLARE_CUSTOM_COORD(_VertexDeformationMapOffsetYCoord); + half _VertexDeformationMapChannel; + float _VertexDeformationIntensity; + DECLARE_CUSTOM_COORD(_VertexDeformationIntensityCoord); + + float _SoftParticlesIntensity; + float _DepthFadeNear; + float _DepthFadeFar; + float _DepthFadeWidth; + // Normal map + half _NormalMapBumpScale; + // Parallax Map + half _ParallaxMapChannel; + half _ParallaxStrength; + float4 _ParallaxMap_ST; + float4 _ParallaxMap2DArray_ST; + float4 _ParallaxMap3D_ST; + float _ParallaxMapProgress; + DECLARE_CUSTOM_COORD(_ParallaxMapProgressCoord); + float _ParallaxMapSliceCount; + DECLARE_CUSTOM_COORD(_ParallaxMapOffsetXCoord); + DECLARE_CUSTOM_COORD(_ParallaxMapOffsetYCoord); + // Specular Map + half4 _SpecularColor; + // Metallic Map + half _MetallicMapChannelsX; + float _Metallic; + // Smoothness Map + half _SmoothnessMapChannelsX; + float _Smoothness; + // Shadow Caster + half _ShadowCasterEnabled; + half _ShadowCasterApplyVertexDeformation; + half _ShadowCasterAlphaTestEnabled; + half _ShadowCasterAlphaCutoff; + half _ShadowCasterAlphaAffectedByTintColor; + half _ShadowCasterAlphaAffectedByFlowMap; + half _ShadowCasterAlphaAffectedByAlphaTransitionMap; + half _ShadowCasterAlphaAffectedByTransparencyLuminance; CBUFFER_END @@ -349,19 +349,19 @@ 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_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) #define TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMapSecondTexture); - #endif +#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_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) #define TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMapSecondTexture2DArray); - #endif +#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_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) #define TRANSFORM_ALPHA_TRANSITION_MAP_SECOND(texcoord) TRANSFORM_TEX(texcoord, _AlphaTransitionMapSecondTexture3D); - #endif +#endif #endif // Transforms the alpha transition map UV by the scale/bias property @@ -461,19 +461,19 @@ 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_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) #define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE2D(_AlphaTransitionMapSecondTexture, sampler_AlphaTransitionMapSecondTexture, uv); - #endif +#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_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) #define SAMPLE_ALPHA_TRANSITION_MAP_SECOND(uv, progress) SAMPLE_TEXTURE2D_ARRAY(_AlphaTransitionMapSecondTexture2DArray, sampler_AlphaTransitionMapSecondTexture2DArray, uv, progress); - #endif +#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_ADDITIVE) || 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 #endif void ModulateAlphaTransitionProgress(in out half progress, half vertexAlpha) @@ -514,12 +514,12 @@ half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half 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_ADDITIVE) mainTexAlpha = (mainTexAlpha + secondTexAlpha) * 0.5; - #endif - #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) +#endif +#if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) mainTexAlpha = mainTexAlpha * secondTexAlpha; - #endif +#endif return mainTexAlpha; } @@ -527,7 +527,8 @@ half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half transitionProgress) { half4 mainTexMap = SAMPLE_ALPHA_TRANSITION_MAP(transitionMapUv, transitionMapProgress); - return GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress, _DissolveSharpness); + return GetTransitionAlphaImpl(mainTexMap, (uint)_AlphaTransitionMapChannelsX, transitionProgress, + _DissolveSharpness); } #endif @@ -642,12 +643,15 @@ inline void ApplyDepthFade(in out half4 color, float4 projection) color.a *= DepthFade(_DepthFadeNear, _DepthFadeFar, _DepthFadeWidth, projection); #endif } -inline void CalculateTangetAndBinormalInWorldSpace(out float4 tangentWS, out float3 binormalWS, float3 normalWS, float4 tangentOS ) + +inline void CalculateTangetAndBinormalInWorldSpace(out float4 tangentWS, out float3 binormalWS, float3 normalWS, + float4 tangentOS) { tangentWS.xyz = TransformObjectToWorldDir(tangentOS.xyz, true); tangentWS.w = tangentOS.w; binormalWS = cross(normalWS, tangentWS.xyz) * tangentOS.w; } + /** * \brief Get normal in world space. * \param normalTS Normal in tangent space. diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl index a2ef4daf..bcf8f962 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl @@ -108,7 +108,7 @@ struct VaryingsDrawDepth #if defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) float4 flowTransitionSecondUVs : TEXCOORD8; // xy: FlowMap UV, zw: TransitionMap UV #endif - + UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -206,7 +206,7 @@ VaryingsDrawDepth vert(AttributesDrawDepth input) output.flowTransitionSecondUVs.w += GET_CUSTOM_COORD(_AlphaTransitionMapSecondTextureOffsetYCoord) #endif #endif - + #ifdef _ALPHATEST_ENABLED // This code is not used for opaque objects. // Base Map Progress @@ -240,7 +240,7 @@ VaryingsDrawDepth vert(AttributesDrawDepth input) float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); float sliceCount = _AlphaTransitionMapSliceCount; #endif - + #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY output.transitionEmissionProgresses.x = FlipBookProgress(transitionMapProgress, sliceCount); #elif _ALPHA_TRANSITION_MAP_MODE_3D @@ -397,7 +397,7 @@ half4 frag(VaryingsDrawDepth input) : SV_Target #endif return half4(NormalizeNormalPerPixel(normalWS), 0.0); #else - return half4( 0.0, 0.0, 0.0, 0.0); + return half4(0.0, 0.0, 0.0, 0.0); #endif } diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader index c143439c..648f7c8c 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader @@ -279,7 +279,7 @@ Shader "Nova/Particles/UberLit" #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 - + // Emission #pragma shader_feature_local _ _EMISSION_AREA_ALL _EMISSION_AREA_MAP _EMISSION_AREA_ALPHA #pragma shader_feature_local _EMISSION_MAP_MODE_2D _EMISSION_MAP_MODE_2D_ARRAY _EMISSION_MAP_MODE_3D diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl index ee3a7de9..83c9f70e 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl @@ -48,19 +48,19 @@ float4 GetShadowPositionHClip(Attributes input) float3 positionWS = TransformObjectToWorld(input.positionOS.xyz); float3 normalWS = TransformObjectToWorldNormal(input.normalOS); -#if _CASTING_PUNCTUAL_LIGHT_SHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW float3 lightDirectionWS = normalize(_LightPosition - positionWS); -#else + #else float3 lightDirectionWS = _LightDirection; -#endif + #endif float4 positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS)); -#if UNITY_REVERSED_Z + #if UNITY_REVERSED_Z positionCS.z = min(positionCS.z, UNITY_NEAR_CLIP_VALUE); -#else + #else positionCS.z = max(positionCS.z, UNITY_NEAR_CLIP_VALUE); -#endif + #endif return positionCS; } @@ -157,7 +157,7 @@ Varyings ShadowPassVertex(Attributes input) float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); float sliceCount = _AlphaTransitionMapSliceCount; #endif - + #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY output.transitionProgress = FlipBookProgress(transitionMapProgress, sliceCount); #elif _ALPHA_TRANSITION_MAP_MODE_3D @@ -183,21 +183,21 @@ half4 ShadowPassFragment(Varyings input) : SV_TARGET half intensity = _FlowIntensity + GET_CUSTOM_COORD(_FlowIntensityCoord); half2 flowMapUvOffset = GetFlowMapUvOffset(_FlowMap, sampler_FlowMap, intensity, input.flowTransitionUVs.xy, _FlowMapChannelsX, _FlowMapChannelsY); - #if defined(_FLOW_MAP_TARGET_BASE) + #if defined(_FLOW_MAP_TARGET_BASE) input.baseMapUVAndProgresses.xy += flowMapUvOffset; - #endif + #endif - #ifdef _FLOW_MAP_TARGET_TINT - #if defined(_TINT_MAP_ENABLED) || defined(_TINT_MAP_3D_ENABLED) + #ifdef _FLOW_MAP_TARGET_TINT + #if defined(_TINT_MAP_ENABLED) || defined(_TINT_MAP_3D_ENABLED) input.tintUV += flowMapUvOffset; - #endif - #endif - #ifdef _FLOW_MAP_TARGET_ALPHA_TRANSITION + #endif + #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_ADDITIVE) || defined(_ALPHA_TRANSITION_BLEND_SECOND_TEX_MULTIPLY) input.flowTransitionSecondUVs.zw += flowMapUvOffset; - #endif - #endif + #endif + #endif } #endif @@ -209,11 +209,11 @@ half4 ShadowPassFragment(Varyings input) : SV_TARGET if (_ShadowCasterAlphaAffectedByTintColor) { half tintBlendRate = _TintBlendRate + GET_CUSTOM_COORD(_TintBlendRateCoord); - #if defined(_TINT_MAP_ENABLED) || defined(_TINT_MAP_3D_ENABLED) + #if defined(_TINT_MAP_ENABLED) || defined(_TINT_MAP_3D_ENABLED) ApplyTintColor(color, input.tintUV, input.baseMapUVAndProgresses.w, tintBlendRate); - #else + #else ApplyTintColor(color, half2( 0, 0 ), input.baseMapUVAndProgresses.w, tintBlendRate); - #endif + #endif } #endif @@ -223,13 +223,13 @@ 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_ADDITIVE) || 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); - #else + #else color.a *= GetTransitionAlpha(input.flowTransitionUVs.zw, input.transitionProgress, alphaTransitionProgress); - #endif + #endif } #endif diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl index 3b68b5c3..9efb7a29 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl @@ -185,7 +185,7 @@ Varyings vertUnlit(Attributes input, out float3 positionWS, uniform bool useEmis float transitionMapProgress = _AlphaTransitionMapProgress + GET_CUSTOM_COORD(_AlphaTransitionMapProgressCoord); float sliceCount = _AlphaTransitionMapSliceCount; #endif - + #ifdef _ALPHA_TRANSITION_MAP_MODE_2D_ARRAY output.transitionEmissionProgresses.x = FlipBookProgress(transitionMapProgress, sliceCount); #elif _ALPHA_TRANSITION_MAP_MODE_3D From e1f25d224b790a6a38bb34b3f42fc94ab1a443ac Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Thu, 8 Aug 2024 16:24:27 +0900 Subject: [PATCH 10/12] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Scripts/ParticlesUberCommonGUI.cs | 56 ++++++++++++------- ...ParticlesUberUnlitMaterialPostProcessor.cs | 54 ++++++++++-------- 2 files changed, 65 insertions(+), 45 deletions(-) diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs index 0b068f39..2b52ef33 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberCommonGUI.cs @@ -421,7 +421,7 @@ private void InternalDrawAlphaTransitionProperties() } } } - + if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook || alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending) MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Flip-Book Progress", @@ -431,46 +431,53 @@ private void InternalDrawAlphaTransitionProperties() props.AlphaTransitionProgressProp.Value, props.AlphaTransitionProgressCoordProp.Value); if (mode == AlphaTransitionMode.Dissolve) _editor.ShaderProperty(props.DissolveSharpnessProp.Value, "Edge Sharpness"); - + // 2nd Texture { MaterialEditorUtility.DrawEnumProperty(_editor, "2nd Texture Blend Mode", - props.AlphaTransitionSecondTextureBlendModeProp.Value); - var alphaTransitionSecondTextureBlendMode = (AlphaTransitionBlendMode)props.AlphaTransitionSecondTextureBlendModeProp.Value.floatValue; + props.AlphaTransitionSecondTextureBlendModeProp.Value); + var alphaTransitionSecondTextureBlendMode = + (AlphaTransitionBlendMode)props.AlphaTransitionSecondTextureBlendModeProp.Value.floatValue; if (alphaTransitionSecondTextureBlendMode != AlphaTransitionBlendMode.None) { using (var changeCheckScope = new EditorGUI.ChangeCheckScope()) { MaterialEditorUtility.DrawTexture(_editor, alphaTransitionMapSecondTextureProp, - props.AlphaTransitionMapSecondTextureOffsetXCoordProp.Value, props.AlphaTransitionMapSecondTextureOffsetYCoordProp.Value, - props.AlphaTransitionMapSecondTextureChannelsXProp.Value, null); + props.AlphaTransitionMapSecondTextureOffsetXCoordProp.Value, + props.AlphaTransitionMapSecondTextureOffsetYCoordProp.Value, + props.AlphaTransitionMapSecondTextureChannelsXProp.Value, null); if (changeCheckScope.changed) { if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook && props.AlphaTransitionMapSecondTexture2DArrayProp.Value.textureValue != null) { - var tex2DArray = (Texture2DArray)props.AlphaTransitionMapSecondTexture2DArrayProp.Value.textureValue; - props.AlphaTransitionMapSecondTextureSliceCountProp.Value.floatValue = tex2DArray.depth; + var tex2DArray = (Texture2DArray)props.AlphaTransitionMapSecondTexture2DArrayProp + .Value.textureValue; + props.AlphaTransitionMapSecondTextureSliceCountProp.Value.floatValue = + tex2DArray.depth; } if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending && props.AlphaTransitionMapSecondTexture3DProp.Value.textureValue != null) { - var tex3D = (Texture3D)props.AlphaTransitionMapSecondTexture3DProp.Value.textureValue; + var tex3D = (Texture3D)props.AlphaTransitionMapSecondTexture3DProp.Value + .textureValue; props.AlphaTransitionMapSecondTextureSliceCountProp.Value.floatValue = tex3D.depth; } } } - + if (alphaTransitionMapMode == AlphaTransitionMapMode.FlipBook || alphaTransitionMapMode == AlphaTransitionMapMode.FlipBookBlending) MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Flip-Book Progress", - props.AlphaTransitionMapSecondTextureProgressProp.Value, props.AlphaTransitionMapSecondTextureProgressCoordProp.Value); - + props.AlphaTransitionMapSecondTextureProgressProp.Value, + props.AlphaTransitionMapSecondTextureProgressCoordProp.Value); + MaterialEditorUtility.DrawPropertyAndCustomCoord(_editor, "Transition Progress", - props.AlphaTransitionProgressSecondTextureProp.Value, props.AlphaTransitionProgressCoordSecondTextureProp.Value); - + props.AlphaTransitionProgressSecondTextureProp.Value, + props.AlphaTransitionProgressCoordSecondTextureProp.Value); + if (mode == AlphaTransitionMode.Dissolve) _editor.ShaderProperty(props.DissolveSharpnessSecondTextureProp.Value, "Edge Sharpness"); } @@ -647,22 +654,29 @@ private void InternalDrawShadowCasterProperties() if (props.ShadowCasterEnabledProp.Value.floatValue < 0.5f) return; - MaterialEditorUtility.DrawToggleProperty(_editor, "Apply Vertex Deformation", props.ShadowCasterApplyVertexDeformationProp.Value); + MaterialEditorUtility.DrawToggleProperty(_editor, "Apply Vertex Deformation", + props.ShadowCasterApplyVertexDeformationProp.Value); - MaterialEditorUtility.DrawToggleProperty(_editor, "Alpha Test Enable", props.ShadowCasterAlphaTestEnabledProp.Value); + MaterialEditorUtility.DrawToggleProperty(_editor, "Alpha Test Enable", + props.ShadowCasterAlphaTestEnabledProp.Value); if (props.ShadowCasterAlphaTestEnabledProp.Value.floatValue < 0.5f) return; EditorGUI.indentLevel++; - MaterialEditorUtility.DrawFloatRangeProperty(_editor, "Cutoff", props.ShadowCasterAlphaCutoffProp.Value, 0, 1); + MaterialEditorUtility.DrawFloatRangeProperty(_editor, "Cutoff", props.ShadowCasterAlphaCutoffProp.Value, 0, + 1); EditorGUI.indentLevel--; EditorGUI.LabelField(EditorGUILayout.GetControlRect(), "Alpha Affected By"); EditorGUI.indentLevel++; - MaterialEditorUtility.DrawToggleProperty(_editor, "Tint Color", props.ShadowCasterAlphaAffectedByTintColorProp.Value); - MaterialEditorUtility.DrawToggleProperty(_editor, "Flow Map", props.ShadowCasterAlphaAffectedByFlowMapProp.Value); - MaterialEditorUtility.DrawToggleProperty(_editor, "Alpha Transition Map", props.ShadowCasterAlphaAffectedByAlphaTransitionMapProp.Value); - MaterialEditorUtility.DrawToggleProperty(_editor, "Transparency Luminance", props.ShadowCasterAlphaAffectedByTransparencyLuminanceProp.Value); + MaterialEditorUtility.DrawToggleProperty(_editor, "Tint Color", + props.ShadowCasterAlphaAffectedByTintColorProp.Value); + MaterialEditorUtility.DrawToggleProperty(_editor, "Flow Map", + props.ShadowCasterAlphaAffectedByFlowMapProp.Value); + MaterialEditorUtility.DrawToggleProperty(_editor, "Alpha Transition Map", + props.ShadowCasterAlphaAffectedByAlphaTransitionMapProp.Value); + MaterialEditorUtility.DrawToggleProperty(_editor, "Transparency Luminance", + props.ShadowCasterAlphaAffectedByTransparencyLuminanceProp.Value); EditorGUI.indentLevel--; } diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs index 64b3af72..4c07b744 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs @@ -27,7 +27,7 @@ public static class ParticlesUberUnlitMaterialPostProcessor private static readonly int BaseMapRotationCoordId = Shader.PropertyToID(MaterialPropertyNames.BaseMapRotationCoord); - + private static readonly int TintAreaModeId = Shader.PropertyToID(MaterialPropertyNames.TintAreaMode); private static readonly int TintMapModeId = Shader.PropertyToID(MaterialPropertyNames.TintColorMode); private static readonly int FlowMapId = Shader.PropertyToID(MaterialPropertyNames.FlowMap); @@ -35,10 +35,13 @@ public static class ParticlesUberUnlitMaterialPostProcessor private static readonly int FlowIntensityCoordId = Shader.PropertyToID(MaterialPropertyNames.FlowIntensityCoord); - + private static readonly int ParallaxMapModeId = Shader.PropertyToID(MaterialPropertyNames.ParallaxMapMode); private static readonly int ParallaxMapId = Shader.PropertyToID(MaterialPropertyNames.ParallaxMap); - private static readonly int ParallaxMap2DArrayId = Shader.PropertyToID(MaterialPropertyNames.ParallaxMap2DArray); + + private static readonly int ParallaxMap2DArrayId = + Shader.PropertyToID(MaterialPropertyNames.ParallaxMap2DArray); + private static readonly int ParallaxMap3DId = Shader.PropertyToID(MaterialPropertyNames.ParallaxMap3D); private static readonly int ParallaxMapTargetId = Shader.PropertyToID(MaterialPropertyNames.ParallaxMapTarget); @@ -53,7 +56,7 @@ public static class ParticlesUberUnlitMaterialPostProcessor private static readonly int AlphaTransitionMap3DId = Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionMap3D); - + private static readonly int AlphaTransitionMapSecondTextureId = Shader.PropertyToID(MaterialPropertyNames.AlphaTransitionMapSecondTexture); @@ -87,7 +90,7 @@ public static class ParticlesUberUnlitMaterialPostProcessor private static readonly int SoftParticlesEnabledId = Shader.PropertyToID(MaterialPropertyNames.SoftParticlesEnabled); - + private static readonly int VertexDeformationMapId = Shader.PropertyToID(MaterialPropertyNames.VertexDeformationMap); @@ -101,9 +104,10 @@ public static class ParticlesUberUnlitMaterialPostProcessor private static readonly int TransparentBlendModeId = Shader.PropertyToID(MaterialPropertyNames.TransparentBlendMode); - - private static readonly int ShadowCasterEnabledId = + + private static readonly int ShadowCasterEnabledId = Shader.PropertyToID(MaterialPropertyNames.ShadowCasterEnabled); + private static readonly int ShadowCasterAlphaTestEnabledId = Shader.PropertyToID(MaterialPropertyNames.ShadowCasterAlphaTestEnabled); @@ -223,20 +227,20 @@ private static void SetupFlowMapMaterialKeywords(Material material) { //NOTE: Remove the keyword because it is obsolete. MaterialEditorUtility.SetKeyword(material, ShaderKeywords.FlowMapEnabled, false); - + var flowMapTarget = (FlowMapTarget)material.GetFloat(FlowMapTargetId); var hasFlowMap = material.GetTexture(FlowMapId) != null; - + var baseEnabled = hasFlowMap && (flowMapTarget & FlowMapTarget.BaseMap) != 0; MaterialEditorUtility.SetKeyword(material, ShaderKeywords.FlowMapTargetBase, baseEnabled); - + var tintEnabled = hasFlowMap && (flowMapTarget & FlowMapTarget.TintMap) != 0; MaterialEditorUtility.SetKeyword(material, ShaderKeywords.FlowMapTargetTint, tintEnabled); var alphaTransitionEnabled = hasFlowMap && (flowMapTarget & FlowMapTarget.AlphaTransitionMap) != 0; MaterialEditorUtility.SetKeyword(material, ShaderKeywords.FlowMapTargetAlphaTransition, alphaTransitionEnabled); - + var emissionEnabled = hasFlowMap && (flowMapTarget & FlowMapTarget.EmissionMap) != 0; MaterialEditorUtility.SetKeyword(material, ShaderKeywords.FlowMapTargetEmission, emissionEnabled); } @@ -250,8 +254,8 @@ private static void SetupParallaxMapMaterialKeywords(Material material) var keyword = value.GetShaderKeyword(); MaterialEditorUtility.SetKeyword(material, keyword, isOn); } - - bool hasParallaxMap = false; + + var hasParallaxMap = false; switch (parallaxMapMode) { case ParallaxMapMode.SingleTexture: @@ -268,7 +272,7 @@ private static void SetupParallaxMapMaterialKeywords(Material material) var parallaxMapTarget = (ParallaxMapTarget)material.GetFloat(ParallaxMapTargetId); var baseEnabled = hasParallaxMap && (parallaxMapTarget & ParallaxMapTarget.BaseMap) != 0; MaterialEditorUtility.SetKeyword(material, ShaderKeywords.ParallaxMapTargetBase, baseEnabled); - + var tintEnabled = hasParallaxMap && (parallaxMapTarget & ParallaxMapTarget.TintMap) != 0; MaterialEditorUtility.SetKeyword(material, ShaderKeywords.ParallaxMapTargetTint, tintEnabled); @@ -288,7 +292,7 @@ private static void SetupAlphaTransitionMaterialKeywords(Material material) MaterialEditorUtility.SetKeyword(material, ShaderKeywords.FadeTransitionEnabled, fadeTransitionEnabled); MaterialEditorUtility.SetKeyword(material, ShaderKeywords.DissolveTransitionEnabled, dissolveTransitionEnabled); - + var alphaTransitionMapMode = (AlphaTransitionMapMode)material.GetFloat(AlphaTransitionMapModeId); foreach (AlphaTransitionMapMode value in Enum.GetValues(typeof(AlphaTransitionMapMode))) { @@ -296,12 +300,12 @@ private static void SetupAlphaTransitionMaterialKeywords(Material material) var keyword = value.GetShaderKeyword(); MaterialEditorUtility.SetKeyword(material, keyword, isOn); } - + // 2nd Texture { - bool secondTexEnabled = material.GetTexture(AlphaTransitionMapSecondTextureId) != null - || material.GetTexture(AlphaTransitionMapSecondTexture2DArrayId) != null - || material.GetTexture(AlphaTransitionMapSecondTexture3DId) != null; + var secondTexEnabled = material.GetTexture(AlphaTransitionMapSecondTextureId) != null + || material.GetTexture(AlphaTransitionMapSecondTexture2DArrayId) != null + || material.GetTexture(AlphaTransitionMapSecondTexture3DId) != null; var blendMode = (AlphaTransitionBlendMode)material.GetFloat(AlphaTransitionSecondTextureBlendMode); MaterialEditorUtility.SetKeyword(material, ShaderKeywords.AlphaTransitionBlendSecondTexAdditive, secondTexEnabled && blendMode == AlphaTransitionBlendMode.Additive); @@ -356,21 +360,23 @@ private static void SetupTransparencyMaterialKeywords(Material material) var depthFadeEnabled = material.GetFloat(DepthFadeEnabledId) > 0.5f; MaterialEditorUtility.SetKeyword(material, ShaderKeywords.DepthFadeEnabled, depthFadeEnabled); } - + private static void SetupVertexDeformationMaterialKeywords(Material material) { var vertexDeformationEnabled = material.GetTexture(VertexDeformationMapId) != null; - MaterialEditorUtility.SetKeyword(material, ShaderKeywords.VertexDeformationEnabled, vertexDeformationEnabled); + MaterialEditorUtility.SetKeyword(material, ShaderKeywords.VertexDeformationEnabled, + vertexDeformationEnabled); } private static void SetupShadowCasterMaterialKeywords(Material material) { - bool shadowCasterEnabled = material.GetFloat(ShadowCasterEnabledId) > 0.5f; + var shadowCasterEnabled = material.GetFloat(ShadowCasterEnabledId) > 0.5f; material.SetShaderPassEnabled("ShadowCaster", shadowCasterEnabled); if (shadowCasterEnabled) { - bool alphaTestEnabled = material.GetFloat(ShadowCasterAlphaTestEnabledId) > 0.5f; - MaterialEditorUtility.SetKeyword(material, ShaderKeywords.ShadowCasterAlphaTestEnable, alphaTestEnabled); + var alphaTestEnabled = material.GetFloat(ShadowCasterAlphaTestEnabledId) > 0.5f; + MaterialEditorUtility.SetKeyword(material, ShaderKeywords.ShadowCasterAlphaTestEnable, + alphaTestEnabled); } } From 595e7d8725aebd65fd27a090d48d1df3676ae24c Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Thu, 8 Aug 2024 17:07:40 +0900 Subject: [PATCH 11/12] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs index 3b4a0315..7e75ed24 100644 --- a/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs +++ b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------- -// Copyright 2021 CyberAgent, Inc. +// Copyright 2024 CyberAgent, Inc. // -------------------------------------------------------------- namespace Nova.Editor.Core.Scripts @@ -10,4 +10,4 @@ public enum AlphaTransitionBlendMode Additive, Multiply } -} \ No newline at end of file +} From f3e9da4ccda3c392b9094338e62127fd273405a8 Mon Sep 17 00:00:00 2001 From: CA-Tatami Date: Thu, 8 Aug 2024 17:32:57 +0900 Subject: [PATCH 12/12] =?UTF-8?q?=EF=BC=92=E6=9E=9A=E7=9B=AE=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=AF=E3=82=B9=E3=83=81=E3=83=A3=E3=81=A8=E3=81=AE?= =?UTF-8?q?=E3=83=96=E3=83=AC=E3=83=B3=E3=83=89=E6=96=B9=E5=BC=8F=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6=E6=96=87=E8=A8=80=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=EF=BC=9AAdditive=E2=87=92Average?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core/Scripts/AlphaTransitionBlendMode.cs | 2 +- .../ParticlesUberUnlitMaterialPostProcessor.cs | 6 +++--- .../Nova/Editor/Core/Scripts/ShaderKeywords.cs | 10 +++++----- .../Nova/Runtime/Core/Shaders/ParticlesUber.hlsl | 16 ++++++++-------- .../Shaders/ParticlesUberDepthNormalsCore.hlsl | 10 +++++----- .../Runtime/Core/Shaders/ParticlesUberLit.shader | 12 ++++++------ .../Core/Shaders/ParticlesUberShadowCaster.hlsl | 10 +++++----- .../Runtime/Core/Shaders/ParticlesUberUnlit.hlsl | 10 +++++----- .../Core/Shaders/ParticlesUberUnlit.shader | 12 ++++++------ README.md | 2 +- README_JA.md | 2 +- 11 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs index 7e75ed24..01e703d0 100644 --- a/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs +++ b/Assets/Nova/Editor/Core/Scripts/AlphaTransitionBlendMode.cs @@ -7,7 +7,7 @@ namespace Nova.Editor.Core.Scripts public enum AlphaTransitionBlendMode { None, - Additive, + Average, Multiply } } diff --git a/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs b/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs index 4c07b744..ddfc8e3e 100644 --- a/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs +++ b/Assets/Nova/Editor/Core/Scripts/ParticlesUberUnlitMaterialPostProcessor.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------- -// Copyright 2022 CyberAgent, Inc. +// Copyright 2024 CyberAgent, Inc. // -------------------------------------------------------------- using System; @@ -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); } diff --git a/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs b/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs index b906ea0d..09a11076 100644 --- a/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs +++ b/Assets/Nova/Editor/Core/Scripts/ShaderKeywords.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------- -// Copyright 2022 CyberAgent, Inc. +// Copyright 2024 CyberAgent, Inc. // -------------------------------------------------------------- using System; @@ -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"; @@ -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 @@ -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"; @@ -224,4 +224,4 @@ public static string GetShaderKeyword(this ParallaxMapMode parallaxMapMode) } } } -} \ No newline at end of file +} diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl index a9306985..a03c1143 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUber.hlsl @@ -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 @@ -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 @@ -506,7 +506,7 @@ 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); @@ -514,7 +514,7 @@ half GetTransitionAlpha(half2 transitionMapUv, half transitionMapProgress, half 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) diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl index bcf8f962..7ab437e9 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberDepthNormalsCore.hlsl @@ -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 @@ -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) @@ -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 @@ -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 @@ -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); diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader index 648f7c8c..f9a258f1 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberLit.shader @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl index 83c9f70e..01093342 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberShadowCaster.hlsl @@ -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 @@ -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) @@ -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 @@ -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 @@ -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); diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl index 9efb7a29..822a6218 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.hlsl @@ -46,7 +46,7 @@ struct Varyings float3 viewDirTS : TEXCOORD9; float3 parallaxMapUVAndProgress : TEXCOORD10; #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 : TEXCOORD11; // xy: FlowMap UV, zw: TransitionMap UV #endif UNITY_VERTEX_INPUT_INSTANCE_ID @@ -169,7 +169,7 @@ Varyings vertUnlit(Attributes input, out float3 positionWS, uniform bool useEmis 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) @@ -178,7 +178,7 @@ Varyings vertUnlit(Attributes input, out float3 positionWS, uniform bool useEmis // 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 @@ -249,7 +249,7 @@ half4 fragUnlit(in out Varyings input, uniform bool useEmission) #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 @@ -300,7 +300,7 @@ half4 fragUnlit(in out Varyings input, uniform bool useEmission) #if defined(_FADE_TRANSITION_ENABLED) || defined(_DISSOLVE_TRANSITION_ENABLED) 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); diff --git a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader index 1d7a817b..f1d31c46 100644 --- a/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader +++ b/Assets/Nova/Runtime/Core/Shaders/ParticlesUberUnlit.shader @@ -234,7 +234,7 @@ Shader "Nova/Particles/UberUnlit" // 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 @@ -310,7 +310,7 @@ Shader "Nova/Particles/UberUnlit" // 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 @@ -386,7 +386,7 @@ Shader "Nova/Particles/UberUnlit" // 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 @@ -465,7 +465,7 @@ Shader "Nova/Particles/UberUnlit" // 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 @@ -544,7 +544,7 @@ Shader "Nova/Particles/UberUnlit" // 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 @@ -605,7 +605,7 @@ Shader "Nova/Particles/UberUnlit" // 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 diff --git a/README.md b/README.md index 2cd15e54..b4eaf888 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ You can specify the color blend method from the following options.

  • Alpha (Alpha Blending / Default)
  • -
  • Additive
  • +
  • Average
  • Multiply

diff --git a/README_JA.md b/README_JA.md index b7c69051..c949278f 100644 --- a/README_JA.md +++ b/README_JA.md @@ -737,7 +737,7 @@ Flip-BookあるいはFlip-Book Blendingの進行度を設定します。

  • None: 利用しない(デフォルト)
  • -
  • Additive: 加算。2つのテクスチャの平均値を参照します。
  • +
  • Average: 平均。2つのテクスチャの平均値を参照します。
  • Multiply: 乗算