From 240d51762b2f53ceeaf73006733067ed4c31e4d4 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 10 May 2021 10:52:20 +0200 Subject: [PATCH 01/66] Blend Sources with additional defines --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 134 +++++++++++++ .../Outputs/VFXDecalHDRPOutput.cs.meta | 11 ++ .../Templates/HDRPDecal/PassDBuffer.template | 182 ++++++++++++++++++ .../HDRPDecal/PassDBuffer.template.meta | 7 + .../Templates/VFXParticleHDRPDecal.template | 11 ++ .../VFXParticleHDRPDecal.template.meta | 7 + 6 files changed, 352 insertions(+) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs.meta create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template.meta create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs new file mode 100644 index 00000000000..455fed5280a --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor.VFX.Block; +using UnityEngine; +using UnityEngine.Rendering; + +namespace UnityEditor.VFX +{ + [VFXInfo(experimental = true)] + class VFXDecalHDRPOutput : VFXAbstractParticleHDRPLitOutput + { + + public override string name { get { return "Output Particle HDRP Decal"; } } + public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleHDRPDecal"); } } + public override VFXTaskType taskType { get { return VFXTaskType.ParticleHexahedronOutput; } } + + public override IEnumerable attributes + { + get + { + yield return new VFXAttributeInfo(VFXAttribute.Position, VFXAttributeMode.Read); + if (colorMode != ColorMode.None) + yield return new VFXAttributeInfo(VFXAttribute.Color, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.Alpha, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.Alive, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.AxisX, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.AxisY, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.AxisZ, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.AngleX, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.AngleY, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.AngleZ, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.PivotX, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.PivotY, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.PivotZ, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.Size, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.ScaleX, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.ScaleY, VFXAttributeMode.Read); + yield return new VFXAttributeInfo(VFXAttribute.ScaleZ, VFXAttributeMode.Read); + } + } + + public enum BlendSource + { + BaseColorMapAlpha, + MaskMapBlue, + } + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Normal Map.")] + BlendSource normalOpacityChannel = BlendSource.BaseColorMapAlpha; + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Mask Map.")] + BlendSource maskOpacityChannel = BlendSource.BaseColorMapAlpha; + + public class NoMaskMapProperties + { + [Range(0, 1), Tooltip("Controls the metallic of the decal.")] + public float metallic = 0.0f; + [Range(0, 1), Tooltip("Controls the ambient occlusion of the decal.")] + public float ambientOcclusion = 0.0f; + [Range(0, 1), Tooltip("Controls the smoothness of the decal.")] + public float smoothness = 0.0f; + } + + public class BlendSourcesProperties + { + [Tooltip("Specifies the source this Material uses as opacity for its Normal Map."), Range(0,1)] + public int maskBlendSrc = 0; + } + + protected override IEnumerable inputProperties + { + get + { + var properties = base.inputProperties; + //properties = properties.Concat(PropertiesFromType("BlendSourcesProperties")); + return properties; + } + } + + protected override IEnumerable filteredOutSettings + { + get + { + foreach (var setting in base.filteredOutSettings) + yield return setting; + + yield return "cullMode"; + yield return "blendMode"; + yield return "useAlphaClipping"; + yield return "doubleSided"; + yield return "shaderGraph"; + yield return "zTestMode"; + yield return "zWriteMode"; + } + } + + public override IEnumerable additionalDefines + { + get + { + foreach (var def in base.additionalDefines) + yield return def; + if (maskOpacityChannel == BlendSource.BaseColorMapAlpha) + { + yield return "VFX_MASK_BLEND_BASE_COLOR_ALPHA"; + } + else + { + yield return "VFX_MASK_BLEND_MASK_BLUE"; + } + if (normalOpacityChannel == BlendSource.BaseColorMapAlpha) + { + yield return "VFX_NORMAL_BLEND_BASE_COLOR_ALPHA"; + } + else + { + yield return "VFX_NORMAL_BLEND_MASK_BLUE"; + } + } + } + + public override VFXExpressionMapper GetExpressionMapper(VFXDeviceTarget target) + { + var mapper = base.GetExpressionMapper(target); + + //if (target == VFXDeviceTarget.GPU) + //{ + // mapper.AddExpression(VFXValue.Constant((int)normalOpacityChannel), "normalBlendSrc", -1); + // mapper.AddExpression(VFXValue.Constant((int)maskOpacityChannel), "maskBlendSrc", -1); + //} + + return mapper; + } + } +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs.meta new file mode 100644 index 00000000000..cd72a3aca28 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e68693b8b943efc4488917ca7c41f0b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template new file mode 100644 index 00000000000..65ff8d70aa5 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -0,0 +1,182 @@ +Pass +{ + Name "DBufferMesh" + Tags {"LightMode"="DBufferMesh"} + + + Cull Front + ZWrite Off + ZTest Greater + + // using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html + Blend 0 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha + Blend 1 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha + Blend 2 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha + Blend 3 Zero OneMinusSrcColor + + // ColorMask [_DecalColorMask0] + // ColorMask [_DecalColorMask1] 1 + // ColorMask [_DecalColorMask2] 2 + // ColorMask [_DecalColorMask3] 3 + + HLSLPROGRAM + #pragma target 4.5 + #pragma multi_compile _ LIGHT_LAYERS + #pragma multi_compile _ DEBUG_DISPLAY + + #define UNITY_MATERIAL_LIT + + ${VFXIncludeRP("VFXLitVaryings.template")} + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" + struct ps_input + { + float4 pos : SV_POSITION; + + ${VFXHDRPLitDeclareVaryings} + + float2 uv : TEXCOORD1; + float3 posWS : TEXCOORD2; + float4 sphereInfo : TEXCOORD3; + + nointerpolation float4 viewToDecal0 : TEXCOORD4; + nointerpolation float4 viewToDecal1 : TEXCOORD5; + nointerpolation float4 viewToDecal2 : TEXCOORD6; + + UNITY_VERTEX_OUTPUT_STEREO + }; + + ${VFXHDRPLitVaryingsMacros} + + #define VFX_VARYING_PS_INPUTS ps_input + #define VFX_VARYING_POSCS pos + #define VFX_VARYING_UV uv + #define VFX_VARYING_POSWS posWS + + ${VFXBegin:VFXVertexAdditionalProcess} + float4x4 viewToDecal = GetVFXToElementMatrix( + attributes.axisX, + attributes.axisY, + attributes.axisZ, + float3(attributes.angleX,attributes.angleY,attributes.angleZ), + float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), + size3, + attributes.position); + + #if VFX_LOCAL_SPACE + viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); + #endif + viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); + o.viewToDecal0 = viewToDecal[0]; + o.viewToDecal1 = viewToDecal[1]; + o.viewToDecal2 = viewToDecal[2]; + + ${VFXHDRPLitFillVaryings} + ${VFXEnd} + + +//TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one +${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} +#define SHADERPASS SHADERPASS_VFX_DBUFFER_PROJECTOR +${VFXIncludeRP("VFXLit.template")} + +//TODO : Move that to a header (new or existing one) +#define VFXComputePixelOutputToDBuffer(i, normalWS,outDBuffer) \ +{ \ + DecalSurfaceData surfaceData; \ + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); \ + VFXGetSurfaceDecalData(surfaceData,i,normalWS); \ + \ + ENCODE_INTO_DBUFFER(surfaceData, outDBuffer); \ +} + +void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INPUTS i, float3 normalWS) +{ + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); + VFXTransformPSInputs(i); + + float3 clipPos; + clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; + clipPos.z = VFXSampleDepth(i.pos); + clipPos *= VFXLinearEyeDepth(clipPos.z); + + + float4 worldPos; + worldPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; + worldPos.y = clipPos.y / -UNITY_MATRIX_P[1][1]; + worldPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; + worldPos.w = 1.0f; + //Assumes worldPos is ViewPos ? + float4x4 viewToElement; + viewToElement[0] = i.viewToDecal0; + viewToElement[1] = i.viewToDecal1; + viewToElement[2] = i.viewToDecal2; + viewToElement[3] = float4(0,0,0,1); + + float3 elementPos = mul(viewToElement,worldPos).xyz * 2.0f; + clip(1.0f - abs(elementPos)); + + float2 uv = elementPos.xy * 0.5f + 0.5f; + VFXUVData uvData = GetUVData(uv); + + float4 color = float4(1,1,1,1); + #if HDRP_USE_BASE_COLOR + color *= VFXGetParticleColor(i); + #elif HDRP_USE_ADDITIONAL_BASE_COLOR + #if defined(VFX_VARYING_COLOR) + color.xyz *= i.VFX_VARYING_COLOR; + #endif + #if defined(VFX_VARYING_ALPHA) + color.a *= i.VFX_VARYING_ALPHA; + #endif + #endif + #if HDRP_USE_BASE_COLOR_MAP + float4 colorMap = SampleTexture(VFX_SAMPLER(baseColorMap),uvData); + #if HDRP_USE_BASE_COLOR_MAP_COLOR + color.xyz *= colorMap.xyz; + #endif + #if HDRP_USE_BASE_COLOR_MAP_ALPHA + color.a *= colorMap.a; + #endif + #endif + float fadeFactor = 1.0f; + color.a *= fadeFactor; + VFXClipFragmentColor(color.a,i); + surfaceData.baseColor.rgb = saturate(color.rgb); + surfaceData.baseColor.a = color.a; + + float albedoMapBlend = surfaceData.baseColor.a; + float maskMapBlend = fadeFactor; + + #if HDRP_USE_MASK_MAP + float4 mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); + surfaceData.mask = mask; + surfaceData.mask.z = surfaceData.mask.w; + maskMapBlend = mask.z; + #if VFX_MASK_BLEND_BASE_COLOR_ALPHA + surfaceData.mask.w = albedoMapBlend; + #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity + surfaceData.mask.w = maskMapBlend; + #endif + + #endif + + float3 normalTS = UnpackNormalmapRGorAG(SampleTexture(VFX_SAMPLER(normalMap), uvData)); + surfaceData.normalWS.xyz = mul((float3x3)viewToElement, normalTS); //TODO : do proper inverse transform + #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA + surfaceData.normalWS.w = albedoMapBlend; + #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; + surfaceData.normalWS.w = maskMapBlend; + #endif +} + +//EndTODO + + #pragma fragment frag + void frag(ps_input i, OUTPUT_DBUFFER(outDBuffer)) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + float3 normalWS = float3(0,1,0); //TODO : compute it properly + VFXComputePixelOutputToDBuffer(i, normalWS,outDBuffer); + } + ENDHLSL +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template.meta new file mode 100644 index 00000000000..e65b680fe69 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 392619956e8f3ad4ead44958d5c47f1e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template new file mode 100644 index 00000000000..4721bde12fe --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template @@ -0,0 +1,11 @@ +{ + SubShader + { + Cull Back + + ${VFXInclude("Shaders/VFXParticleHeader.template")} + ${VFXInclude("Shaders/ParticleHexahedron/PassSelection.template")} + ${VFXIncludeRP("Templates/HDRPDecal/PassDBuffer.template")} + + } +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template.meta new file mode 100644 index 00000000000..7daea066a06 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 451275ad08e3d614fb837879e7148b52 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 077daa396ee78f27c1b8a6c5db3ed23a5d48cde8 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 12 May 2021 14:45:00 +0200 Subject: [PATCH 02/66] First attempt at factorizing a little + forward emissive --- .../Templates/HDRPDecal/PassDBuffer.template | 101 +---------- .../HDRPDecal/PassForwardEmissive.template | 98 +++++++++++ .../PassForwardEmissive.template.meta | 7 + .../Templates/VFXParticleHDRPDecal.template | 2 + .../Editor/VFXGraph/Shaders/VFXDecal.template | 158 ++++++++++++++++++ 5 files changed, 271 insertions(+), 95 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template.meta create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 65ff8d70aa5..5244415869e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -8,11 +8,6 @@ Pass ZWrite Off ZTest Greater - // using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html - Blend 0 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha - Blend 1 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha - Blend 2 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha - Blend 3 Zero OneMinusSrcColor // ColorMask [_DecalColorMask0] // ColorMask [_DecalColorMask1] 1 @@ -28,6 +23,10 @@ Pass ${VFXIncludeRP("VFXLitVaryings.template")} #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + + + struct ps_input { float4 pos : SV_POSITION; @@ -73,101 +72,13 @@ Pass ${VFXHDRPLitFillVaryings} ${VFXEnd} - + //TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one ${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #define SHADERPASS SHADERPASS_VFX_DBUFFER_PROJECTOR -${VFXIncludeRP("VFXLit.template")} - -//TODO : Move that to a header (new or existing one) -#define VFXComputePixelOutputToDBuffer(i, normalWS,outDBuffer) \ -{ \ - DecalSurfaceData surfaceData; \ - ZERO_INITIALIZE(DecalSurfaceData, surfaceData); \ - VFXGetSurfaceDecalData(surfaceData,i,normalWS); \ - \ - ENCODE_INTO_DBUFFER(surfaceData, outDBuffer); \ -} +${VFXIncludeRP("VFXDecal.template")} -void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INPUTS i, float3 normalWS) -{ - ZERO_INITIALIZE(DecalSurfaceData, surfaceData); - VFXTransformPSInputs(i); - - float3 clipPos; - clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; - clipPos.z = VFXSampleDepth(i.pos); - clipPos *= VFXLinearEyeDepth(clipPos.z); - - float4 worldPos; - worldPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; - worldPos.y = clipPos.y / -UNITY_MATRIX_P[1][1]; - worldPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; - worldPos.w = 1.0f; - //Assumes worldPos is ViewPos ? - float4x4 viewToElement; - viewToElement[0] = i.viewToDecal0; - viewToElement[1] = i.viewToDecal1; - viewToElement[2] = i.viewToDecal2; - viewToElement[3] = float4(0,0,0,1); - - float3 elementPos = mul(viewToElement,worldPos).xyz * 2.0f; - clip(1.0f - abs(elementPos)); - - float2 uv = elementPos.xy * 0.5f + 0.5f; - VFXUVData uvData = GetUVData(uv); - - float4 color = float4(1,1,1,1); - #if HDRP_USE_BASE_COLOR - color *= VFXGetParticleColor(i); - #elif HDRP_USE_ADDITIONAL_BASE_COLOR - #if defined(VFX_VARYING_COLOR) - color.xyz *= i.VFX_VARYING_COLOR; - #endif - #if defined(VFX_VARYING_ALPHA) - color.a *= i.VFX_VARYING_ALPHA; - #endif - #endif - #if HDRP_USE_BASE_COLOR_MAP - float4 colorMap = SampleTexture(VFX_SAMPLER(baseColorMap),uvData); - #if HDRP_USE_BASE_COLOR_MAP_COLOR - color.xyz *= colorMap.xyz; - #endif - #if HDRP_USE_BASE_COLOR_MAP_ALPHA - color.a *= colorMap.a; - #endif - #endif - float fadeFactor = 1.0f; - color.a *= fadeFactor; - VFXClipFragmentColor(color.a,i); - surfaceData.baseColor.rgb = saturate(color.rgb); - surfaceData.baseColor.a = color.a; - - float albedoMapBlend = surfaceData.baseColor.a; - float maskMapBlend = fadeFactor; - - #if HDRP_USE_MASK_MAP - float4 mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); - surfaceData.mask = mask; - surfaceData.mask.z = surfaceData.mask.w; - maskMapBlend = mask.z; - #if VFX_MASK_BLEND_BASE_COLOR_ALPHA - surfaceData.mask.w = albedoMapBlend; - #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity - surfaceData.mask.w = maskMapBlend; - #endif - - #endif - - float3 normalTS = UnpackNormalmapRGorAG(SampleTexture(VFX_SAMPLER(normalMap), uvData)); - surfaceData.normalWS.xyz = mul((float3x3)viewToElement, normalTS); //TODO : do proper inverse transform - #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA - surfaceData.normalWS.w = albedoMapBlend; - #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; - surfaceData.normalWS.w = maskMapBlend; - #endif -} //EndTODO diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template new file mode 100644 index 00000000000..334dea85d2e --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -0,0 +1,98 @@ +Pass +{ + Name "DecalMeshForwardEmissive" + Tags {"LightMode"="DecalMeshForwardEmissive"} + + + ZWrite Off + ZTest LEqual + + Blend 0 SrcAlpha One + + // ColorMask [_DecalColorMask0] + // ColorMask [_DecalColorMask1] 1 + // ColorMask [_DecalColorMask2] 2 + // ColorMask [_DecalColorMask3] 3 + + HLSLPROGRAM + #pragma target 4.5 + #pragma multi_compile _ LIGHT_LAYERS + #pragma multi_compile _ DEBUG_DISPLAY + + #define UNITY_MATERIAL_LIT + + ${VFXIncludeRP("VFXLitVaryings.template")} + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + + + + struct ps_input + { + float4 pos : SV_POSITION; + + ${VFXHDRPLitDeclareVaryings} + + float2 uv : TEXCOORD1; + float3 posWS : TEXCOORD2; + float4 sphereInfo : TEXCOORD3; + + nointerpolation float4 viewToDecal0 : TEXCOORD4; + nointerpolation float4 viewToDecal1 : TEXCOORD5; + nointerpolation float4 viewToDecal2 : TEXCOORD6; + + UNITY_VERTEX_OUTPUT_STEREO + }; + + ${VFXHDRPLitVaryingsMacros} + + #define VFX_VARYING_PS_INPUTS ps_input + #define VFX_VARYING_POSCS pos + #define VFX_VARYING_UV uv + #define VFX_VARYING_POSWS posWS + + ${VFXBegin:VFXVertexAdditionalProcess} + float4x4 viewToDecal = GetVFXToElementMatrix( + attributes.axisX, + attributes.axisY, + attributes.axisZ, + float3(attributes.angleX,attributes.angleY,attributes.angleZ), + float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), + size3, + attributes.position); + + #if VFX_LOCAL_SPACE + viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); + #endif + viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); + o.viewToDecal0 = viewToDecal[0]; + o.viewToDecal1 = viewToDecal[1]; + o.viewToDecal2 = viewToDecal[2]; + + ${VFXHDRPLitFillVaryings} + ${VFXEnd} + + +//TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one +${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} +#define SHADERPASS SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE +${VFXIncludeRP("VFXDecal.template")} + + + + +//EndTODO + + #pragma fragment frag + void frag(ps_input i, out float4 outEmissive : SV_Target0) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + float3 normalWS = float3(0,1,0); //TODO : useless + DecalSurfaceData surfaceData; + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); + VFXGetSurfaceDecalData(surfaceData,i,normalWS); + outEmissive.rgb = surfaceData.emissive; + outEmissive.a = 1.0f; + } + ENDHLSL +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template.meta new file mode 100644 index 00000000000..85b8e40f8c5 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d45c2e26ce8297e40860000afb8775c1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template index 4721bde12fe..d89fd6c15b1 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template @@ -6,6 +6,8 @@ ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXInclude("Shaders/ParticleHexahedron/PassSelection.template")} ${VFXIncludeRP("Templates/HDRPDecal/PassDBuffer.template")} + ${VFXIncludeRP("Templates/HDRPDecal/PassForwardEmissive.template")} + } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template new file mode 100644 index 00000000000..55f22c08aa6 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -0,0 +1,158 @@ +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXLit.hlsl" + + ${VFXBegin:VFXVertexAdditionalProcess} + float4x4 viewToDecal = GetVFXToElementMatrix( + attributes.axisX, + attributes.axisY, + attributes.axisZ, + float3(attributes.angleX,attributes.angleY,attributes.angleZ), + float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), + size3, + attributes.position); + + #if VFX_LOCAL_SPACE + viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); + #endif + viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); + o.viewToDecal0 = viewToDecal[0]; + o.viewToDecal1 = viewToDecal[1]; + o.viewToDecal2 = viewToDecal[2]; + + ${VFXHDRPLitFillVaryings} + ${VFXEnd} + +//TODO : Check for unnecessary includes / and for necessary ones +#define VFXComputePixelOutputToDBuffer(i, normalWS,outDBuffer) \ +{ \ + DecalSurfaceData surfaceData; \ + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); \ + VFXGetSurfaceDecalData(surfaceData,i,normalWS); \ + \ + ENCODE_INTO_DBUFFER(surfaceData, outDBuffer); \ +} + +void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INPUTS i, float3 normalWS) +{ + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); + VFXTransformPSInputs(i); + +//Check light layer +#if VFX_ENABLE_DECAL_LAYERS + DecalPrepassData material; + ZERO_INITIALIZE(DecalPrepassData, material); + // Clip the decal if it does not pass the decal layer mask of the receiving material. + // Decal layer of the decal + uint decalLayerMask = 1; //TODO : Decide how to pass the decal layer + retrieve it + + DecodeFromDecalPrepass(i.pos.xy, material); + + if ((decalLayerMask & material.decalLayerMask) == 0) + { + clip(-1); + } + +#endif + + float3 clipPos; + clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; + clipPos.z = VFXSampleDepth(i.pos); + clipPos *= VFXLinearEyeDepth(clipPos.z); + + float4 worldPos; + worldPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; + worldPos.y = clipPos.y / -UNITY_MATRIX_P[1][1]; + worldPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; + worldPos.w = 1.0f; + //Assumes worldPos is ViewPos ? + float4x4 viewToElement; + viewToElement[0] = i.viewToDecal0; + viewToElement[1] = i.viewToDecal1; + viewToElement[2] = i.viewToDecal2; + viewToElement[3] = float4(0,0,0,1); + + float3 elementPos = mul(viewToElement,worldPos).xyz * 2.0f; + clip(1.0f - abs(elementPos)); + + float2 uv = elementPos.xy * 0.5f + 0.5f; + VFXUVData uvData = GetUVData(uv); + float angleFadeFactor = 1.0f; + float3x3 elementToWorld = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //TODO: Won't be correct for non-uniform scalings + elementToWorld[2] *= -1.0f; //TODO : Why ? + +#if VFX_ENABLE_DECAL_LAYERS + if (angleFade.y < 0.0f) // if angle fade is enabled + { + float3 decalNormal = normalize(elementToWorld[2].xyz); + float dotAngle = dot(material.geomNormalWS, decalNormal); + // See equation in DecalSystem.cs - simplified to a madd mul add here + angleFadeFactor = saturate(angleFade.x + angleFade.y * (dotAngle * (dotAngle - 2.0f))); + } +#endif + + fadeFactor *= angleFadeFactor; + #if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR + + float4 color = float4(1,1,1,1); + #if HDRP_USE_BASE_COLOR + color *= VFXGetParticleColor(i); + #elif HDRP_USE_ADDITIONAL_BASE_COLOR + #if defined(VFX_VARYING_COLOR) + color.xyz *= i.VFX_VARYING_COLOR; + #endif + #if defined(VFX_VARYING_ALPHA) + color.a *= i.VFX_VARYING_ALPHA; + #endif + #endif + #if HDRP_USE_BASE_COLOR_MAP + float4 colorMap = SampleTexture(VFX_SAMPLER(baseColorMap),uvData); + #if HDRP_USE_BASE_COLOR_MAP_COLOR + color.xyz *= colorMap.xyz; + #endif + #if HDRP_USE_BASE_COLOR_MAP_ALPHA + color.a *= colorMap.a; + #endif + #endif + color.a *= fadeFactor; + VFXClipFragmentColor(color.a,i); + surfaceData.baseColor.rgb = saturate(color.rgb); + surfaceData.baseColor.a = color.a; + + float albedoMapBlend = surfaceData.baseColor.a; + float maskMapBlend = fadeFactor; + + #if HDRP_USE_MASK_MAP + float4 mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); + surfaceData.mask = mask; + surfaceData.mask.z = surfaceData.mask.w; + maskMapBlend = mask.z * fadeFactor; + #if VFX_MASK_BLEND_BASE_COLOR_ALPHA + surfaceData.mask.w = albedoMapBlend; + #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity + surfaceData.mask.w = maskMapBlend; + #endif + + #endif + + float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); + normalWS = normalize(mul(transpose(elementToWorld), normalTS)); + + surfaceData.normalWS.xyz = normalWS; + #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA + surfaceData.normalWS.w = albedoMapBlend; + #elif VFX_NORMAL_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; + surfaceData.normalWS.w = maskMapBlend; + #endif + + surfaceData.MAOSBlend.xy = float2(surfaceData.mask.w, surfaceData.mask.w); + #endif + #if SHADERPASS == SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE + #if defined(VFX_VARYING_EMISSIVE) + surfaceData.emissive = i.VFX_VARYING_EMISSIVE * fadeFactor; // Handle Exposure + #endif + #endif + + +} + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXLitPixelOutput.hlsl" + From f9fdd0d9b8bbb230988067f354932c25300cb89a Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 12 May 2021 14:50:27 +0200 Subject: [PATCH 03/66] Decal layers in output context --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 78 +++++++++++++++---- 1 file changed, 63 insertions(+), 15 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 455fed5280a..7282f7df62f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -4,13 +4,14 @@ using UnityEditor.VFX.Block; using UnityEngine; using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.VFX; namespace UnityEditor.VFX { [VFXInfo(experimental = true)] class VFXDecalHDRPOutput : VFXAbstractParticleHDRPLitOutput { - public override string name { get { return "Output Particle HDRP Decal"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleHDRPDecal"); } } public override VFXTaskType taskType { get { return VFXTaskType.ParticleHexahedronOutput; } } @@ -47,9 +48,21 @@ public enum BlendSource } [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Normal Map.")] BlendSource normalOpacityChannel = BlendSource.BaseColorMapAlpha; + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Mask Map.")] BlendSource maskOpacityChannel = BlendSource.BaseColorMapAlpha; + private bool enableDecalLayers => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals + && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers; + + string[] decalLayerNames => HDRenderPipelineGlobalSettings.instance.decalLayerNames; + + + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + Tooltip("Specifies the layer mask of the decal.")] + private DecalLayerEnum decalLayer = DecalLayerEnum.LightLayerDefault; + public class NoMaskMapProperties { [Range(0, 1), Tooltip("Controls the metallic of the decal.")] @@ -60,10 +73,12 @@ public class NoMaskMapProperties public float smoothness = 0.0f; } - public class BlendSourcesProperties + public class FadingProperties { - [Tooltip("Specifies the source this Material uses as opacity for its Normal Map."), Range(0,1)] - public int maskBlendSrc = 0; + [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? + public Vector2 angleFade = Vector2.zero; + [Range(0, 1), Tooltip("Fade Factor.")] + public float fadeFactor = 0.0f; } protected override IEnumerable inputProperties @@ -71,11 +86,37 @@ protected override IEnumerable inputProperties get { var properties = base.inputProperties; - //properties = properties.Concat(PropertiesFromType("BlendSourcesProperties")); + properties = properties.Concat(PropertiesFromType("FadingProperties")); return properties; } } + protected override IEnumerable CollectGPUExpressions(IEnumerable slotExpressions) + { + foreach (var exp in base.CollectGPUExpressions(slotExpressions)) + yield return exp; + + if (GetOrRefreshShaderGraphObject() == null) + { + //yield return slotExpressions.First(o => o.name == "startFade"); + yield return slotExpressions.First(o => o.name == "fadeFactor"); + var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); + yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); + } + } + + VFXExpression AngleFadeSimplification(VFXExpression angleFadeExp) + { + angleFadeExp = angleFadeExp / VFXValue.Constant(new Vector2(180.0f,180.0f)); + var angleStart = new VFXExpressionExtractComponent(angleFadeExp, 0); + var angleEnd = new VFXExpressionExtractComponent(angleFadeExp, 1); + var range = new VFXExpressionMax(VFXValue.Constant(0.0001f), angleEnd - angleStart); + var simplifiedAngleFade = new VFXExpressionCombine( + VFXValue.Constant(1.0f) - (VFXValue.Constant(0.25f) - angleStart) / range, + VFXValue.Constant(-0.25f)/ range); + return simplifiedAngleFade; + } + protected override IEnumerable filteredOutSettings { get @@ -90,6 +131,9 @@ protected override IEnumerable filteredOutSettings yield return "shaderGraph"; yield return "zTestMode"; yield return "zWriteMode"; + + if (!enableDecalLayers) + yield return "decalLayer"; } } @@ -115,20 +159,24 @@ public override IEnumerable additionalDefines { yield return "VFX_NORMAL_BLEND_MASK_BLUE"; } + + if(enableDecalLayers) + { + yield return "VFX_ENABLE_DECAL_LAYERS"; + } + yield return "VFX_ENABLE_DECAL_LAYERS"; } } - public override VFXExpressionMapper GetExpressionMapper(VFXDeviceTarget target) - { - var mapper = base.GetExpressionMapper(target); - - //if (target == VFXDeviceTarget.GPU) - //{ - // mapper.AddExpression(VFXValue.Constant((int)normalOpacityChannel), "normalBlendSrc", -1); - // mapper.AddExpression(VFXValue.Constant((int)maskOpacityChannel), "maskBlendSrc", -1); - //} - return mapper; + protected override void WriteBlendMode(VFXShaderWriter writer) + { + // using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html + for (int i = 0; i < 3; i++) + { + writer.WriteLineFormat("Blend {0} SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha", i); + } + writer.WriteLine("Blend 3 Zero OneMinusSrcColor"); } } } From 0b3004acfa8298d454f9c48268a267fb90e46623 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 14 May 2021 09:23:11 +0200 Subject: [PATCH 04/66] Fix compilation with new master --- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 7282f7df62f..5ed87d131c0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -7,7 +7,7 @@ using UnityEngine.Rendering.HighDefinition; using UnityEngine.VFX; -namespace UnityEditor.VFX +namespace UnityEditor.VFX.HDRP { [VFXInfo(experimental = true)] class VFXDecalHDRPOutput : VFXAbstractParticleHDRPLitOutput @@ -100,14 +100,17 @@ protected override IEnumerable CollectGPUExpressions(IEnumer { //yield return slotExpressions.First(o => o.name == "startFade"); yield return slotExpressions.First(o => o.name == "fadeFactor"); - var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); - yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); + if(enableDecalLayers) + { + var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); + yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); + } } } VFXExpression AngleFadeSimplification(VFXExpression angleFadeExp) { - angleFadeExp = angleFadeExp / VFXValue.Constant(new Vector2(180.0f,180.0f)); + angleFadeExp = angleFadeExp / VFXValue.Constant(new Vector2(180.0f,180.0f)); var angleStart = new VFXExpressionExtractComponent(angleFadeExp, 0); var angleEnd = new VFXExpressionExtractComponent(angleFadeExp, 1); var range = new VFXExpressionMax(VFXValue.Constant(0.0001f), angleEnd - angleStart); From 8886fe7fd7667625ad229174fa15bd560756ee31 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 14 May 2021 18:35:48 +0200 Subject: [PATCH 05/66] Decal Layers enabled --- .../Templates/HDRPDecal/PassDBuffer.template | 22 +++-- .../HDRPDecal/PassForwardEmissive.template | 31 ++++--- .../Editor/VFXGraph/Shaders/VFXDecal.template | 89 ++++++++++--------- .../VFXGraph/Shaders/VFXDecal.template.meta | 7 ++ .../Runtime/Material/Decal/DecalSystem.cs | 1 + 5 files changed, 89 insertions(+), 61 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 5244415869e..31447948f38 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -26,20 +26,22 @@ Pass #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" - struct ps_input { float4 pos : SV_POSITION; ${VFXHDRPLitDeclareVaryings} - float2 uv : TEXCOORD1; + float2 uv : TEXCOORD1; //unsure about the necessity of this one float3 posWS : TEXCOORD2; - float4 sphereInfo : TEXCOORD3; + #if VFX_ENABLE_DECAL_LAYERS + float3 fadeParameters : TEXCOORD3; + uint decalLayerMask : TEXCOORD4; + #endif - nointerpolation float4 viewToDecal0 : TEXCOORD4; - nointerpolation float4 viewToDecal1 : TEXCOORD5; - nointerpolation float4 viewToDecal2 : TEXCOORD6; + nointerpolation float4 viewToDecal0 : TEXCOORD5; + nointerpolation float4 viewToDecal1 : TEXCOORD6; + nointerpolation float4 viewToDecal2 : TEXCOORD7; UNITY_VERTEX_OUTPUT_STEREO }; @@ -49,7 +51,13 @@ Pass #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv - #define VFX_VARYING_POSWS posWS + #define VFX_VARYING_POSWS posWS + #define VFX_VARYING_FADEFACTOR fadeParameters.z + #if VFX_ENABLE_DECAL_LAYERS + #define VFX_VARYING_ANGLEFADE fadeParameters.xy + #define VFX_VARYING_DECALLAYER decalLayerMask + #endif + ${VFXBegin:VFXVertexAdditionalProcess} float4x4 viewToDecal = GetVFXToElementMatrix( diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index 334dea85d2e..420e02a78e0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -8,12 +8,7 @@ Pass ZTest LEqual Blend 0 SrcAlpha One - - // ColorMask [_DecalColorMask0] - // ColorMask [_DecalColorMask1] 1 - // ColorMask [_DecalColorMask2] 2 - // ColorMask [_DecalColorMask3] 3 - + HLSLPROGRAM #pragma target 4.5 #pragma multi_compile _ LIGHT_LAYERS @@ -33,13 +28,16 @@ Pass ${VFXHDRPLitDeclareVaryings} - float2 uv : TEXCOORD1; + float2 uv : TEXCOORD1; //unsure about the necessity of this one float3 posWS : TEXCOORD2; - float4 sphereInfo : TEXCOORD3; + #if VFX_ENABLE_DECAL_LAYERS + float3 fadeParameters : TEXCOORD3; + uint decalLayerMask : TEXCOORD4; + #endif - nointerpolation float4 viewToDecal0 : TEXCOORD4; - nointerpolation float4 viewToDecal1 : TEXCOORD5; - nointerpolation float4 viewToDecal2 : TEXCOORD6; + nointerpolation float4 viewToDecal0 : TEXCOORD5; + nointerpolation float4 viewToDecal1 : TEXCOORD6; + nointerpolation float4 viewToDecal2 : TEXCOORD7; UNITY_VERTEX_OUTPUT_STEREO }; @@ -49,7 +47,13 @@ Pass #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv - #define VFX_VARYING_POSWS posWS + #define VFX_VARYING_POSWS posWS + #define VFX_VARYING_FADEFACTOR fadeParameters.z + #if VFX_ENABLE_DECAL_LAYERS + #define VFX_VARYING_ANGLEFADE fadeParameters.xy + #define VFX_VARYING_DECALLAYER decalLayerMask + #endif + ${VFXBegin:VFXVertexAdditionalProcess} float4x4 viewToDecal = GetVFXToElementMatrix( @@ -68,6 +72,7 @@ Pass o.viewToDecal0 = viewToDecal[0]; o.viewToDecal1 = viewToDecal[1]; o.viewToDecal2 = viewToDecal[2]; + //Move this somewhere else ${VFXHDRPLitFillVaryings} ${VFXEnd} @@ -91,7 +96,7 @@ ${VFXIncludeRP("VFXDecal.template")} DecalSurfaceData surfaceData; ZERO_INITIALIZE(DecalSurfaceData, surfaceData); VFXGetSurfaceDecalData(surfaceData,i,normalWS); - outEmissive.rgb = surfaceData.emissive; + outEmissive.rgb = surfaceData.emissive * GetCurrentExposureMultiplier(); outEmissive.a = 1.0f; } ENDHLSL diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 55f22c08aa6..707461bc36d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -1,25 +1,3 @@ -#include "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXLit.hlsl" - - ${VFXBegin:VFXVertexAdditionalProcess} - float4x4 viewToDecal = GetVFXToElementMatrix( - attributes.axisX, - attributes.axisY, - attributes.axisZ, - float3(attributes.angleX,attributes.angleY,attributes.angleZ), - float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), - size3, - attributes.position); - - #if VFX_LOCAL_SPACE - viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); - #endif - viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); - o.viewToDecal0 = viewToDecal[0]; - o.viewToDecal1 = viewToDecal[1]; - o.viewToDecal2 = viewToDecal[2]; - - ${VFXHDRPLitFillVaryings} - ${VFXEnd} //TODO : Check for unnecessary includes / and for necessary ones #define VFXComputePixelOutputToDBuffer(i, normalWS,outDBuffer) \ @@ -42,7 +20,7 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP ZERO_INITIALIZE(DecalPrepassData, material); // Clip the decal if it does not pass the decal layer mask of the receiving material. // Decal layer of the decal - uint decalLayerMask = 1; //TODO : Decide how to pass the decal layer + retrieve it + uint decalLayerMask = i.VFX_VARYING_DECALLAYER; //TODO : Does it really need to be a Varying ? Can't I use VFXLoadParameter here ? DecodeFromDecalPrepass(i.pos.xy, material); @@ -56,39 +34,52 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP float3 clipPos; clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; clipPos.z = VFXSampleDepth(i.pos); - clipPos *= VFXLinearEyeDepth(clipPos.z); - - float4 worldPos; - worldPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; - worldPos.y = clipPos.y / -UNITY_MATRIX_P[1][1]; - worldPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; - worldPos.w = 1.0f; - //Assumes worldPos is ViewPos ? + clipPos *= VFXLinearEyeDepth(clipPos.z); //TODO: Does not work with Orthographic projection, do it. + if (_ProjectionParams.x < 0) + clipPos.y = -clipPos.y; + + float4 viewPos; + + if(IsPerspectiveProjection()) + { + viewPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; + viewPos.y = clipPos.y / UNITY_MATRIX_P[1][1]; + viewPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; + viewPos.w = 1.0f ; + } + else + { + viewPos.x = (clipPos.x - UNITY_MATRIX_P[0][3]) / UNITY_MATRIX_P[0][0]; + viewPos.y = (clipPos.y - UNITY_MATRIX_P[1][3]) / UNITY_MATRIX_P[1][1]; + viewPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; + viewPos.w = 1.0f; + } + float4x4 viewToElement; viewToElement[0] = i.viewToDecal0; viewToElement[1] = i.viewToDecal1; viewToElement[2] = i.viewToDecal2; viewToElement[3] = float4(0,0,0,1); - float3 elementPos = mul(viewToElement,worldPos).xyz * 2.0f; + float3 elementPos = mul(viewToElement,viewPos).xyz * 2.0f; clip(1.0f - abs(elementPos)); float2 uv = elementPos.xy * 0.5f + 0.5f; VFXUVData uvData = GetUVData(uv); float angleFadeFactor = 1.0f; - float3x3 elementToWorld = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //TODO: Won't be correct for non-uniform scalings + float3x3 elementToWorld = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //Transposed//TODO: Won't be correct for non-uniform scalings elementToWorld[2] *= -1.0f; //TODO : Why ? #if VFX_ENABLE_DECAL_LAYERS - if (angleFade.y < 0.0f) // if angle fade is enabled + if (i.VFX_VARYING_ANGLEFADE.y < 0.0f) // if angle fade is enabled { float3 decalNormal = normalize(elementToWorld[2].xyz); float dotAngle = dot(material.geomNormalWS, decalNormal); // See equation in DecalSystem.cs - simplified to a madd mul add here - angleFadeFactor = saturate(angleFade.x + angleFade.y * (dotAngle * (dotAngle - 2.0f))); + angleFadeFactor = saturate(i.VFX_VARYING_ANGLEFADE.x + i.VFX_VARYING_ANGLEFADE.y * (dotAngle * (dotAngle - 2.0f))); } #endif - + float fadeFactor = i.VFX_VARYING_FADEFACTOR; fadeFactor *= angleFadeFactor; #if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR @@ -133,7 +124,11 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP #endif + #if USE_NORMAL_MAP float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); + #else + float3 normalTS = float3(0.0f,0.0f,1.0f); + #endif normalWS = normalize(mul(transpose(elementToWorld), normalTS)); surfaceData.normalWS.xyz = normalWS; @@ -147,12 +142,24 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP #endif #if SHADERPASS == SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE #if defined(VFX_VARYING_EMISSIVE) - surfaceData.emissive = i.VFX_VARYING_EMISSIVE * fadeFactor; // Handle Exposure + surfaceData.emissive = i.VFX_VARYING_EMISSIVE * fadeFactor; + #endif + #ifdef HDRP_USE_EMISSIVE_MAP + float emissiveScale = 1.0f; + #ifdef VFX_VARYING_EMISSIVESCALE + emissiveScale = i.VFX_VARYING_EMISSIVESCALE; + #endif + surfaceData.emissive *= SampleTexture(VFX_SAMPLER(emissiveMap), uvData).rgb * emissiveScale; + #endif + // Inverse pre-expose using exposureWeight weight + float3 emissiveRcpExposure = surfaceData.emissive * GetInverseCurrentExposureMultiplier(); + #ifdef VFX_VARYING_EXPOSUREWEIGHT + surfaceData.emissive = lerp(emissiveRcpExposure, surfaceData.emissive, i.VFX_VARYING_EXPOSUREWEIGHT); + #elif VFX_BYPASS_EXPOSURE + surfaceData.emissive = lerp(emissiveRcpExposure, surfaceData.emissive, 0.0f); + #else + surfaceData.emissive = lerp(emissiveRcpExposure, surfaceData.emissive, 1.0f); #endif #endif - - } -#include "Packages/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXLitPixelOutput.hlsl" - diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template.meta new file mode 100644 index 00000000000..9d9bc5b58c8 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f6882c7cd9f308f45b344ec12a3e14a7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs index 3696f352e51..0e9ff5179c2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs @@ -7,6 +7,7 @@ namespace UnityEngine.Rendering.HighDefinition { /// Decal Layers. + [Flags] public enum DecalLayerEnum { /// The light will no affect any object. From 757e21f12801af2cee67058ce30c2c844235812a Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 20 May 2021 15:04:48 +0200 Subject: [PATCH 06/66] Fix Orthographic mode --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 11 ++++----- .../Editor/VFXGraph/Shaders/VFXDecal.template | 24 ++++++++++--------- .../Runtime/VFXGraph/Shaders/VFXCommon.hlsl | 10 +++++++- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 5ed87d131c0..6cbe315b16b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -55,10 +55,6 @@ public enum BlendSource private bool enableDecalLayers => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers; - string[] decalLayerNames => HDRenderPipelineGlobalSettings.instance.decalLayerNames; - - - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the layer mask of the decal.")] private DecalLayerEnum decalLayer = DecalLayerEnum.LightLayerDefault; @@ -98,12 +94,12 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (GetOrRefreshShaderGraphObject() == null) { - //yield return slotExpressions.First(o => o.name == "startFade"); yield return slotExpressions.First(o => o.name == "fadeFactor"); if(enableDecalLayers) { var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); + yield return new VFXNamedExpression(VFXValue.Constant((uint)decalLayer), "decalLayerMask"); } } } @@ -134,6 +130,8 @@ protected override IEnumerable filteredOutSettings yield return "shaderGraph"; yield return "zTestMode"; yield return "zWriteMode"; + yield return "castShadows"; + yield return "materialType"; if (!enableDecalLayers) yield return "decalLayer"; @@ -167,12 +165,11 @@ public override IEnumerable additionalDefines { yield return "VFX_ENABLE_DECAL_LAYERS"; } - yield return "VFX_ENABLE_DECAL_LAYERS"; } } - protected override void WriteBlendMode(VFXShaderWriter writer) + protected override void WriteBlendMode(VFXShaderWriter writer) //TODO : Not sure we need to do it here : different for DBuffer and ForwardEmissive pass { // using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html for (int i = 0; i < 3; i++) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 707461bc36d..ec04016f1e5 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -11,7 +11,7 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INPUTS i, float3 normalWS) { - ZERO_INITIALIZE(DecalSurfaceData, surfaceData); + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); VFXTransformPSInputs(i); //Check light layer @@ -28,13 +28,13 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP { clip(-1); } - + #endif float3 clipPos; clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; clipPos.z = VFXSampleDepth(i.pos); - clipPos *= VFXLinearEyeDepth(clipPos.z); //TODO: Does not work with Orthographic projection, do it. + if (_ProjectionParams.x < 0) clipPos.y = -clipPos.y; @@ -42,6 +42,7 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP if(IsPerspectiveProjection()) { + clipPos *= VFXLinearEyeDepth(clipPos.z); //TODO: Does not work with Orthographic projection viewPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; viewPos.y = clipPos.y / UNITY_MATRIX_P[1][1]; viewPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; @@ -55,25 +56,26 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP viewPos.w = 1.0f; } + float4x4 viewToElement; viewToElement[0] = i.viewToDecal0; viewToElement[1] = i.viewToDecal1; viewToElement[2] = i.viewToDecal2; viewToElement[3] = float4(0,0,0,1); - + float3 elementPos = mul(viewToElement,viewPos).xyz * 2.0f; clip(1.0f - abs(elementPos)); float2 uv = elementPos.xy * 0.5f + 0.5f; VFXUVData uvData = GetUVData(uv); float angleFadeFactor = 1.0f; - float3x3 elementToWorld = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //Transposed//TODO: Won't be correct for non-uniform scalings - elementToWorld[2] *= -1.0f; //TODO : Why ? + float3x3 worldToElement = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //Transposed//TODO: Won't be correct for non-uniform scalings + worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it #if VFX_ENABLE_DECAL_LAYERS if (i.VFX_VARYING_ANGLEFADE.y < 0.0f) // if angle fade is enabled { - float3 decalNormal = normalize(elementToWorld[2].xyz); + float3 decalNormal = normalize(worldToElement[2].xyz); float dotAngle = dot(material.geomNormalWS, decalNormal); // See equation in DecalSystem.cs - simplified to a madd mul add here angleFadeFactor = saturate(i.VFX_VARYING_ANGLEFADE.x + i.VFX_VARYING_ANGLEFADE.y * (dotAngle * (dotAngle - 2.0f))); @@ -116,7 +118,7 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP surfaceData.mask = mask; surfaceData.mask.z = surfaceData.mask.w; maskMapBlend = mask.z * fadeFactor; - #if VFX_MASK_BLEND_BASE_COLOR_ALPHA + #if VFX_MASK_BLEND_BASE_COLOR_ALPHA surfaceData.mask.w = albedoMapBlend; #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; @@ -129,10 +131,10 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP #else float3 normalTS = float3(0.0f,0.0f,1.0f); #endif - normalWS = normalize(mul(transpose(elementToWorld), normalTS)); + normalWS = normalize(mul(transpose(worldToElement), normalTS)); - surfaceData.normalWS.xyz = normalWS; - #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA + surfaceData.normalWS.xyz = normalWS; + #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA surfaceData.normalWS.w = albedoMapBlend; #elif VFX_NORMAL_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; surfaceData.normalWS.w = maskMapBlend; diff --git a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl index 836f53ae27d..9c35d2863cd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl @@ -139,7 +139,15 @@ float VFXSampleDepth(float4 posSS) float VFXLinearEyeDepth(float depth) { - return LinearEyeDepth(depth,_ZBufferParams); + if (IsPerspectiveProjection()) + return LinearEyeDepth(depth, _ZBufferParams); + else + { + #if UNITY_REVERSED_Z + depth = 1 - depth; + #endif + return _ProjectionParams.y + depth * (_ProjectionParams.z - _ProjectionParams.y); + } } void VFXApplyShadowBias(inout float4 posCS, inout float3 posWS, float3 normalWS) From dc64a2af0fb6c4323f18aa715b8e3485f04e2dd7 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 21 May 2021 12:10:42 +0200 Subject: [PATCH 07/66] Crashing implem of MinMaxSlider attribute.... --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 2 +- .../Editor/Controls/VFXMinMaxSliderField.cs | 225 ++++++++++++++++++ .../Controls/VFXMinMaxSliderField.cs.meta | 11 + .../Views/Properties/Vector2PropertyRM.cs | 122 ++++++++++ .../Properties/Vector2PropertyRM.cs.meta | 11 + .../Views/Properties/VectorPropertiesRM.cs | 12 - .../Editor/Types/VFXPropertyAttribute.cs | 12 +- .../Editor/Types/VFXTypes.cs | 12 + .../Editor/UIResources/uss/VFXControls.uss | 5 + 9 files changed, 398 insertions(+), 14 deletions(-) create mode 100644 com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs create mode 100644 com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs.meta create mode 100644 com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs create mode 100644 com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 6cbe315b16b..2fe909017fb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -71,7 +71,7 @@ public class NoMaskMapProperties public class FadingProperties { - [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? + [Tooltip("Angle Fade. Between 0 and 180."), MinMax(0,1)] //TODO : create range attribute? public Vector2 angleFade = Vector2.zero; [Range(0, 1), Tooltip("Fade Factor.")] public float fadeFactor = 0.0f; diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs new file mode 100644 index 00000000000..0b1f4608b65 --- /dev/null +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs @@ -0,0 +1,225 @@ +using System; +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor.UIElements; +using System.Collections.Generic; +using System.Linq; + +using Action = System.Action; + +namespace UnityEditor.VFX.UI +{ + class VFXMinMaxSliderField : VisualElement, INotifyValueChanged + { + protected MinMaxSlider m_Slider; + VisualElement m_IndeterminateLabel; + Vector2Field m_Vector2Field; + + + class StartFinishSliderManipulator : Manipulator + { + VFXMinMaxSliderField m_Slider; + bool m_InDrag; + protected override void RegisterCallbacksOnTarget() + { + m_Slider = target.GetFirstOfType(); + + target.RegisterCallback(OnMouseDown, TrickleDown.TrickleDown); + target.RegisterCallback(OnMouseUp, TrickleDown.TrickleDown); + } + + protected override void UnregisterCallbacksFromTarget() + { + target.UnregisterCallback(OnMouseDown, TrickleDown.TrickleDown); + target.UnregisterCallback(OnMouseUp, TrickleDown.TrickleDown); + } + + void OnMouseDown(MouseDownEvent e) + { + target.RegisterCallback(OnMouseMove, TrickleDown.TrickleDown); + } + + void OnMouseMove(MouseMoveEvent e) + { + if (!m_InDrag) + { + m_InDrag = true; + m_Slider.ValueDragStarted(); + target.UnregisterCallback(OnMouseMove, TrickleDown.TrickleDown); //we care only about the first drag event + } + } + + void OnMouseUp(MouseUpEvent e) + { + if (m_InDrag) + m_Slider.ValueDragFinished(); + else + target.UnregisterCallback(OnMouseMove, TrickleDown.TrickleDown); + m_InDrag = false; + } + } + + protected void ValueDragFinished() + { + if (onValueDragFinished != null) + onValueDragFinished(); + } + + protected void ValueDragStarted() + { + if (onValueDragStarted != null) + onValueDragStarted(); + } + + public Action onValueDragFinished; + public Action onValueDragStarted; + + public VFXMinMaxSliderField() + { + AddToClassList("sliderField"); + m_Slider = new MinMaxSlider(0,1, Single.MinValue, 1); + // m_Slider = new MinMaxSlider("Value"); + m_Slider.AddToClassList("textfield"); + m_Slider.RegisterValueChangedCallback(evt => ValueChanged(evt.newValue)); + + m_Vector2Field = new Vector2Field(); + m_Vector2Field.RegisterValueChangedCallback(ValueChanged); + m_Vector2Field.name = "Field"; + + + m_IndeterminateLabel = new Label() + { + name = "indeterminate", + text = VFXControlConstants.indeterminateText + }; + m_IndeterminateLabel.SetEnabled(false); + + Add(m_Slider); + Add(m_Vector2Field); + RegisterCallBack(); + } + protected void RegisterCallBack() + { + (m_Vector2Field as VisualElement).RegisterCallback(OnFocusLost); + + m_Slider.Children().First().AddManipulator(new StartFinishSliderManipulator()); + } + + void OnFocusLost(BlurEvent e) + { + //forward the focus lost event + using (BlurEvent newE = BlurEvent.GetPooled(this, e.relatedTarget, e.direction, panel.focusController)) + { + SendEvent(newE); + } + + e.StopPropagation(); + } + + public Vector2 m_Value; + + public Vector2 value + { + get + { + return m_Value; + } + + set + { + SetValueAndNotify(value); + } + } + + private Vector2 m_Range; + + public Vector2 range + { + get + { + return m_Range; + } + set + { + m_Range = value; + m_IgnoreNotification = true; + if (m_Slider.minValue != m_Range.x || m_Slider.maxValue != m_Range.y) + { + m_Slider.minValue = m_Range.x; + m_Slider.maxValue = m_Range.y; + + m_Slider.value = m_Range; + } + m_IgnoreNotification = false; + } + } + + protected bool m_IgnoreNotification; + + public void SetValueAndNotify(Vector2 newValue) + { + if (!EqualityComparer.Default.Equals(value, newValue)) + { + using (ChangeEvent evt = ChangeEvent.GetPooled(value, newValue)) + { + evt.target = this; + SetValueWithoutNotify(newValue); + SendEvent(evt); + } + } + } + + public void SetValueWithoutNotify(Vector2 newValue) + { + m_IgnoreNotification = true; + m_Value = newValue; + tooltip = newValue.ToString(); + if (!hasFocus) + m_Vector2Field.value = newValue; + m_Slider.value = value; + m_IgnoreNotification = false; + } + + protected void ValueChanged(ChangeEvent e) + { + e.StopPropagation(); + if (!m_IgnoreNotification) + SetValueAndNotify(e.newValue); + } + void ValueChanged(Vector2 newValue) + { + SetValueAndNotify(newValue); + } + + public bool indeterminate + { + get { return m_Slider.parent == null; } + + set + { + if (indeterminate != value) + { + if (value) + { + m_Slider.RemoveFromHierarchy(); + Add(m_IndeterminateLabel); + } + else + { + m_IndeterminateLabel.RemoveFromHierarchy(); + Add(m_Slider); + } + + m_Slider.SetEnabled(!value); + } + } + } + public bool hasFocus + { + get + { + return m_Slider.HasFocus() || m_Vector2Field.HasFocus() || (panel != null && panel.focusController.focusedElement == m_Vector2Field as VisualElement); + } + } + } +} diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs.meta b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs.meta new file mode 100644 index 00000000000..be193124473 --- /dev/null +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3a173383da628a43ab58514c3cf8b4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs new file mode 100644 index 00000000000..56d1838995d --- /dev/null +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs @@ -0,0 +1,122 @@ +using UnityEditor.UIElements; +using UnityEditor.VFX.UI; +using UnityEngine; +using UnityEngine.UIElements; + +namespace UnityEditor.VFX.UI + +{ + class Vector2PropertyRM : SimpleUIPropertyRM + { + VFXVector2Field m_VectorField; + protected VFXMinMaxSliderField m_Slider; + + public Vector2PropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth) + { } + + private void ValueDragStarted() + { + m_Provider.StartLiveModification(); + } + + private void ValueDragFinished() + { + m_Provider.EndLiveModification(); + hasChangeDelayed = false; + NotifyValueChanged(); + } + + public override float GetPreferredControlWidth() + { + return 120; + } + + public override INotifyValueChanged CreateField() + { + INotifyValueChanged result; + bool isMinMax = m_Provider.attributes.Is(VFXPropertyAttributes.Type.MinMax); + if (isMinMax) + { + Vector2 range = m_Provider.attributes.FindRange(); + result = CreateSliderField(out m_Slider); + m_Slider.onValueDragFinished = ValueDragFinished; + m_Slider.onValueDragStarted = ValueDragStarted; + m_Slider.RegisterCallback(OnFocusLost); + m_Slider.range = range; + } + else + { + result = CreateSimpleField(out m_VectorField); + } + + return result; + } + void OnFocusLost(BlurEvent e) + { + DelayedNotifyValueChange(); + UpdateGUI(true); + } + void DelayedNotifyValueChange() + { + if (isDelayed && hasChangeDelayed) + { + hasChangeDelayed = false; + NotifyValueChanged(); + } + } + + protected override void UpdateIndeterminate() + { + if (m_Slider != null) + m_Slider.indeterminate = indeterminate; + } + public override void UpdateGUI(bool force) + { + if (m_Slider != null) + { + Vector2 range = m_Provider.attributes.FindRange(); + + m_Slider.range = range; + } + base.UpdateGUI(force); + } + + public override object FilterValue(object value) + { + Vector2 range = m_Provider.attributes.FindRange(); + + if (range != Vector2.zero) + { + var vectorValue = (Vector2)value; + vectorValue.x = Mathf.Clamp(vectorValue.x, range.x, range.y); + vectorValue.y = Mathf.Clamp(vectorValue.y, range.x, range.y); + return vectorValue; + } + + return value; + } + + protected override bool HasFocus() + { + if (m_Slider != null) + return m_Slider.HasFocus(); + if (m_VectorField != null) + return m_VectorField.HasFocus(); + return false; + } + protected INotifyValueChanged CreateSliderField(out VFXMinMaxSliderField slider) + { + var field = new VFXLabeledField(m_Label); + slider = field.control; + return field; + } + protected INotifyValueChanged CreateSimpleField(out VFXVector2Field textField) + { + var field = new VFXLabeledField(m_Label); + field.onValueDragFinished = t => ValueDragFinished(); + field.onValueDragStarted = t => ValueDragStarted(); + textField = field.control; + return field; + } + } +} diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs.meta b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs.meta new file mode 100644 index 00000000000..39fa8fc5a08 --- /dev/null +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2dc2ed38e6e91748903b63873ee7e10 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/VectorPropertiesRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/VectorPropertiesRM.cs index 760d5c8dcb6..66d31c8e9a4 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/VectorPropertiesRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/VectorPropertiesRM.cs @@ -39,16 +39,4 @@ public override float GetPreferredControlWidth() return 224; } } - - class Vector2PropertyRM : VectorPropertyRM - { - public Vector2PropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth) - { - } - - public override float GetPreferredControlWidth() - { - return 120; - } - } } diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs index 58fc72cb6e8..8347f4218e7 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs @@ -4,6 +4,8 @@ using System.Linq; using System.Text.RegularExpressions; using UnityEngine; +using UnityEngine.Assertions.Must; +using UnityEngine.UIElements; using UnityEngine.VFX; namespace UnityEditor.VFX @@ -56,6 +58,7 @@ public enum Type Delayed = 1 << 7, BitField = 1 << 8, Enum = GraphAttribute | 1 << 9, + MinMax = 1 << 10, // Tells whether this attribute modifies the expression graph GraphAttribute = 1 << 31, @@ -72,7 +75,8 @@ public enum Type { typeof(RegexAttribute), Type.Regex }, { typeof(DelayedAttribute), Type.Delayed }, { typeof(BitFieldAttribute), Type.BitField }, - { typeof(EnumAttribute), Type.Enum } + { typeof(EnumAttribute), Type.Enum }, + { typeof(MinMaxAttribute), Type.MinMax}, }; public VFXPropertyAttributes(params object[] attributes) : this() @@ -216,6 +220,12 @@ public Vector2 FindRange() var attribute = m_AllAttributes.OfType().First(); return new Vector2(attribute.min, Mathf.Infinity); } + else if (Is(Type.MinMax)) + { + var attribute = m_AllAttributes.OfType() + .First(); + return new Vector2(attribute.min, attribute.max); + } return Vector2.zero; } diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs b/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs index c32ee6272be..8ab84fedc2f 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs @@ -32,6 +32,18 @@ public VFXSpaceAttribute(SpaceableType type) class ShowAsColorAttribute : Attribute {} + public class MinMaxAttribute : PropertyAttribute + { + public readonly float min; + public readonly float max; + + // Attribute used to make a float or int variable in a script be restricted to a specific range. + public MinMaxAttribute(float min, float max) + { + this.min = min; + this.max = max; + } + } class CoordinateSpaceInfo { diff --git a/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss b/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss index 7bbd8da1639..76a12e1c019 100644 --- a/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss +++ b/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss @@ -59,6 +59,11 @@ VFXColorField #indeterminate flex:0 0 auto; } +.unity-min-max-slider +{ + flex:1 0 auto; +} + .PopupButton { -unity-text-align:middle-left; From 9d0d4747477c3771b5b41b4a041a18d33826e37f Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 25 May 2021 11:13:33 +0200 Subject: [PATCH 08/66] Temp fix, force blend mode to opaque --- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 6cbe315b16b..0b0b786117f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -16,6 +16,12 @@ class VFXDecalHDRPOutput : VFXAbstractParticleHDRPLitOutput public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleHDRPDecal"); } } public override VFXTaskType taskType { get { return VFXTaskType.ParticleHexahedronOutput; } } + public override void OnEnable() + { + base.OnEnable(); + blendMode = BlendMode.Opaque; + } + public override IEnumerable attributes { get @@ -74,7 +80,7 @@ public class FadingProperties [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? public Vector2 angleFade = Vector2.zero; [Range(0, 1), Tooltip("Fade Factor.")] - public float fadeFactor = 0.0f; + public float fadeFactor = 1.0f; } protected override IEnumerable inputProperties From 219b30b2d796289214e7bf44f103b613ac97753d Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 25 May 2021 11:30:47 +0200 Subject: [PATCH 09/66] Orthographic linear eye --- .../Shaders/RenderPipeline/Legacy/VFXCommon.hlsl | 5 ++++- .../Shaders/VFXParticleCommon.template | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl index bc63721f4f3..19e34556e6f 100644 --- a/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl +++ b/com.unity.visualeffectgraph/Shaders/RenderPipeline/Legacy/VFXCommon.hlsl @@ -102,7 +102,10 @@ float VFXSampleDepth(float4 posSS) float VFXLinearEyeDepth(float depth) { - return LinearEyeDepth(depth); + if (IsPerspectiveProjection()) + return LinearEyeDepth(depth); + else + return depth * (_ProjectionParams.z - _ProjectionParams.y) + _ProjectionParams.y; } float4 VFXApplyShadowBias(float4 posCS) diff --git a/com.unity.visualeffectgraph/Shaders/VFXParticleCommon.template b/com.unity.visualeffectgraph/Shaders/VFXParticleCommon.template index b1b0e1fdfaa..d6ecd72242b 100644 --- a/com.unity.visualeffectgraph/Shaders/VFXParticleCommon.template +++ b/com.unity.visualeffectgraph/Shaders/VFXParticleCommon.template @@ -29,6 +29,21 @@ o.VFX_VARYING_UV.xy = o.VFX_VARYING_UV.xy * uvScale + uvBias; #endif #endif +#ifdef VFX_VARYING_ANGLEFADE +${VFXLoadParameter:{angleFade}} +o.VFX_VARYING_ANGLEFADE = angleFade; +#endif + +#ifdef VFX_VARYING_FADEFACTOR +${VFXLoadParameter:{fadeFactor}} +o.VFX_VARYING_FADEFACTOR = fadeFactor; +#endif + +#ifdef VFX_VARYING_DECALLAYER +${VFXLoadParameter:{decalLayerMask}} +o.VFX_VARYING_DECALLAYER = decalLayerMask; +#endif + #if defined(VFX_VARYING_POSWS) o.VFX_VARYING_POSWS = TransformPositionVFXToWorld(vPos); #endif From 0b47f1b909d6b05ae2396578849c0cc64ed652f9 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 25 May 2021 16:28:34 +0200 Subject: [PATCH 10/66] Proper Decal varyings --- .../VFXGraph/Shaders/Templates/HDRPDecal.meta | 8 ++ .../Templates/HDRPDecal/PassDBuffer.template | 30 +++---- .../HDRPDecal/PassForwardEmissive.template | 37 +++++---- .../Templates/VFXParticleHDRPDecal.template | 4 +- .../Editor/VFXGraph/Shaders/VFXDecal.template | 15 ++++ .../Shaders/VFXDecalVaryings.template | 80 +++++++++++++++++++ 6 files changed, 137 insertions(+), 37 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta new file mode 100644 index 00000000000..090217f6209 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81cd7f821cd55c944b0efd22abaee343 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 31447948f38..ccdab9901d0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -1,5 +1,5 @@ Pass -{ +{ Name "DBufferMesh" Tags {"LightMode"="DBufferMesh"} @@ -13,15 +13,15 @@ Pass // ColorMask [_DecalColorMask1] 1 // ColorMask [_DecalColorMask2] 2 // ColorMask [_DecalColorMask3] 3 - + HLSLPROGRAM #pragma target 4.5 #pragma multi_compile _ LIGHT_LAYERS #pragma multi_compile _ DEBUG_DISPLAY - + #define UNITY_MATERIAL_LIT - - ${VFXIncludeRP("VFXLitVaryings.template")} + + ${VFXIncludeRP("VFXDecalVaryings.template")} #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" @@ -29,9 +29,9 @@ Pass struct ps_input { float4 pos : SV_POSITION; - - ${VFXHDRPLitDeclareVaryings} - + + ${VFXHDRPDecalDeclareVaryings} + float2 uv : TEXCOORD1; //unsure about the necessity of this one float3 posWS : TEXCOORD2; #if VFX_ENABLE_DECAL_LAYERS @@ -45,9 +45,9 @@ Pass UNITY_VERTEX_OUTPUT_STEREO }; - - ${VFXHDRPLitVaryingsMacros} - + + ${VFXHDRPDecalVaryingsMacros} + #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv @@ -68,7 +68,7 @@ Pass float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), size3, attributes.position); - + #if VFX_LOCAL_SPACE viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); #endif @@ -77,19 +77,19 @@ Pass o.viewToDecal1 = viewToDecal[1]; o.viewToDecal2 = viewToDecal[2]; - ${VFXHDRPLitFillVaryings} + ${VFXHDRPDecalFillVaryings} ${VFXEnd} //TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one -${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} +${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #define SHADERPASS SHADERPASS_VFX_DBUFFER_PROJECTOR ${VFXIncludeRP("VFXDecal.template")} //EndTODO - + #pragma fragment frag void frag(ps_input i, OUTPUT_DBUFFER(outDBuffer)) { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index 420e02a78e0..eec18d2f209 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -1,5 +1,5 @@ Pass -{ +{ Name "DecalMeshForwardEmissive" Tags {"LightMode"="DecalMeshForwardEmissive"} @@ -8,15 +8,15 @@ Pass ZTest LEqual Blend 0 SrcAlpha One - + HLSLPROGRAM #pragma target 4.5 #pragma multi_compile _ LIGHT_LAYERS #pragma multi_compile _ DEBUG_DISPLAY - + #define UNITY_MATERIAL_LIT - - ${VFXIncludeRP("VFXLitVaryings.template")} + + ${VFXIncludeRP("VFXDecalVaryings.template")} #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" @@ -25,9 +25,9 @@ Pass struct ps_input { float4 pos : SV_POSITION; - - ${VFXHDRPLitDeclareVaryings} - + + ${VFXHDRPDecalDeclareVaryings} + float2 uv : TEXCOORD1; //unsure about the necessity of this one float3 posWS : TEXCOORD2; #if VFX_ENABLE_DECAL_LAYERS @@ -41,9 +41,9 @@ Pass UNITY_VERTEX_OUTPUT_STEREO }; - - ${VFXHDRPLitVaryingsMacros} - + + ${VFXHDRPDecalVaryingsMacros} + #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv @@ -54,7 +54,6 @@ Pass #define VFX_VARYING_DECALLAYER decalLayerMask #endif - ${VFXBegin:VFXVertexAdditionalProcess} float4x4 viewToDecal = GetVFXToElementMatrix( attributes.axisX, @@ -64,7 +63,7 @@ Pass float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), size3, attributes.position); - + #if VFX_LOCAL_SPACE viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); #endif @@ -74,12 +73,12 @@ Pass o.viewToDecal2 = viewToDecal[2]; //Move this somewhere else - ${VFXHDRPLitFillVaryings} + ${VFXHDRPDecalFillVaryings} ${VFXEnd} - + //TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one -${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} +${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #define SHADERPASS SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE ${VFXIncludeRP("VFXDecal.template")} @@ -87,14 +86,14 @@ ${VFXIncludeRP("VFXDecal.template")} //EndTODO - + #pragma fragment frag void frag(ps_input i, out float4 outEmissive : SV_Target0) { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); float3 normalWS = float3(0,1,0); //TODO : useless - DecalSurfaceData surfaceData; - ZERO_INITIALIZE(DecalSurfaceData, surfaceData); + DecalSurfaceData surfaceData; + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); VFXGetSurfaceDecalData(surfaceData,i,normalWS); outEmissive.rgb = surfaceData.emissive * GetCurrentExposureMultiplier(); outEmissive.a = 1.0f; diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template index d89fd6c15b1..ffeecf9ec76 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template @@ -1,8 +1,6 @@ { SubShader - { - Cull Back - + { ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXInclude("Shaders/ParticleHexahedron/PassSelection.template")} ${VFXIncludeRP("Templates/HDRPDecal/PassDBuffer.template")} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index ec04016f1e5..8f186d24579 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -113,8 +113,23 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP float albedoMapBlend = surfaceData.baseColor.a; float maskMapBlend = fadeFactor; + float metallic = 0.0f; + float smoothness = 0.5f; + float ao = 0.0f; +#ifdef VFX_VARYING_METALLIC + metallic = i.VFX_VARYING_METALLIC; +#endif +#ifdef VFX_VARYING_SMOOTHNESS + smoothness = i.VFX_VARYING_SMOOTHNESS; +#endif +#ifdef VFX_VARYING_AMBIENT_OCCLUSION + ao = i.VFX_VARYING_AMBIENT_OCCLUSION; +#endif + #if HDRP_USE_MASK_MAP float4 mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); + mask.xyz *= float3(metallic, ao, smoothness); + surfaceData.mask = mask; surfaceData.mask.z = surfaceData.mask.w; maskMapBlend = mask.z * fadeFactor; diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template new file mode 100644 index 00000000000..99575935e8a --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -0,0 +1,80 @@ +#define HDRP_NEEDS_UVS (HDRP_USE_BASE_COLOR_MAP || HDRP_USE_MASK_MAP || USE_NORMAL_MAP || HDRP_USE_EMISSIVE_MAP) +#define HDRP_USE_EMISSIVE (HDRP_USE_EMISSIVE_MAP || HDRP_USE_EMISSIVE_COLOR || HDRP_USE_ADDITIONAL_EMISSIVE_COLOR) + +${VFXBegin:VFXHDRPDecalVaryingsMacros} +#if (VFX_NEEDS_COLOR_INTERPOLATOR && HDRP_USE_BASE_COLOR) || HDRP_USE_ADDITIONAL_BASE_COLOR +#define VFX_VARYING_COLOR color.rgb +#define VFX_VARYING_ALPHA color.a +#endif + + +#define VFX_VARYING_METALLIC materialProperties.x +#define VFX_VARYING_AMBIENT_OCCLUSION materialProperties.y +#define VFX_VARYING_SMOOTHNESS materialProperties.z + +#if HDRP_USE_EMISSIVE_MAP +#define VFX_VARYING_EMISSIVESCALE materialProperties.w +#endif + +#if HDRP_USE_EMISSIVE_COLOR || HDRP_USE_ADDITIONAL_EMISSIVE_COLOR +#define VFX_VARYING_EMISSIVE emissiveColor.rgb +#endif + +#if USE_EXPOSURE_WEIGHT +#define VFX_VARYING_EXPOSUREWEIGHT emissiveColor.a +#endif +${VFXEnd} + +${VFXBegin:VFXHDRPDecalDeclareVaryings} + +#if (VFX_NEEDS_COLOR_INTERPOLATOR && HDRP_USE_BASE_COLOR) || HDRP_USE_ADDITIONAL_BASE_COLOR +VFX_OPTIONAL_INTERPOLATION float4 color : COLOR0; +#endif +#if HDRP_USE_EMISSIVE +VFX_OPTIONAL_INTERPOLATION float4 emissiveColor : COLOR1; +#endif + +// x: metallic +// y: AO +// z: smoothness +// w: emissive scale +VFX_OPTIONAL_INTERPOLATION float4 materialProperties : TEXCOORD0; +${VFXEnd} + +${VFXBegin:VFXHDRPDecalFillVaryings} +#ifndef VFX_SHADERGRAPH + +#ifdef VFX_VARYING_SMOOTHNESS +${VFXLoadParameter:{smoothness}} +o.VFX_VARYING_SMOOTHNESS = smoothness; +#endif + +#ifdef VFX_VARYING_METALLIC +${VFXLoadParameter:{metallic}} +o.VFX_VARYING_METALLIC = metallic; +#endif + +#if HDRP_USE_EMISSIVE_MAP +#ifdef VFX_VARYING_EMISSIVESCALE +${VFXLoadParameter:{emissiveScale}} +o.VFX_VARYING_EMISSIVESCALE = emissiveScale; +#endif +#endif + +#ifdef VFX_VARYING_EMISSIVE +#if HDRP_USE_EMISSIVE_COLOR +o.VFX_VARYING_EMISSIVE = attributes.color; +#elif HDRP_USE_ADDITIONAL_EMISSIVE_COLOR +${VFXLoadParameter:{emissiveColor}} +o.VFX_VARYING_EMISSIVE = emissiveColor.rgb; +#endif +#endif + +#if HDRP_USE_ADDITIONAL_BASE_COLOR +#ifdef VFX_VARYING_COLOR +${VFXLoadParameter:{baseColor}} +o.VFX_VARYING_COLOR = baseColor; +#endif +#endif +#endif +${VFXEnd} From f8f044f0d13f14bc563b2865adcd9a127f979713 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 25 May 2021 16:41:25 +0200 Subject: [PATCH 11/66] Intermediate class between HDRP Lit Outputs and ShadergraphOutputs --- .../VFXAbstractParticleHDRPLitOutput.cs | 206 +------------ .../Outputs/VFXAbstractParticleHDRPOutput.cs | 274 ++++++++++++++++++ .../VFXAbstractParticleHDRPOutput.cs.meta | 11 + .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 47 ++- .../Shaders/VFXDecalVaryings.template.meta | 7 + 5 files changed, 326 insertions(+), 219 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs.meta create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs index b4886e94c39..d49188afa82 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs @@ -7,7 +7,7 @@ namespace UnityEditor.VFX.HDRP { - abstract class VFXAbstractParticleHDRPLitOutput : VFXShaderGraphParticleOutput + abstract class VFXAbstractParticleHDRPLitOutput : VFXAbstractParticleHDRPOutput { public enum MaterialType { @@ -17,25 +17,6 @@ public enum MaterialType SimpleLit, SimpleLitTranslucent, } - - [Flags] - public enum ColorMode - { - None = 0, - BaseColor = 1 << 0, - Emissive = 1 << 1, - BaseColorAndEmissive = BaseColor | Emissive, - } - - [Flags] - public enum BaseColorMapMode - { - None = 0, - Color = 1 << 0, - Alpha = 1 << 1, - ColorAndAlpha = Color | Alpha - } - private readonly string[] kMaterialTypeToName = new string[] { "StandardProperties", @@ -63,24 +44,6 @@ protected bool GeneratesWithShaderGraph() [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the thickness of the particle is multiplied with its alpha value.")] protected bool multiplyThicknessWithAlpha = false; - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies what parts of the base color map is applied to the particles. Particles can receive color, alpha, color and alpha, or not receive any values from the base color map.")] - protected BaseColorMapMode useBaseColorMap = BaseColorMapMode.ColorAndAlpha; - - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the output will accept a Mask Map to control how the particle receives lighting.")] - protected bool useMaskMap = false; - - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the output will accept a Normal Map to simulate additional surface details when illuminated.")] - protected bool useNormalMap = false; - - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the output will accept an Emissive Map to control how particles glow.")] - protected bool useEmissiveMap = false; - - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies how the color attribute is applied to the particles. It can be disregarded, used for the base color, used for the emissiveness, or used for both the base color and the emissiveness.")] - protected ColorMode colorMode = ColorMode.BaseColor; - - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, an emissive color field becomes available in the output to make particles glow.")] - protected bool useEmissive = false; - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the normals of the particle are inverted when seen from behind, allowing quads with culling set to off to receive correct lighting information.")] protected bool doubleSided = false; @@ -101,8 +64,6 @@ protected bool GeneratesWithShaderGraph() protected VFXAbstractParticleHDRPLitOutput(bool strip = false) : base(strip) {} - protected virtual bool allowTextures { get { return GetOrRefreshShaderGraphObject() == null; }} - public class HDRPLitInputProperties { [Range(0, 1), Tooltip("Controls the scale factor for the particle’s smoothness.")] @@ -127,55 +88,6 @@ public class TranslucentProperties public float thickness = 1.0f; } - protected IEnumerable baseColorMapProperties - { - get - { - yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "baseColorMap", new TooltipAttribute("Specifies the base color (RGB) and opacity (A) of the particle.")), (usesFlipbook ? null : VFXResources.defaultResources.particleTexture)); - } - } - - protected IEnumerable maskMapsProperties - { - get - { - yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "maskMap", new TooltipAttribute("Specifies the Mask Map for the particle - Metallic (R), Ambient occlusion (G), and Smoothness (A).")), (usesFlipbook ? null : VFXResources.defaultResources.noiseTexture)); - } - } - protected IEnumerable normalMapsProperties - { - get - { - yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "normalMap", new TooltipAttribute("Specifies the Normal map to obtain normals in tangent space for the particle."))); - yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "normalScale", new TooltipAttribute("Sets the scale of the normals. Larger values increase the impact of the normals.")), 1.0f); - } - } - protected IEnumerable emissiveMapsProperties - { - get - { - yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "emissiveMap", new TooltipAttribute("Specifies the Emissive map (RGB) used to make particles glow."))); - yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "emissiveScale", new TooltipAttribute("Sets the scale of the emission obtained from the emissive map.")), 1.0f); - } - } - - public class BaseColorProperties - { - [Tooltip("Sets the base color of the particle.")] - public Color baseColor = Color.white; - } - - public class EmissiveColorProperties - { - [Tooltip("Sets the emissive color to make particles glow.")] - public Color emissiveColor = Color.black; - } - - public override sealed bool CanBeCompiled() - { - return (VFXLibrary.currentSRPBinder is VFXHDRPBinder) && base.CanBeCompiled(); - } - protected override bool needsExposureWeight { get { return GetOrRefreshShaderGraphObject() == null && ((colorMode & ColorMode.Emissive) != 0 || useEmissive || useEmissiveMap); } } protected override bool bypassExposure { get { return false; } } @@ -190,36 +102,15 @@ protected override IEnumerable inputProperties { get { - var properties = base.inputProperties; + var properties = Enumerable.Empty(); if (GetOrRefreshShaderGraphObject() == null) { properties = properties.Concat(PropertiesFromType("HDRPLitInputProperties")); properties = properties.Concat(PropertiesFromType(kMaterialTypeToName[(int)materialType])); - - if (allowTextures) - { - if (useBaseColorMap != BaseColorMapMode.None) - properties = properties.Concat(baseColorMapProperties); - } - - if ((colorMode & ColorMode.BaseColor) == 0) // particle color is not used as base color so add a slot - properties = properties.Concat(PropertiesFromType("BaseColorProperties")); - - if (allowTextures) - { - if (useMaskMap) - properties = properties.Concat(maskMapsProperties); - if (useNormalMap) - properties = properties.Concat(normalMapsProperties); - if (useEmissiveMap) - properties = properties.Concat(emissiveMapsProperties); - } - - if (((colorMode & ColorMode.Emissive) == 0) && useEmissive) - properties = properties.Concat(PropertiesFromType("EmissiveColorProperties")); } + properties = properties.Concat(base.inputProperties); return properties; } } @@ -231,8 +122,6 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (GetOrRefreshShaderGraphObject() == null) { - yield return slotExpressions.First(o => o.name == "smoothness"); - switch (materialType) { case MaterialType.Standard: @@ -256,30 +145,6 @@ protected override IEnumerable CollectGPUExpressions(IEnumer default: break; } - - if (allowTextures) - { - if (useBaseColorMap != BaseColorMapMode.None) - yield return slotExpressions.First(o => o.name == "baseColorMap"); - if (useMaskMap) - yield return slotExpressions.First(o => o.name == "maskMap"); - if (useNormalMap) - { - yield return slotExpressions.First(o => o.name == "normalMap"); - yield return slotExpressions.First(o => o.name == "normalScale"); - } - if (useEmissiveMap) - { - yield return slotExpressions.First(o => o.name == "emissiveMap"); - yield return slotExpressions.First(o => o.name == "emissiveScale"); - } - } - - if ((colorMode & ColorMode.BaseColor) == 0) - yield return slotExpressions.First(o => o.name == "baseColor"); - - if (((colorMode & ColorMode.Emissive) == 0) && useEmissive) - yield return slotExpressions.First(o => o.name == "emissiveColor"); } } @@ -290,8 +155,6 @@ public override IEnumerable additionalDefines foreach (var d in base.additionalDefines) yield return d; - yield return "HDRP_LIT"; - if (GetOrRefreshShaderGraphObject() == null) switch (materialType) { @@ -338,36 +201,6 @@ public override IEnumerable additionalDefines default: break; } - - if (allowTextures) - { - if (useBaseColorMap != BaseColorMapMode.None) - yield return "HDRP_USE_BASE_COLOR_MAP"; - if ((useBaseColorMap & BaseColorMapMode.Color) != 0) - yield return "HDRP_USE_BASE_COLOR_MAP_COLOR"; - if ((useBaseColorMap & BaseColorMapMode.Alpha) != 0) - yield return "HDRP_USE_BASE_COLOR_MAP_ALPHA"; - if (useMaskMap) - yield return "HDRP_USE_MASK_MAP"; - if (useNormalMap) - yield return "USE_NORMAL_MAP"; - if (useEmissiveMap) - yield return "HDRP_USE_EMISSIVE_MAP"; - } - - if (GetOrRefreshShaderGraphObject() == null) - { - if ((colorMode & ColorMode.BaseColor) != 0) - yield return "HDRP_USE_BASE_COLOR"; - else - yield return "HDRP_USE_ADDITIONAL_BASE_COLOR"; - - if ((colorMode & ColorMode.Emissive) != 0) - yield return "HDRP_USE_EMISSIVE_COLOR"; - else if (useEmissive) - yield return "HDRP_USE_ADDITIONAL_EMISSIVE_COLOR"; - } - if (doubleSided) yield return "USE_DOUBLE_SIDED"; @@ -386,8 +219,6 @@ protected override IEnumerable filteredOutSettings foreach (var setting in base.filteredOutSettings) yield return setting; - yield return "colorMapping"; - if (materialType != MaterialType.Translucent && materialType != MaterialType.SimpleLitTranslucent) { yield return "diffusionProfileAsset"; @@ -402,40 +233,9 @@ protected override IEnumerable filteredOutSettings yield return "enableCookie"; yield return "enableEnvLight"; } - - if (!allowTextures) - { - yield return "useBaseColorMap"; - yield return "useMaskMap"; - yield return "useNormalMap"; - yield return "useEmissiveMap"; - yield return "alphaMask"; - } - - if (GetOrRefreshShaderGraphObject() != null) - { - yield return "materialType"; - yield return "useEmissive"; - yield return "colorMode"; - } - else if ((colorMode & ColorMode.Emissive) != 0) - yield return "useEmissive"; - - if (isBlendModeOpaque) - { - yield return "onlyAmbientLighting"; - yield return "preserveSpecularLighting"; - yield return "excludeFromTAA"; - } } } - public override void OnEnable() - { - colorMapping = ColorMappingMode.Default; - base.OnEnable(); - } - public override IEnumerable> additionalReplacements { get diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs new file mode 100644 index 00000000000..0dc50faa071 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.HighDefinition; + +namespace UnityEditor.VFX.HDRP +{ + abstract class VFXAbstractParticleHDRPOutput : VFXShaderGraphParticleOutput + { + [Flags] + public enum ColorMode + { + None = 0, + BaseColor = 1 << 0, + Emissive = 1 << 1, + BaseColorAndEmissive = BaseColor | Emissive, + } + + [Flags] + public enum BaseColorMapMode + { + None = 0, + Color = 1 << 0, + Alpha = 1 << 1, + ColorAndAlpha = Color | Alpha + } + + protected bool GeneratesWithShaderGraph() + { + return GetOrRefreshShaderGraphObject() != null && + GetOrRefreshShaderGraphObject().generatesWithShaderGraph; + } + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies what parts of the base color map is applied to the particles. Particles can receive color, alpha, color and alpha, or not receive any values from the base color map.")] + protected BaseColorMapMode useBaseColorMap = BaseColorMapMode.ColorAndAlpha; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the output will accept a Mask Map to control how the particle receives lighting.")] + protected bool useMaskMap = false; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the output will accept a Normal Map to simulate additional surface details when illuminated.")] + protected bool useNormalMap = false; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, the output will accept an Emissive Map to control how particles glow.")] + protected bool useEmissiveMap = false; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies how the color attribute is applied to the particles. It can be disregarded, used for the base color, used for the emissiveness, or used for both the base color and the emissiveness.")] + protected ColorMode colorMode = ColorMode.BaseColor; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("When enabled, an emissive color field becomes available in the output to make particles glow.")] + protected bool useEmissive = false; + protected VFXAbstractParticleHDRPOutput(bool strip = false) : base(strip) {} + + protected virtual bool allowTextures { get { return GetOrRefreshShaderGraphObject() == null; }} + + protected bool useNormalScale = true; + + protected IEnumerable baseColorMapProperties + { + get + { + yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "baseColorMap", new TooltipAttribute("Specifies the base color (RGB) and opacity (A) of the particle.")), (usesFlipbook ? null : VFXResources.defaultResources.particleTexture)); + } + } + + protected IEnumerable maskMapsProperties + { + get + { + yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "maskMap", new TooltipAttribute("Specifies the Mask Map for the particle - Metallic (R), Ambient occlusion (G), and Smoothness (A).")), (usesFlipbook ? null : VFXResources.defaultResources.noiseTexture)); + } + } + protected IEnumerable normalMapsProperties + { + get + { + yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "normalMap", new TooltipAttribute("Specifies the Normal map to obtain normals in tangent space for the particle."))); + + if(useNormalScale) + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "normalScale", new TooltipAttribute("Sets the scale of the normals. Larger values increase the impact of the normals.")), 1.0f); + } + } + protected IEnumerable emissiveMapsProperties + { + get + { + yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "emissiveMap", new TooltipAttribute("Specifies the Emissive map (RGB) used to make particles glow."))); + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "emissiveScale", new TooltipAttribute("Sets the scale of the emission obtained from the emissive map.")), 1.0f); + } + } + + public class BaseColorProperties + { + [Tooltip("Sets the base color of the particle.")] + public Color baseColor = Color.white; + } + + public class EmissiveColorProperties + { + [Tooltip("Sets the emissive color to make particles glow.")] + public Color emissiveColor = Color.black; + } + + public override sealed bool CanBeCompiled() + { + return (VFXLibrary.currentSRPBinder is VFXHDRPBinder) && base.CanBeCompiled(); + } + + protected override bool needsExposureWeight { get { return GetOrRefreshShaderGraphObject() == null && ((colorMode & ColorMode.Emissive) != 0 || useEmissive || useEmissiveMap); } } + + protected override bool bypassExposure { get { return false; } } + + protected override RPInfo currentRP + { + get { return hdrpLitInfo; } + } + public override bool isLitShader { get => true; } + + protected override IEnumerable inputProperties + { + get + { + var properties = base.inputProperties; + + if (GetOrRefreshShaderGraphObject() == null) + { + if (allowTextures) + { + if (useBaseColorMap != BaseColorMapMode.None) + properties = properties.Concat(baseColorMapProperties); + } + + if ((colorMode & ColorMode.BaseColor) == 0) // particle color is not used as base color so add a slot + properties = properties.Concat(PropertiesFromType("BaseColorProperties")); + + if (allowTextures) + { + if (useMaskMap) + properties = properties.Concat(maskMapsProperties); + if (useNormalMap) + properties = properties.Concat(normalMapsProperties); + if (useEmissiveMap) + properties = properties.Concat(emissiveMapsProperties); + } + + if (((colorMode & ColorMode.Emissive) == 0) && useEmissive) + properties = properties.Concat(PropertiesFromType("EmissiveColorProperties")); + } + + return properties; + } + } + + protected override IEnumerable CollectGPUExpressions(IEnumerable slotExpressions) + { + foreach (var exp in base.CollectGPUExpressions(slotExpressions)) + yield return exp; + + if (GetOrRefreshShaderGraphObject() == null) + { + yield return slotExpressions.First(o => o.name == "smoothness"); + + if (allowTextures) + { + if (useBaseColorMap != BaseColorMapMode.None) + yield return slotExpressions.First(o => o.name == "baseColorMap"); + if (useMaskMap) + yield return slotExpressions.First(o => o.name == "maskMap"); + if (useNormalMap) + { + yield return slotExpressions.First(o => o.name == "normalMap"); + if(useNormalScale) + yield return slotExpressions.First(o => o.name == "normalScale"); + } + if (useEmissiveMap) + { + yield return slotExpressions.First(o => o.name == "emissiveMap"); + yield return slotExpressions.First(o => o.name == "emissiveScale"); + } + } + + if ((colorMode & ColorMode.BaseColor) == 0) + yield return slotExpressions.First(o => o.name == "baseColor"); + + if (((colorMode & ColorMode.Emissive) == 0) && useEmissive) + yield return slotExpressions.First(o => o.name == "emissiveColor"); + } + } + + public override IEnumerable additionalDefines + { + get + { + foreach (var d in base.additionalDefines) + yield return d; + + yield return "HDRP_LIT"; + + if (allowTextures) + { + if (useBaseColorMap != BaseColorMapMode.None) + yield return "HDRP_USE_BASE_COLOR_MAP"; + if ((useBaseColorMap & BaseColorMapMode.Color) != 0) + yield return "HDRP_USE_BASE_COLOR_MAP_COLOR"; + if ((useBaseColorMap & BaseColorMapMode.Alpha) != 0) + yield return "HDRP_USE_BASE_COLOR_MAP_ALPHA"; + if (useMaskMap) + yield return "HDRP_USE_MASK_MAP"; + if (useNormalMap) + yield return "USE_NORMAL_MAP"; + if (useEmissiveMap) + yield return "HDRP_USE_EMISSIVE_MAP"; + } + + if (GetOrRefreshShaderGraphObject() == null) + { + if ((colorMode & ColorMode.BaseColor) != 0) + yield return "HDRP_USE_BASE_COLOR"; + else + yield return "HDRP_USE_ADDITIONAL_BASE_COLOR"; + + if ((colorMode & ColorMode.Emissive) != 0) + yield return "HDRP_USE_EMISSIVE_COLOR"; + else if (useEmissive) + yield return "HDRP_USE_ADDITIONAL_EMISSIVE_COLOR"; + } + } + } + + protected override IEnumerable filteredOutSettings + { + get + { + foreach (var setting in base.filteredOutSettings) + yield return setting; + + yield return "colorMapping"; + + if (!allowTextures) + { + yield return "useBaseColorMap"; + yield return "useMaskMap"; + yield return "useNormalMap"; + yield return "useEmissiveMap"; + yield return "alphaMask"; + } + + if (GetOrRefreshShaderGraphObject() != null) + { + yield return "materialType"; + yield return "useEmissive"; + yield return "colorMode"; + } + else if ((colorMode & ColorMode.Emissive) != 0) + yield return "useEmissive"; + + if (isBlendModeOpaque) + { + yield return "onlyAmbientLighting"; + yield return "preserveSpecularLighting"; + yield return "excludeFromTAA"; + } + } + } + + public override void OnEnable() + { + colorMapping = ColorMappingMode.Default; + base.OnEnable(); + } + + } +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs.meta new file mode 100644 index 00000000000..e42520ac7d2 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d9142d59f81f1b40a4307ab71b7c947 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 0b0b786117f..c6ad34de3e9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -10,7 +10,7 @@ namespace UnityEditor.VFX.HDRP { [VFXInfo(experimental = true)] - class VFXDecalHDRPOutput : VFXAbstractParticleHDRPLitOutput + class VFXDecalHDRPOutput : VFXAbstractParticleHDRPOutput { public override string name { get { return "Output Particle HDRP Decal"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleHDRPDecal"); } } @@ -20,6 +20,7 @@ public override void OnEnable() { base.OnEnable(); blendMode = BlendMode.Opaque; + useNormalScale = false; } public override IEnumerable attributes @@ -47,6 +48,27 @@ public override IEnumerable attributes } } + public class WithoutMaskMapProperties + { + [Range(0, 1), Tooltip("Controls the metallic of the decal.")] + public float metallic = 0.0f; + [Range(0, 1), Tooltip("Controls the ambient occlusion of the decal.")] + public float ambientOcclusion = 0.0f; + [Range(0, 1), Tooltip("Controls the smoothness of the decal.")] + public float smoothness = 0.5f; + } + + public class WithMaskMapProperties + { + [Range(0, 1), Tooltip("Controls the scale factor for the particle’s metallic.")] + public float metallic = 1.0f; + [Range(0, 1), Tooltip("Controls the scale factor for the particle’s ambient occlusion.")] + public float ambientOcclusion = 1.0f; + [Range(0, 1), Tooltip("Controls the scale factor for the particle’s smoothness.")] + public float smoothness = 1.0f; + } + + public enum BlendSource { BaseColorMapAlpha, @@ -65,16 +87,6 @@ public enum BlendSource Tooltip("Specifies the layer mask of the decal.")] private DecalLayerEnum decalLayer = DecalLayerEnum.LightLayerDefault; - public class NoMaskMapProperties - { - [Range(0, 1), Tooltip("Controls the metallic of the decal.")] - public float metallic = 0.0f; - [Range(0, 1), Tooltip("Controls the ambient occlusion of the decal.")] - public float ambientOcclusion = 0.0f; - [Range(0, 1), Tooltip("Controls the smoothness of the decal.")] - public float smoothness = 0.0f; - } - public class FadingProperties { [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? @@ -82,13 +94,17 @@ public class FadingProperties [Range(0, 1), Tooltip("Fade Factor.")] public float fadeFactor = 1.0f; } - protected override IEnumerable inputProperties { get { - var properties = base.inputProperties; + var properties = Enumerable.Empty(); + properties = properties.Concat(PropertiesFromType("FadingProperties")); + properties = properties.Concat(base.inputProperties); + properties = + properties.Concat( + PropertiesFromType(useMaskMap ? "WithMaskMapProperties" : "WithoutMaskMapProperties")); return properties; } } @@ -101,6 +117,8 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (GetOrRefreshShaderGraphObject() == null) { yield return slotExpressions.First(o => o.name == "fadeFactor"); + yield return slotExpressions.First(o => o.name == "metallic"); + yield return slotExpressions.First(o => o.name == "ambientOcclusion"); if(enableDecalLayers) { var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); @@ -128,7 +146,6 @@ protected override IEnumerable filteredOutSettings { foreach (var setting in base.filteredOutSettings) yield return setting; - yield return "cullMode"; yield return "blendMode"; yield return "useAlphaClipping"; @@ -173,8 +190,6 @@ public override IEnumerable additionalDefines } } } - - protected override void WriteBlendMode(VFXShaderWriter writer) //TODO : Not sure we need to do it here : different for DBuffer and ForwardEmissive pass { // using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta new file mode 100644 index 00000000000..2763d28d9dc --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1fd6932d360723e4c9d73b4c3fcc8e3a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From d3681da11b45f63a5c336e113c5a312d5118c7cd Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 25 May 2021 16:45:15 +0200 Subject: [PATCH 12/66] remove isLitShader from decal outputs --- .../Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs index 0dc50faa071..387b9d688a7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs @@ -115,7 +115,6 @@ protected override RPInfo currentRP { get { return hdrpLitInfo; } } - public override bool isLitShader { get => true; } protected override IEnumerable inputProperties { From 537201301a8c522ad86b725c75cb49e144d55b99 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 26 May 2021 09:38:30 +0200 Subject: [PATCH 13/66] Remove unnecessary members --- .../VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs | 4 ---- .../Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs | 5 ----- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 3 --- 3 files changed, 12 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs index d49188afa82..df921ef7b90 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs @@ -88,10 +88,6 @@ public class TranslucentProperties public float thickness = 1.0f; } - protected override bool needsExposureWeight { get { return GetOrRefreshShaderGraphObject() == null && ((colorMode & ColorMode.Emissive) != 0 || useEmissive || useEmissiveMap); } } - - protected override bool bypassExposure { get { return false; } } - protected override RPInfo currentRP { get { return hdrpLitInfo; } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs index 387b9d688a7..7ebfd5229a4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs @@ -111,11 +111,6 @@ public override sealed bool CanBeCompiled() protected override bool bypassExposure { get { return false; } } - protected override RPInfo currentRP - { - get { return hdrpLitInfo; } - } - protected override IEnumerable inputProperties { get diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index c6ad34de3e9..07575048086 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -1,11 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using UnityEditor.VFX.Block; using UnityEngine; -using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; -using UnityEngine.VFX; namespace UnityEditor.VFX.HDRP { From a99e310797e4066d11d25acf64dc23d4e8c084c6 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 26 May 2021 09:53:16 +0200 Subject: [PATCH 14/66] Mask scale effective --- .../VFXGraph/Shaders/Templates/HDRPDecal.meta | 8 ++ .../Templates/HDRPDecal/PassDBuffer.template | 30 +++---- .../HDRPDecal/PassForwardEmissive.template | 37 +++++---- .../Templates/VFXParticleHDRPDecal.template | 4 +- .../Editor/VFXGraph/Shaders/VFXDecal.template | 15 ++++ .../Shaders/VFXDecalVaryings.template | 80 +++++++++++++++++++ .../Shaders/VFXDecalVaryings.template.meta | 7 ++ 7 files changed, 144 insertions(+), 37 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta new file mode 100644 index 00000000000..090217f6209 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81cd7f821cd55c944b0efd22abaee343 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 31447948f38..ccdab9901d0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -1,5 +1,5 @@ Pass -{ +{ Name "DBufferMesh" Tags {"LightMode"="DBufferMesh"} @@ -13,15 +13,15 @@ Pass // ColorMask [_DecalColorMask1] 1 // ColorMask [_DecalColorMask2] 2 // ColorMask [_DecalColorMask3] 3 - + HLSLPROGRAM #pragma target 4.5 #pragma multi_compile _ LIGHT_LAYERS #pragma multi_compile _ DEBUG_DISPLAY - + #define UNITY_MATERIAL_LIT - - ${VFXIncludeRP("VFXLitVaryings.template")} + + ${VFXIncludeRP("VFXDecalVaryings.template")} #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" @@ -29,9 +29,9 @@ Pass struct ps_input { float4 pos : SV_POSITION; - - ${VFXHDRPLitDeclareVaryings} - + + ${VFXHDRPDecalDeclareVaryings} + float2 uv : TEXCOORD1; //unsure about the necessity of this one float3 posWS : TEXCOORD2; #if VFX_ENABLE_DECAL_LAYERS @@ -45,9 +45,9 @@ Pass UNITY_VERTEX_OUTPUT_STEREO }; - - ${VFXHDRPLitVaryingsMacros} - + + ${VFXHDRPDecalVaryingsMacros} + #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv @@ -68,7 +68,7 @@ Pass float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), size3, attributes.position); - + #if VFX_LOCAL_SPACE viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); #endif @@ -77,19 +77,19 @@ Pass o.viewToDecal1 = viewToDecal[1]; o.viewToDecal2 = viewToDecal[2]; - ${VFXHDRPLitFillVaryings} + ${VFXHDRPDecalFillVaryings} ${VFXEnd} //TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one -${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} +${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #define SHADERPASS SHADERPASS_VFX_DBUFFER_PROJECTOR ${VFXIncludeRP("VFXDecal.template")} //EndTODO - + #pragma fragment frag void frag(ps_input i, OUTPUT_DBUFFER(outDBuffer)) { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index 420e02a78e0..eec18d2f209 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -1,5 +1,5 @@ Pass -{ +{ Name "DecalMeshForwardEmissive" Tags {"LightMode"="DecalMeshForwardEmissive"} @@ -8,15 +8,15 @@ Pass ZTest LEqual Blend 0 SrcAlpha One - + HLSLPROGRAM #pragma target 4.5 #pragma multi_compile _ LIGHT_LAYERS #pragma multi_compile _ DEBUG_DISPLAY - + #define UNITY_MATERIAL_LIT - - ${VFXIncludeRP("VFXLitVaryings.template")} + + ${VFXIncludeRP("VFXDecalVaryings.template")} #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" @@ -25,9 +25,9 @@ Pass struct ps_input { float4 pos : SV_POSITION; - - ${VFXHDRPLitDeclareVaryings} - + + ${VFXHDRPDecalDeclareVaryings} + float2 uv : TEXCOORD1; //unsure about the necessity of this one float3 posWS : TEXCOORD2; #if VFX_ENABLE_DECAL_LAYERS @@ -41,9 +41,9 @@ Pass UNITY_VERTEX_OUTPUT_STEREO }; - - ${VFXHDRPLitVaryingsMacros} - + + ${VFXHDRPDecalVaryingsMacros} + #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv @@ -54,7 +54,6 @@ Pass #define VFX_VARYING_DECALLAYER decalLayerMask #endif - ${VFXBegin:VFXVertexAdditionalProcess} float4x4 viewToDecal = GetVFXToElementMatrix( attributes.axisX, @@ -64,7 +63,7 @@ Pass float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), size3, attributes.position); - + #if VFX_LOCAL_SPACE viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); #endif @@ -74,12 +73,12 @@ Pass o.viewToDecal2 = viewToDecal[2]; //Move this somewhere else - ${VFXHDRPLitFillVaryings} + ${VFXHDRPDecalFillVaryings} ${VFXEnd} - + //TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one -${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} +${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #define SHADERPASS SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE ${VFXIncludeRP("VFXDecal.template")} @@ -87,14 +86,14 @@ ${VFXIncludeRP("VFXDecal.template")} //EndTODO - + #pragma fragment frag void frag(ps_input i, out float4 outEmissive : SV_Target0) { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); float3 normalWS = float3(0,1,0); //TODO : useless - DecalSurfaceData surfaceData; - ZERO_INITIALIZE(DecalSurfaceData, surfaceData); + DecalSurfaceData surfaceData; + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); VFXGetSurfaceDecalData(surfaceData,i,normalWS); outEmissive.rgb = surfaceData.emissive * GetCurrentExposureMultiplier(); outEmissive.a = 1.0f; diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template index d89fd6c15b1..ffeecf9ec76 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template @@ -1,8 +1,6 @@ { SubShader - { - Cull Back - + { ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXInclude("Shaders/ParticleHexahedron/PassSelection.template")} ${VFXIncludeRP("Templates/HDRPDecal/PassDBuffer.template")} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index ec04016f1e5..8f186d24579 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -113,8 +113,23 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP float albedoMapBlend = surfaceData.baseColor.a; float maskMapBlend = fadeFactor; + float metallic = 0.0f; + float smoothness = 0.5f; + float ao = 0.0f; +#ifdef VFX_VARYING_METALLIC + metallic = i.VFX_VARYING_METALLIC; +#endif +#ifdef VFX_VARYING_SMOOTHNESS + smoothness = i.VFX_VARYING_SMOOTHNESS; +#endif +#ifdef VFX_VARYING_AMBIENT_OCCLUSION + ao = i.VFX_VARYING_AMBIENT_OCCLUSION; +#endif + #if HDRP_USE_MASK_MAP float4 mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); + mask.xyz *= float3(metallic, ao, smoothness); + surfaceData.mask = mask; surfaceData.mask.z = surfaceData.mask.w; maskMapBlend = mask.z * fadeFactor; diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template new file mode 100644 index 00000000000..99575935e8a --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -0,0 +1,80 @@ +#define HDRP_NEEDS_UVS (HDRP_USE_BASE_COLOR_MAP || HDRP_USE_MASK_MAP || USE_NORMAL_MAP || HDRP_USE_EMISSIVE_MAP) +#define HDRP_USE_EMISSIVE (HDRP_USE_EMISSIVE_MAP || HDRP_USE_EMISSIVE_COLOR || HDRP_USE_ADDITIONAL_EMISSIVE_COLOR) + +${VFXBegin:VFXHDRPDecalVaryingsMacros} +#if (VFX_NEEDS_COLOR_INTERPOLATOR && HDRP_USE_BASE_COLOR) || HDRP_USE_ADDITIONAL_BASE_COLOR +#define VFX_VARYING_COLOR color.rgb +#define VFX_VARYING_ALPHA color.a +#endif + + +#define VFX_VARYING_METALLIC materialProperties.x +#define VFX_VARYING_AMBIENT_OCCLUSION materialProperties.y +#define VFX_VARYING_SMOOTHNESS materialProperties.z + +#if HDRP_USE_EMISSIVE_MAP +#define VFX_VARYING_EMISSIVESCALE materialProperties.w +#endif + +#if HDRP_USE_EMISSIVE_COLOR || HDRP_USE_ADDITIONAL_EMISSIVE_COLOR +#define VFX_VARYING_EMISSIVE emissiveColor.rgb +#endif + +#if USE_EXPOSURE_WEIGHT +#define VFX_VARYING_EXPOSUREWEIGHT emissiveColor.a +#endif +${VFXEnd} + +${VFXBegin:VFXHDRPDecalDeclareVaryings} + +#if (VFX_NEEDS_COLOR_INTERPOLATOR && HDRP_USE_BASE_COLOR) || HDRP_USE_ADDITIONAL_BASE_COLOR +VFX_OPTIONAL_INTERPOLATION float4 color : COLOR0; +#endif +#if HDRP_USE_EMISSIVE +VFX_OPTIONAL_INTERPOLATION float4 emissiveColor : COLOR1; +#endif + +// x: metallic +// y: AO +// z: smoothness +// w: emissive scale +VFX_OPTIONAL_INTERPOLATION float4 materialProperties : TEXCOORD0; +${VFXEnd} + +${VFXBegin:VFXHDRPDecalFillVaryings} +#ifndef VFX_SHADERGRAPH + +#ifdef VFX_VARYING_SMOOTHNESS +${VFXLoadParameter:{smoothness}} +o.VFX_VARYING_SMOOTHNESS = smoothness; +#endif + +#ifdef VFX_VARYING_METALLIC +${VFXLoadParameter:{metallic}} +o.VFX_VARYING_METALLIC = metallic; +#endif + +#if HDRP_USE_EMISSIVE_MAP +#ifdef VFX_VARYING_EMISSIVESCALE +${VFXLoadParameter:{emissiveScale}} +o.VFX_VARYING_EMISSIVESCALE = emissiveScale; +#endif +#endif + +#ifdef VFX_VARYING_EMISSIVE +#if HDRP_USE_EMISSIVE_COLOR +o.VFX_VARYING_EMISSIVE = attributes.color; +#elif HDRP_USE_ADDITIONAL_EMISSIVE_COLOR +${VFXLoadParameter:{emissiveColor}} +o.VFX_VARYING_EMISSIVE = emissiveColor.rgb; +#endif +#endif + +#if HDRP_USE_ADDITIONAL_BASE_COLOR +#ifdef VFX_VARYING_COLOR +${VFXLoadParameter:{baseColor}} +o.VFX_VARYING_COLOR = baseColor; +#endif +#endif +#endif +${VFXEnd} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta new file mode 100644 index 00000000000..2763d28d9dc --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1fd6932d360723e4c9d73b4c3fcc8e3a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From b889cfcea3f02859c9419ed56ffa843c10f440cf Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 26 May 2021 11:01:11 +0200 Subject: [PATCH 15/66] No angle fade if no decal layers --- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 15 +++++++++++---- .../Templates/HDRPDecal/PassDBuffer.template | 7 +++++-- .../Editor/VFXGraph/Shaders/VFXDecal.template | 15 ++++++++++----- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 07575048086..c001f46d076 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -84,20 +84,27 @@ public enum BlendSource Tooltip("Specifies the layer mask of the decal.")] private DecalLayerEnum decalLayer = DecalLayerEnum.LightLayerDefault; - public class FadingProperties + public class FadeFactorProperty { - [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? - public Vector2 angleFade = Vector2.zero; [Range(0, 1), Tooltip("Fade Factor.")] public float fadeFactor = 1.0f; } + + public class AngleFadeProperty + { + [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? + public Vector2 angleFade = Vector2.zero; + } protected override IEnumerable inputProperties { get { var properties = Enumerable.Empty(); - properties = properties.Concat(PropertiesFromType("FadingProperties")); + properties = properties.Concat(PropertiesFromType("FadeFactorProperty")); + if(enableDecalLayers) + properties = properties.Concat(PropertiesFromType("AngleFadeProperty")); + properties = properties.Concat(base.inputProperties); properties = properties.Concat( diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index ccdab9901d0..e53a6b37419 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -37,8 +37,11 @@ Pass #if VFX_ENABLE_DECAL_LAYERS float3 fadeParameters : TEXCOORD3; uint decalLayerMask : TEXCOORD4; + #else + float fadeParamaters : TEXCOORD3; #endif + nointerpolation float4 viewToDecal0 : TEXCOORD5; nointerpolation float4 viewToDecal1 : TEXCOORD6; nointerpolation float4 viewToDecal2 : TEXCOORD7; @@ -52,9 +55,9 @@ Pass #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv #define VFX_VARYING_POSWS posWS - #define VFX_VARYING_FADEFACTOR fadeParameters.z + #define VFX_VARYING_FADEFACTOR fadeParameters.x #if VFX_ENABLE_DECAL_LAYERS - #define VFX_VARYING_ANGLEFADE fadeParameters.xy + #define VFX_VARYING_ANGLEFADE fadeParameters.yz #define VFX_VARYING_DECALLAYER decalLayerMask #endif diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 8f186d24579..f3f2e4fa753 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -126,20 +126,25 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP ao = i.VFX_VARYING_AMBIENT_OCCLUSION; #endif - #if HDRP_USE_MASK_MAP +#if HDRP_USE_MASK_MAP float4 mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); mask.xyz *= float3(metallic, ao, smoothness); surfaceData.mask = mask; surfaceData.mask.z = surfaceData.mask.w; maskMapBlend = mask.z * fadeFactor; - #if VFX_MASK_BLEND_BASE_COLOR_ALPHA + + +#else //HDRP_USE_MASK_MAP + surfaceData.mask.xyz = float3(metallic, ao, smoothness); +#endif + +#if VFX_MASK_BLEND_BASE_COLOR_ALPHA surfaceData.mask.w = albedoMapBlend; - #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity +#elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; - #endif +#endif - #endif #if USE_NORMAL_MAP float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); From b6c79a1a0588cdc40bbd2a03c38eae27ea065103 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 26 May 2021 16:05:31 +0200 Subject: [PATCH 16/66] New "Affect xxx" settings. Sliders still appear in context --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 89 ++++++++++++++++++- .../Shaders/VFXDecalVaryings.template | 5 ++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index c001f46d076..a311663298d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; +using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.VFX.HDRP @@ -50,7 +51,7 @@ public class WithoutMaskMapProperties [Range(0, 1), Tooltip("Controls the metallic of the decal.")] public float metallic = 0.0f; [Range(0, 1), Tooltip("Controls the ambient occlusion of the decal.")] - public float ambientOcclusion = 0.0f; + public float ambientOcclusion = 1.0f; [Range(0, 1), Tooltip("Controls the smoothness of the decal.")] public float smoothness = 0.5f; } @@ -77,6 +78,23 @@ public enum BlendSource [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Mask Map.")] BlendSource maskOpacityChannel = BlendSource.BaseColorMapAlpha; + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + Tooltip("When enabled, this decal uses its base color. When disabled, the decal has no base color effect.")] + private bool affectBaseColor = true; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + Tooltip("When enabled, this decal uses the metallic channel of its Mask Map. When disabled, the decal has no metallic effect.")] + private bool affectMetal = true; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + Tooltip("When enabled, this decal uses the ambient occlusion channel of its Mask Map. When disabled, the decal has no ambient occlusion effect.")] + private bool affectAmbientOcclusion = true; + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + Tooltip("When enabled, this decal uses the smoothness channel of its Mask Map. When disabled, the decal has no smoothness effect.")] + private bool affectSmoothness = true; + + private bool enableDecalLayers => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers; @@ -203,5 +221,74 @@ public override IEnumerable additionalDefines } writer.WriteLine("Blend 3 Zero OneMinusSrcColor"); } + + protected VFXShaderWriter GetDecalMaskColor(int maskIndex) + { + var rs = new VFXShaderWriter(); + var maskString = ""; + switch (maskIndex) + { + case 0 : + // rs.Write(affectBaseColor ? ((int)ColorWriteMask.All).ToString() : "0"); break; + rs.Write(affectBaseColor ? "RBGA" : "0"); break; + case 1 : + rs.Write(useNormalMap ? "RGBA" : "0"); break; + case 2: + { + ColorWriteMask mask2 = 0; + if (affectMetal) + { + maskString += "R"; + } + + if (affectAmbientOcclusion) + { + maskString += "G"; + } + + if (affectSmoothness) + { + maskString += "BA"; + } + + if (String.IsNullOrEmpty(maskString)) + maskString = "0"; + rs.Write(maskString); + break; + } + case 3 : + ColorWriteMask mask3 = 0; + if (affectMetal) + { + maskString += "R"; + } + + if (affectAmbientOcclusion) + { + maskString += "G"; + } + if (String.IsNullOrEmpty(maskString)) + maskString = "0"; + rs.Write(maskString); + break; + } + + return rs; + } + + + public override IEnumerable> additionalReplacements + { + get + { + foreach (var rep in base.additionalReplacements) + yield return rep; + + for (int i = 0; i < 4; i++) + { + yield return new KeyValuePair("${VFXDecalColorMask" + i + "}", GetDecalMaskColor(i)); + } + } + } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template index 99575935e8a..a3ae1d8c8c3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -54,6 +54,11 @@ ${VFXLoadParameter:{metallic}} o.VFX_VARYING_METALLIC = metallic; #endif +#ifdef VFX_VARYING_AMBIENT_OCCLUSION +${VFXLoadParameter:{ambientOcclusion}} +o.VFX_VARYING_AMBIENT_OCCLUSION = ambientOcclusion; +#endif + #if HDRP_USE_EMISSIVE_MAP #ifdef VFX_VARYING_EMISSIVESCALE ${VFXLoadParameter:{emissiveScale}} From 62354ad259e9ccaa836dbff3d5bebfc916dd8e67 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 26 May 2021 16:06:02 +0200 Subject: [PATCH 17/66] Template to accept "Affect xxx" --- .../Shaders/Templates/HDRPDecal/PassDBuffer.template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index e53a6b37419..880c4775c60 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -9,10 +9,10 @@ Pass ZTest Greater - // ColorMask [_DecalColorMask0] - // ColorMask [_DecalColorMask1] 1 - // ColorMask [_DecalColorMask2] 2 - // ColorMask [_DecalColorMask3] 3 + ColorMask ${VFXDecalColorMask0} + ColorMask ${VFXDecalColorMask1} 1 + ColorMask ${VFXDecalColorMask2} 2 + ColorMask ${VFXDecalColorMask3} 3 HLSLPROGRAM #pragma target 4.5 From b3530d4000cdf7735f74b1ffb0374da8b750743e Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 26 May 2021 16:58:16 +0200 Subject: [PATCH 18/66] Enables "Affect xxx" --- .../VFXAbstractParticleHDRPLitOutput.cs | 2 + .../Outputs/VFXAbstractParticleHDRPOutput.cs | 2 - .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 59 +++++++++++++++---- .../Shaders/VFXDecalVaryings.template | 9 ++- 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs index df921ef7b90..5014e4ba72a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs @@ -118,6 +118,8 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (GetOrRefreshShaderGraphObject() == null) { + yield return slotExpressions.First(o => o.name == "smoothness"); + switch (materialType) { case MaterialType.Standard: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs index 7ebfd5229a4..f35f3f0630a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs @@ -153,8 +153,6 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (GetOrRefreshShaderGraphObject() == null) { - yield return slotExpressions.First(o => o.name == "smoothness"); - if (allowTextures) { if (useBaseColorMap != BaseColorMapMode.None) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index a311663298d..4f19974f71b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -66,6 +66,37 @@ public class WithMaskMapProperties public float smoothness = 1.0f; } + protected IEnumerable materialProperties + { + get + { + if(affectMetal) + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), + "metallic", + new TooltipAttribute(useMaskMap ? + "Controls the scale factor for the particle’s metallic." : + "Controls the metallic of the decal."), + new RangeAttribute(0,1)), 0.0f); + + if(affectAmbientOcclusion) + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), + "ambientOcclusion", + new TooltipAttribute(useMaskMap ? + "Controls the scale factor for the particle’s ambient occlusion." : + "Controls the ambient occlusion of the decal."), + new RangeAttribute(0,1)), 1.0f); + + if(affectSmoothness) + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), + "smoothness", + new TooltipAttribute(useMaskMap ? + "Controls the scale factor for the particle’s smoothness." : + "Controls the smoothness of the decal."), + new RangeAttribute(0,1)), 0.5f); + } + } + + public enum BlendSource { @@ -125,8 +156,7 @@ protected override IEnumerable inputProperties properties = properties.Concat(base.inputProperties); properties = - properties.Concat( - PropertiesFromType(useMaskMap ? "WithMaskMapProperties" : "WithoutMaskMapProperties")); + properties.Concat(materialProperties); return properties; } } @@ -139,8 +169,13 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (GetOrRefreshShaderGraphObject() == null) { yield return slotExpressions.First(o => o.name == "fadeFactor"); - yield return slotExpressions.First(o => o.name == "metallic"); - yield return slotExpressions.First(o => o.name == "ambientOcclusion"); + if(affectMetal) + yield return slotExpressions.First(o => o.name == "metallic"); + if(affectAmbientOcclusion) + yield return slotExpressions.First(o => o.name == "ambientOcclusion"); + if(affectSmoothness) + yield return slotExpressions.First(o => o.name == "smoothness"); + if(enableDecalLayers) { var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); @@ -190,21 +225,21 @@ public override IEnumerable additionalDefines foreach (var def in base.additionalDefines) yield return def; if (maskOpacityChannel == BlendSource.BaseColorMapAlpha) - { yield return "VFX_MASK_BLEND_BASE_COLOR_ALPHA"; - } else - { yield return "VFX_MASK_BLEND_MASK_BLUE"; - } + if (normalOpacityChannel == BlendSource.BaseColorMapAlpha) - { yield return "VFX_NORMAL_BLEND_BASE_COLOR_ALPHA"; - } else - { yield return "VFX_NORMAL_BLEND_MASK_BLUE"; - } + + if (affectMetal) + yield return "AFFECT_METALLIC"; + if (affectAmbientOcclusion) + yield return "AFFECT_AMBIENT_OCCLUSION"; + if (affectSmoothness) + yield return "AFFECT_SMOOTHNESS"; if(enableDecalLayers) { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template index a3ae1d8c8c3..7ed5407149b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -7,10 +7,17 @@ ${VFXBegin:VFXHDRPDecalVaryingsMacros} #define VFX_VARYING_ALPHA color.a #endif - +#if AFFECT_METALLIC #define VFX_VARYING_METALLIC materialProperties.x +#endif + +#if AFFECT_AMBIENT_OCCLUSION #define VFX_VARYING_AMBIENT_OCCLUSION materialProperties.y +#endif + +#if AFFECT_SMOOTHNESS #define VFX_VARYING_SMOOTHNESS materialProperties.z +#endif #if HDRP_USE_EMISSIVE_MAP #define VFX_VARYING_EMISSIVESCALE materialProperties.w From a6020987f2e2fd684179dc3083b9bbfa84a54e98 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 26 May 2021 17:57:05 +0200 Subject: [PATCH 19/66] Works without decal layers --- .../Shaders/Templates/HDRPDecal/PassDBuffer.template | 2 +- .../Templates/HDRPDecal/PassForwardEmissive.template | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 880c4775c60..07ad9b1ec82 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -38,7 +38,7 @@ Pass float3 fadeParameters : TEXCOORD3; uint decalLayerMask : TEXCOORD4; #else - float fadeParamaters : TEXCOORD3; + float fadeParameters : TEXCOORD3; #endif diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index eec18d2f209..c0940500e20 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -33,6 +33,8 @@ Pass #if VFX_ENABLE_DECAL_LAYERS float3 fadeParameters : TEXCOORD3; uint decalLayerMask : TEXCOORD4; + #else + float fadeParameters : TEXCOORD3; #endif nointerpolation float4 viewToDecal0 : TEXCOORD5; @@ -48,9 +50,9 @@ Pass #define VFX_VARYING_POSCS pos #define VFX_VARYING_UV uv #define VFX_VARYING_POSWS posWS - #define VFX_VARYING_FADEFACTOR fadeParameters.z + #define VFX_VARYING_FADEFACTOR fadeParameters.x #if VFX_ENABLE_DECAL_LAYERS - #define VFX_VARYING_ANGLEFADE fadeParameters.xy + #define VFX_VARYING_ANGLEFADE fadeParameters.yz #define VFX_VARYING_DECALLAYER decalLayerMask #endif From 58012dae0bbb0e341cf937d4314aea9ef42f41ae Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 27 May 2021 10:43:16 +0200 Subject: [PATCH 20/66] Change Angle Fade default value --- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 4f19974f71b..18b5806cf9f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -125,7 +125,6 @@ public enum BlendSource Tooltip("When enabled, this decal uses the smoothness channel of its Mask Map. When disabled, the decal has no smoothness effect.")] private bool affectSmoothness = true; - private bool enableDecalLayers => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers; @@ -142,7 +141,7 @@ public class FadeFactorProperty public class AngleFadeProperty { [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? - public Vector2 angleFade = Vector2.zero; + public Vector2 angleFade = new Vector2(0.0f, 180.0f); } protected override IEnumerable inputProperties { @@ -264,7 +263,6 @@ protected VFXShaderWriter GetDecalMaskColor(int maskIndex) switch (maskIndex) { case 0 : - // rs.Write(affectBaseColor ? ((int)ColorWriteMask.All).ToString() : "0"); break; rs.Write(affectBaseColor ? "RBGA" : "0"); break; case 1 : rs.Write(useNormalMap ? "RGBA" : "0"); break; From ea7725e9b671c5b14f2c397c2187c747ca12c19e Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 28 May 2021 14:01:50 +0200 Subject: [PATCH 21/66] Attempt to make pass enableDecalLayer as uniform --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 17 ++++---- .../Templates/HDRPDecal/PassDBuffer.template | 43 +------------------ .../HDRPDecal/PassForwardEmissive.template | 43 ------------------- .../Editor/VFXGraph/Shaders/VFXDecal.template | 20 ++++----- .../Shaders/VFXDecalVaryings.template | 31 +++++++++++++ 5 files changed, 50 insertions(+), 104 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 18b5806cf9f..bbd16d82756 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -19,6 +19,7 @@ public override void OnEnable() base.OnEnable(); blendMode = BlendMode.Opaque; useNormalScale = false; + // AssetDatabase.RegisterCustomDependency("HDRPSetting/supportDecalLayers", Hash128.Compute()); } public override IEnumerable attributes @@ -150,8 +151,7 @@ protected override IEnumerable inputProperties var properties = Enumerable.Empty(); properties = properties.Concat(PropertiesFromType("FadeFactorProperty")); - if(enableDecalLayers) - properties = properties.Concat(PropertiesFromType("AngleFadeProperty")); + properties = properties.Concat(PropertiesFromType("AngleFadeProperty")); properties = properties.Concat(base.inputProperties); properties = @@ -175,12 +175,15 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if(affectSmoothness) yield return slotExpressions.First(o => o.name == "smoothness"); - if(enableDecalLayers) - { + // if(enableDecalLayers) + // { var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); yield return new VFXNamedExpression(VFXValue.Constant((uint)decalLayer), "decalLayerMask"); - } + // } + // yield return new VFXNamedExpression(VFXValue.Constant(enableDecalLayers), "enableDecalLayers"); + yield return new VFXNamedExpression(new VFXValue(enableDecalLayers ? 1u : 0u, VFXValue.Mode.Variable), "enableDecalLayers"); + } } @@ -240,10 +243,6 @@ public override IEnumerable additionalDefines if (affectSmoothness) yield return "AFFECT_SMOOTHNESS"; - if(enableDecalLayers) - { - yield return "VFX_ENABLE_DECAL_LAYERS"; - } } } protected override void WriteBlendMode(VFXShaderWriter writer) //TODO : Not sure we need to do it here : different for DBuffer and ForwardEmissive pass diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 07ad9b1ec82..70b6bf11f10 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -29,57 +29,16 @@ Pass struct ps_input { float4 pos : SV_POSITION; - ${VFXHDRPDecalDeclareVaryings} - - float2 uv : TEXCOORD1; //unsure about the necessity of this one - float3 posWS : TEXCOORD2; - #if VFX_ENABLE_DECAL_LAYERS - float3 fadeParameters : TEXCOORD3; - uint decalLayerMask : TEXCOORD4; - #else - float fadeParameters : TEXCOORD3; - #endif - - - nointerpolation float4 viewToDecal0 : TEXCOORD5; - nointerpolation float4 viewToDecal1 : TEXCOORD6; - nointerpolation float4 viewToDecal2 : TEXCOORD7; - UNITY_VERTEX_OUTPUT_STEREO }; ${VFXHDRPDecalVaryingsMacros} - #define VFX_VARYING_PS_INPUTS ps_input - #define VFX_VARYING_POSCS pos - #define VFX_VARYING_UV uv - #define VFX_VARYING_POSWS posWS - #define VFX_VARYING_FADEFACTOR fadeParameters.x - #if VFX_ENABLE_DECAL_LAYERS - #define VFX_VARYING_ANGLEFADE fadeParameters.yz - #define VFX_VARYING_DECALLAYER decalLayerMask - #endif - ${VFXBegin:VFXVertexAdditionalProcess} - float4x4 viewToDecal = GetVFXToElementMatrix( - attributes.axisX, - attributes.axisY, - attributes.axisZ, - float3(attributes.angleX,attributes.angleY,attributes.angleZ), - float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), - size3, - attributes.position); - - #if VFX_LOCAL_SPACE - viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); - #endif - viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); - o.viewToDecal0 = viewToDecal[0]; - o.viewToDecal1 = viewToDecal[1]; - o.viewToDecal2 = viewToDecal[2]; + ${VFXBegin:VFXVertexAdditionalProcess} ${VFXHDRPDecalFillVaryings} ${VFXEnd} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index c0940500e20..16794049cfb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -25,56 +25,13 @@ Pass struct ps_input { float4 pos : SV_POSITION; - ${VFXHDRPDecalDeclareVaryings} - - float2 uv : TEXCOORD1; //unsure about the necessity of this one - float3 posWS : TEXCOORD2; - #if VFX_ENABLE_DECAL_LAYERS - float3 fadeParameters : TEXCOORD3; - uint decalLayerMask : TEXCOORD4; - #else - float fadeParameters : TEXCOORD3; - #endif - - nointerpolation float4 viewToDecal0 : TEXCOORD5; - nointerpolation float4 viewToDecal1 : TEXCOORD6; - nointerpolation float4 viewToDecal2 : TEXCOORD7; - UNITY_VERTEX_OUTPUT_STEREO }; ${VFXHDRPDecalVaryingsMacros} - #define VFX_VARYING_PS_INPUTS ps_input - #define VFX_VARYING_POSCS pos - #define VFX_VARYING_UV uv - #define VFX_VARYING_POSWS posWS - #define VFX_VARYING_FADEFACTOR fadeParameters.x - #if VFX_ENABLE_DECAL_LAYERS - #define VFX_VARYING_ANGLEFADE fadeParameters.yz - #define VFX_VARYING_DECALLAYER decalLayerMask - #endif - ${VFXBegin:VFXVertexAdditionalProcess} - float4x4 viewToDecal = GetVFXToElementMatrix( - attributes.axisX, - attributes.axisY, - attributes.axisZ, - float3(attributes.angleX,attributes.angleY,attributes.angleZ), - float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), - size3, - attributes.position); - - #if VFX_LOCAL_SPACE - viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); - #endif - viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); - o.viewToDecal0 = viewToDecal[0]; - o.viewToDecal1 = viewToDecal[1]; - o.viewToDecal2 = viewToDecal[2]; - //Move this somewhere else - ${VFXHDRPDecalFillVaryings} ${VFXEnd} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index f3f2e4fa753..3bc4f59ac23 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -14,22 +14,23 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP ZERO_INITIALIZE(DecalSurfaceData, surfaceData); VFXTransformPSInputs(i); +${VFXLoadParameter:{enableDecalLayers}} +${VFXLoadParameter:{decalLayerMask}} + +DecalPrepassData material; +ZERO_INITIALIZE(DecalPrepassData, material); //Check light layer -#if VFX_ENABLE_DECAL_LAYERS - DecalPrepassData material; - ZERO_INITIALIZE(DecalPrepassData, material); +if(enableDecalLayers) +{ // Clip the decal if it does not pass the decal layer mask of the receiving material. // Decal layer of the decal - uint decalLayerMask = i.VFX_VARYING_DECALLAYER; //TODO : Does it really need to be a Varying ? Can't I use VFXLoadParameter here ? - DecodeFromDecalPrepass(i.pos.xy, material); if ((decalLayerMask & material.decalLayerMask) == 0) { clip(-1); } - -#endif +} float3 clipPos; clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; @@ -72,15 +73,14 @@ void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INP float3x3 worldToElement = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //Transposed//TODO: Won't be correct for non-uniform scalings worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it -#if VFX_ENABLE_DECAL_LAYERS - if (i.VFX_VARYING_ANGLEFADE.y < 0.0f) // if angle fade is enabled + + if (enableDecalLayers && i.VFX_VARYING_ANGLEFADE.y < 0.0f) // if angle fade is enabled { float3 decalNormal = normalize(worldToElement[2].xyz); float dotAngle = dot(material.geomNormalWS, decalNormal); // See equation in DecalSystem.cs - simplified to a madd mul add here angleFadeFactor = saturate(i.VFX_VARYING_ANGLEFADE.x + i.VFX_VARYING_ANGLEFADE.y * (dotAngle * (dotAngle - 2.0f))); } -#endif float fadeFactor = i.VFX_VARYING_FADEFACTOR; fadeFactor *= angleFadeFactor; #if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template index 7ed5407149b..3cc2f062e8a 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -30,6 +30,13 @@ ${VFXBegin:VFXHDRPDecalVaryingsMacros} #if USE_EXPOSURE_WEIGHT #define VFX_VARYING_EXPOSUREWEIGHT emissiveColor.a #endif + +#define VFX_VARYING_PS_INPUTS ps_input +#define VFX_VARYING_POSCS pos +#define VFX_VARYING_UV uv +#define VFX_VARYING_POSWS posWS +#define VFX_VARYING_FADEFACTOR fadeParameters.x +#define VFX_VARYING_ANGLEFADE fadeParameters.yz ${VFXEnd} ${VFXBegin:VFXHDRPDecalDeclareVaryings} @@ -46,6 +53,13 @@ VFX_OPTIONAL_INTERPOLATION float4 emissiveColor : COLOR1; // z: smoothness // w: emissive scale VFX_OPTIONAL_INTERPOLATION float4 materialProperties : TEXCOORD0; +float2 uv : TEXCOORD1; //unsure about the necessity of this one +float3 posWS : TEXCOORD2; +float3 fadeParameters : TEXCOORD3; + +nointerpolation float4 viewToDecal0 : TEXCOORD5; +nointerpolation float4 viewToDecal1 : TEXCOORD6; +nointerpolation float4 viewToDecal2 : TEXCOORD7; ${VFXEnd} ${VFXBegin:VFXHDRPDecalFillVaryings} @@ -89,4 +103,21 @@ o.VFX_VARYING_COLOR = baseColor; #endif #endif #endif + +float4x4 viewToDecal = GetVFXToElementMatrix( + attributes.axisX, + attributes.axisY, + attributes.axisZ, + float3(attributes.angleX,attributes.angleY,attributes.angleZ), + float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), + size3, + attributes.position); + +#if VFX_LOCAL_SPACE +viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); +#endif +viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); +o.viewToDecal0 = viewToDecal[0]; +o.viewToDecal1 = viewToDecal[1]; +o.viewToDecal2 = viewToDecal[2]; ${VFXEnd} From db2df27ff09b1cf6720671ee08a6ab7018a27bd2 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 28 May 2021 14:40:26 +0200 Subject: [PATCH 22/66] Gather Varyings in VFXDecalVaryings.template --- .../Templates/HDRPDecal/PassDBuffer.template | 44 ------------------- .../HDRPDecal/PassForwardEmissive.template | 43 ------------------ .../Shaders/VFXDecalVaryings.template | 40 +++++++++++++++++ 3 files changed, 40 insertions(+), 87 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 07ad9b1ec82..ca0a920b69d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -29,57 +29,13 @@ Pass struct ps_input { float4 pos : SV_POSITION; - ${VFXHDRPDecalDeclareVaryings} - - float2 uv : TEXCOORD1; //unsure about the necessity of this one - float3 posWS : TEXCOORD2; - #if VFX_ENABLE_DECAL_LAYERS - float3 fadeParameters : TEXCOORD3; - uint decalLayerMask : TEXCOORD4; - #else - float fadeParameters : TEXCOORD3; - #endif - - - nointerpolation float4 viewToDecal0 : TEXCOORD5; - nointerpolation float4 viewToDecal1 : TEXCOORD6; - nointerpolation float4 viewToDecal2 : TEXCOORD7; - UNITY_VERTEX_OUTPUT_STEREO }; ${VFXHDRPDecalVaryingsMacros} - #define VFX_VARYING_PS_INPUTS ps_input - #define VFX_VARYING_POSCS pos - #define VFX_VARYING_UV uv - #define VFX_VARYING_POSWS posWS - #define VFX_VARYING_FADEFACTOR fadeParameters.x - #if VFX_ENABLE_DECAL_LAYERS - #define VFX_VARYING_ANGLEFADE fadeParameters.yz - #define VFX_VARYING_DECALLAYER decalLayerMask - #endif - - ${VFXBegin:VFXVertexAdditionalProcess} - float4x4 viewToDecal = GetVFXToElementMatrix( - attributes.axisX, - attributes.axisY, - attributes.axisZ, - float3(attributes.angleX,attributes.angleY,attributes.angleZ), - float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), - size3, - attributes.position); - - #if VFX_LOCAL_SPACE - viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); - #endif - viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); - o.viewToDecal0 = viewToDecal[0]; - o.viewToDecal1 = viewToDecal[1]; - o.viewToDecal2 = viewToDecal[2]; - ${VFXHDRPDecalFillVaryings} ${VFXEnd} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index c0940500e20..16794049cfb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -25,56 +25,13 @@ Pass struct ps_input { float4 pos : SV_POSITION; - ${VFXHDRPDecalDeclareVaryings} - - float2 uv : TEXCOORD1; //unsure about the necessity of this one - float3 posWS : TEXCOORD2; - #if VFX_ENABLE_DECAL_LAYERS - float3 fadeParameters : TEXCOORD3; - uint decalLayerMask : TEXCOORD4; - #else - float fadeParameters : TEXCOORD3; - #endif - - nointerpolation float4 viewToDecal0 : TEXCOORD5; - nointerpolation float4 viewToDecal1 : TEXCOORD6; - nointerpolation float4 viewToDecal2 : TEXCOORD7; - UNITY_VERTEX_OUTPUT_STEREO }; ${VFXHDRPDecalVaryingsMacros} - #define VFX_VARYING_PS_INPUTS ps_input - #define VFX_VARYING_POSCS pos - #define VFX_VARYING_UV uv - #define VFX_VARYING_POSWS posWS - #define VFX_VARYING_FADEFACTOR fadeParameters.x - #if VFX_ENABLE_DECAL_LAYERS - #define VFX_VARYING_ANGLEFADE fadeParameters.yz - #define VFX_VARYING_DECALLAYER decalLayerMask - #endif - ${VFXBegin:VFXVertexAdditionalProcess} - float4x4 viewToDecal = GetVFXToElementMatrix( - attributes.axisX, - attributes.axisY, - attributes.axisZ, - float3(attributes.angleX,attributes.angleY,attributes.angleZ), - float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), - size3, - attributes.position); - - #if VFX_LOCAL_SPACE - viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); - #endif - viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); - o.viewToDecal0 = viewToDecal[0]; - o.viewToDecal1 = viewToDecal[1]; - o.viewToDecal2 = viewToDecal[2]; - //Move this somewhere else - ${VFXHDRPDecalFillVaryings} ${VFXEnd} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template index 7ed5407149b..3e058a7549f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -30,6 +30,16 @@ ${VFXBegin:VFXHDRPDecalVaryingsMacros} #if USE_EXPOSURE_WEIGHT #define VFX_VARYING_EXPOSUREWEIGHT emissiveColor.a #endif + +#define VFX_VARYING_PS_INPUTS ps_input +#define VFX_VARYING_POSCS pos +#define VFX_VARYING_UV uv +#define VFX_VARYING_POSWS posWS +#define VFX_VARYING_FADEFACTOR fadeParameters.x +#if VFX_ENABLE_DECAL_LAYERS +#define VFX_VARYING_ANGLEFADE fadeParameters.yz +#define VFX_VARYING_DECALLAYER decalLayerMask +#endif ${VFXEnd} ${VFXBegin:VFXHDRPDecalDeclareVaryings} @@ -46,6 +56,19 @@ VFX_OPTIONAL_INTERPOLATION float4 emissiveColor : COLOR1; // z: smoothness // w: emissive scale VFX_OPTIONAL_INTERPOLATION float4 materialProperties : TEXCOORD0; +float2 uv : TEXCOORD1; //unsure about the necessity of this one +float3 posWS : TEXCOORD2; +#if VFX_ENABLE_DECAL_LAYERS +float3 fadeParameters : TEXCOORD3; +uint decalLayerMask : TEXCOORD4; +#else +float fadeParameters : TEXCOORD3; +#endif + +nointerpolation float4 viewToDecal0 : TEXCOORD5; +nointerpolation float4 viewToDecal1 : TEXCOORD6; +nointerpolation float4 viewToDecal2 : TEXCOORD7; + ${VFXEnd} ${VFXBegin:VFXHDRPDecalFillVaryings} @@ -89,4 +112,21 @@ o.VFX_VARYING_COLOR = baseColor; #endif #endif #endif +float4x4 viewToDecal = GetVFXToElementMatrix( + attributes.axisX, + attributes.axisY, + attributes.axisZ, + float3(attributes.angleX,attributes.angleY,attributes.angleZ), + float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), + size3, + attributes.position); + +#if VFX_LOCAL_SPACE +viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); +#endif +viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); +o.viewToDecal0 = viewToDecal[0]; +o.viewToDecal1 = viewToDecal[1]; +o.viewToDecal2 = viewToDecal[2]; + ${VFXEnd} From 83b9292ee8375e99b4c536c9964b965b01ce4d1e Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 10:15:44 +0200 Subject: [PATCH 23/66] Do not transfert the blendMode setting to decal outputs --- .../Editor/GraphView/Elements/VFXContextUI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs index 8c4e57cad2c..bb51dfdb7c4 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs @@ -814,7 +814,8 @@ void ConvertContext(VFXNodeProvider.Descriptor d, Vector2 mPos) var contextType = controller.model.GetType(); foreach (var setting in newContextController.model.GetSettings(true)) { - if ((newContextController.model is VFXPlanarPrimitiveOutput || newContextController.model.GetType().Name == "VFXLitPlanarPrimitiveOutput") && setting.field.Name == "primitiveType") + if (((newContextController.model is VFXPlanarPrimitiveOutput || newContextController.model.GetType().Name == "VFXLitPlanarPrimitiveOutput") && setting.field.Name == "primitiveType") || + (newContextController.model.GetType().Name == "VFXDecalHDRPOutput" && setting.field.Name == "blendMode")) //TODO : These are not the only outputs/settings that do not support conversion correctly, need a cleaner way to handle those continue; if (!setting.valid || setting.field.GetCustomAttributes(typeof(VFXSettingAttribute), true).Length == 0) From 56996701fd6a81c379596f43307ea77eb40e60a0 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 11:38:18 +0200 Subject: [PATCH 24/66] Use Global uniform _EnableDecalLayers --- .../Outputs/VFXAbstractParticleHDRPLitOutput.cs | 6 ------ .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 16 +++++----------- .../Editor/VFXGraph/Shaders/VFXDecal.template | 10 +++++++--- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs index 5014e4ba72a..de372d06b20 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPLitOutput.cs @@ -26,12 +26,6 @@ public enum MaterialType "TranslucentProperties", }; - protected bool GeneratesWithShaderGraph() - { - return GetOrRefreshShaderGraphObject() != null && - GetOrRefreshShaderGraphObject().generatesWithShaderGraph; - } - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Header("Lighting"), Tooltip("Specifies the surface type of this output. Surface types determine how the particle will react to light.")] protected MaterialType materialType = MaterialType.Standard; diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index bbd16d82756..45b99428b20 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -19,7 +19,6 @@ public override void OnEnable() base.OnEnable(); blendMode = BlendMode.Opaque; useNormalScale = false; - // AssetDatabase.RegisterCustomDependency("HDRPSetting/supportDecalLayers", Hash128.Compute()); } public override IEnumerable attributes @@ -175,14 +174,11 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if(affectSmoothness) yield return slotExpressions.First(o => o.name == "smoothness"); - // if(enableDecalLayers) - // { - var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); - yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); - yield return new VFXNamedExpression(VFXValue.Constant((uint)decalLayer), "decalLayerMask"); - // } - // yield return new VFXNamedExpression(VFXValue.Constant(enableDecalLayers), "enableDecalLayers"); - yield return new VFXNamedExpression(new VFXValue(enableDecalLayers ? 1u : 0u, VFXValue.Mode.Variable), "enableDecalLayers"); + + var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); + yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); + yield return new VFXNamedExpression(VFXValue.Constant((uint)decalLayer), "decalLayerMask"); + } } @@ -267,7 +263,6 @@ protected VFXShaderWriter GetDecalMaskColor(int maskIndex) rs.Write(useNormalMap ? "RGBA" : "0"); break; case 2: { - ColorWriteMask mask2 = 0; if (affectMetal) { maskString += "R"; @@ -289,7 +284,6 @@ protected VFXShaderWriter GetDecalMaskColor(int maskIndex) break; } case 3 : - ColorWriteMask mask3 = 0; if (affectMetal) { maskString += "R"; diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 3bc4f59ac23..2418e60c808 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -20,7 +20,7 @@ ${VFXLoadParameter:{decalLayerMask}} DecalPrepassData material; ZERO_INITIALIZE(DecalPrepassData, material); //Check light layer -if(enableDecalLayers) +if(_EnableDecalLayers) { // Clip the decal if it does not pass the decal layer mask of the receiving material. // Decal layer of the decal @@ -73,14 +73,18 @@ if(enableDecalLayers) float3x3 worldToElement = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //Transposed//TODO: Won't be correct for non-uniform scalings worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it - - if (enableDecalLayers && i.VFX_VARYING_ANGLEFADE.y < 0.0f) // if angle fade is enabled +//#if VFX_ENABLE_DECAL_LAYERS +if(_EnableDecalLayers) +{ + if (i.VFX_VARYING_ANGLEFADE.y < 0.0f) // if angle fade is enabled { float3 decalNormal = normalize(worldToElement[2].xyz); float dotAngle = dot(material.geomNormalWS, decalNormal); // See equation in DecalSystem.cs - simplified to a madd mul add here angleFadeFactor = saturate(i.VFX_VARYING_ANGLEFADE.x + i.VFX_VARYING_ANGLEFADE.y * (dotAngle * (dotAngle - 2.0f))); } +} +//#endif float fadeFactor = i.VFX_VARYING_FADEFACTOR; fadeFactor *= angleFadeFactor; #if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR From a06dba19d12e2e2caa9a347731cbff92a6046243 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 11:49:14 +0200 Subject: [PATCH 25/66] folder meta --- .../Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta new file mode 100644 index 00000000000..090217f6209 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81cd7f821cd55c944b0efd22abaee343 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 2f9c48f042e6316797d71db486d69a0f27cd6399 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 14:02:14 +0200 Subject: [PATCH 26/66] Displayed MinMaxSlider (not functionnal) --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 2 +- .../Editor/Controls/VFXMinMaxSliderField.cs | 22 +++++-------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 45b99428b20..28ddfbdf2e1 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -140,7 +140,7 @@ public class FadeFactorProperty public class AngleFadeProperty { - [Tooltip("Angle Fade. Between 0 and 180.")] //TODO : create range attribute? + [Tooltip("Angle Fade. Between 0 and 180."), MinMax(0.0f, 180.0f)] //TODO : create range attribute? public Vector2 angleFade = new Vector2(0.0f, 180.0f); } protected override IEnumerable inputProperties diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs index 0b1f4608b65..2aeb3b01133 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs @@ -13,8 +13,6 @@ class VFXMinMaxSliderField : VisualElement, INotifyValueChanged { protected MinMaxSlider m_Slider; VisualElement m_IndeterminateLabel; - Vector2Field m_Vector2Field; - class StartFinishSliderManipulator : Manipulator { @@ -76,32 +74,24 @@ protected void ValueDragStarted() public VFXMinMaxSliderField() { - AddToClassList("sliderField"); - m_Slider = new MinMaxSlider(0,1, Single.MinValue, 1); - // m_Slider = new MinMaxSlider("Value"); + AddToClassList("sliderMinMaxField"); + m_Slider = new MinMaxSlider(1,10, 0, 100); + m_Slider.AddToClassList("textfield"); m_Slider.RegisterValueChangedCallback(evt => ValueChanged(evt.newValue)); - - m_Vector2Field = new Vector2Field(); - m_Vector2Field.RegisterValueChangedCallback(ValueChanged); - m_Vector2Field.name = "Field"; - - m_IndeterminateLabel = new Label() { name = "indeterminate", text = VFXControlConstants.indeterminateText }; m_IndeterminateLabel.SetEnabled(false); + m_Slider.RegisterValueChangedCallback(ValueChanged); Add(m_Slider); - Add(m_Vector2Field); RegisterCallBack(); } protected void RegisterCallBack() { - (m_Vector2Field as VisualElement).RegisterCallback(OnFocusLost); - m_Slider.Children().First().AddManipulator(new StartFinishSliderManipulator()); } @@ -174,8 +164,6 @@ public void SetValueWithoutNotify(Vector2 newValue) m_IgnoreNotification = true; m_Value = newValue; tooltip = newValue.ToString(); - if (!hasFocus) - m_Vector2Field.value = newValue; m_Slider.value = value; m_IgnoreNotification = false; } @@ -218,7 +206,7 @@ public bool hasFocus { get { - return m_Slider.HasFocus() || m_Vector2Field.HasFocus() || (panel != null && panel.focusController.focusedElement == m_Vector2Field as VisualElement); + return m_Slider.HasFocus(); } } } From cb2ea7e4b975af530c0331ba9fbae9d87828058c Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 14:10:45 +0200 Subject: [PATCH 27/66] Functional MinMax Slider, still needs polish (overflow, on focus etc.) --- .../Editor/Controls/VFXMinMaxSliderField.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs index 2aeb3b01133..1b487983119 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs @@ -133,12 +133,10 @@ public Vector2 range { m_Range = value; m_IgnoreNotification = true; - if (m_Slider.minValue != m_Range.x || m_Slider.maxValue != m_Range.y) + if (m_Slider.lowLimit != m_Range.x || m_Slider.highLimit != m_Range.y) { - m_Slider.minValue = m_Range.x; - m_Slider.maxValue = m_Range.y; - - m_Slider.value = m_Range; + m_Slider.lowLimit = m_Range.x; + m_Slider.highLimit = m_Range.y; } m_IgnoreNotification = false; } From 6eb8c2b0ba89b3f3c15f1cb0352729741b2e2a38 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 14:41:22 +0200 Subject: [PATCH 28/66] Fix overflow -> visible --- .../Editor/Controls/VFXMinMaxSliderField.cs | 2 +- .../Editor/UIResources/uss/VFXControls.uss | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs index 1b487983119..1d924706fe9 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs @@ -77,7 +77,7 @@ public VFXMinMaxSliderField() AddToClassList("sliderMinMaxField"); m_Slider = new MinMaxSlider(1,10, 0, 100); - m_Slider.AddToClassList("textfield"); + // m_Slider.AddToClassList("textfield"); m_Slider.RegisterValueChangedCallback(evt => ValueChanged(evt.newValue)); m_IndeterminateLabel = new Label() { diff --git a/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss b/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss index 76a12e1c019..c6525189c6b 100644 --- a/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss +++ b/com.unity.visualeffectgraph/Editor/UIResources/uss/VFXControls.uss @@ -59,9 +59,20 @@ VFXColorField #indeterminate flex:0 0 auto; } -.unity-min-max-slider +.sliderMinMaxField +{ + flex-direction:row; +} + +.sliderMinMaxField .unity-min-max-slider { flex:1 0 auto; + overflow: visible; +} +.sliderMinMaxField #indeterminate +{ + width: 40px; + flex:0 0 auto; } .PopupButton From 2c58ec5fce4cb9beddc3207f44d2923adef7070f Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 14:43:18 +0200 Subject: [PATCH 29/66] Custom Vector2 Property --- .../Views/Properties/Vector2PropertyRM.cs | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs new file mode 100644 index 00000000000..ec5d9a7d19d --- /dev/null +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs @@ -0,0 +1,122 @@ +using UnityEditor.UIElements; +using UnityEditor.VFX.UI; +using UnityEngine; +using UnityEngine.UIElements; + +namespace UnityEditor.VFX.UI + +{ + class Vector2PropertyRM : SimpleUIPropertyRM + { + VFXVector2Field m_VectorField; + protected VFXMinMaxSliderField m_Slider; + + public Vector2PropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth) + { } + + private void ValueDragStarted() + { + m_Provider.StartLiveModification(); + } + + private void ValueDragFinished() + { + m_Provider.EndLiveModification(); + hasChangeDelayed = false; + NotifyValueChanged(); + } + + public override float GetPreferredControlWidth() + { + return 100; + } + + public override INotifyValueChanged CreateField() + { + INotifyValueChanged result; + bool isMinMax = m_Provider.attributes.Is(VFXPropertyAttributes.Type.MinMax); + if (isMinMax) + { + Vector2 range = m_Provider.attributes.FindRange(); + result = CreateSliderField(out m_Slider); + m_Slider.onValueDragFinished = ValueDragFinished; + m_Slider.onValueDragStarted = ValueDragStarted; + m_Slider.RegisterCallback(OnFocusLost); + m_Slider.range = range; + } + else + { + result = CreateSimpleField(out m_VectorField); + } + + return result; + } + void OnFocusLost(BlurEvent e) + { + DelayedNotifyValueChange(); + UpdateGUI(true); + } + void DelayedNotifyValueChange() + { + if (isDelayed && hasChangeDelayed) + { + hasChangeDelayed = false; + NotifyValueChanged(); + } + } + + protected override void UpdateIndeterminate() + { + if (m_Slider != null) + m_Slider.indeterminate = indeterminate; + } + public override void UpdateGUI(bool force) + { + if (m_Slider != null) + { + Vector2 range = m_Provider.attributes.FindRange(); + + m_Slider.range = range; + } + base.UpdateGUI(force); + } + + public override object FilterValue(object value) + { + Vector2 range = m_Provider.attributes.FindRange(); + + if (range != Vector2.zero) + { + var vectorValue = (Vector2)value; + vectorValue.x = Mathf.Clamp(vectorValue.x, range.x, range.y); + vectorValue.y = Mathf.Clamp(vectorValue.y, range.x, range.y); + return vectorValue; + } + + return value; + } + + protected override bool HasFocus() + { + if (m_Slider != null) + return m_Slider.HasFocus(); + if (m_VectorField != null) + return m_VectorField.HasFocus(); + return false; + } + protected INotifyValueChanged CreateSliderField(out VFXMinMaxSliderField slider) + { + var field = new VFXLabeledField(m_Label); + slider = field.control; + return field; + } + protected INotifyValueChanged CreateSimpleField(out VFXVector2Field textField) + { + var field = new VFXLabeledField(m_Label); + field.onValueDragFinished = t => ValueDragFinished(); + field.onValueDragStarted = t => ValueDragStarted(); + textField = field.control; + return field; + } + } +} From 6bf977ec36f4b9df20a14b11543b6c52512106ca Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 31 May 2021 17:02:25 +0200 Subject: [PATCH 30/66] No useBaseColorMap option when not affecting BaseColor --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 28ddfbdf2e1..3783c472fde 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -195,6 +195,22 @@ VFXExpression AngleFadeSimplification(VFXExpression angleFadeExp) return simplifiedAngleFade; } + public override void OnSettingModified(VFXSetting setting) + { + base.OnSettingModified(setting); + if (setting.name == "affectBaseColor") + { + if (!affectBaseColor) + { + useBaseColorMap = BaseColorMapMode.Alpha; + } + else + { + useBaseColorMap = BaseColorMapMode.ColorAndAlpha; + } + } + } + protected override IEnumerable filteredOutSettings { get @@ -213,6 +229,8 @@ protected override IEnumerable filteredOutSettings if (!enableDecalLayers) yield return "decalLayer"; + if (!affectBaseColor) + yield return "useBaseColorMap"; } } From 5ce795356fc3f55278caf9aa3df380778079b275 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 1 Jun 2021 14:45:26 +0200 Subject: [PATCH 31/66] No global blend states (different for DBuffer and ForwardEmissive) --- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 9 --------- .../Shaders/Templates/HDRPDecal/PassDBuffer.template | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 3783c472fde..2ec49719574 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -259,15 +259,6 @@ public override IEnumerable additionalDefines } } - protected override void WriteBlendMode(VFXShaderWriter writer) //TODO : Not sure we need to do it here : different for DBuffer and ForwardEmissive pass - { - // using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html - for (int i = 0; i < 3; i++) - { - writer.WriteLineFormat("Blend {0} SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha", i); - } - writer.WriteLine("Blend 3 Zero OneMinusSrcColor"); - } protected VFXShaderWriter GetDecalMaskColor(int maskIndex) { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index ca0a920b69d..8099de77450 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -9,6 +9,13 @@ Pass ZTest Greater + // using alpha compositing https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch23.html + Blend 0 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha + Blend 1 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha + Blend 2 SrcAlpha OneMinusSrcAlpha, Zero OneMinusSrcAlpha + Blend 3 Zero OneMinusSrcColor + + ColorMask ${VFXDecalColorMask0} ColorMask ${VFXDecalColorMask1} 1 ColorMask ${VFXDecalColorMask2} 2 From c1fc7c1c60661c95965149fa07dcfab32a260177 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 1 Jun 2021 14:45:58 +0200 Subject: [PATCH 32/66] Forward Emissive pass only when needed --- .../VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template index ffeecf9ec76..2d0913e9fc4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template @@ -4,8 +4,6 @@ ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXInclude("Shaders/ParticleHexahedron/PassSelection.template")} ${VFXIncludeRP("Templates/HDRPDecal/PassDBuffer.template")} - ${VFXIncludeRP("Templates/HDRPDecal/PassForwardEmissive.template")} - - + ${VFXIncludeRP("Templates/HDRPDecal/PassForwardEmissive.template", HDRP_USE_EMISSIVE_MAP | HDRP_USE_EMISSIVE_COLOR | HDRP_USE_ADDITIONAL_EMISSIVE_COLOR)} } } From d8698bee94bebc0f1f006f06ce8364b45ddb8610 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 1 Jun 2021 15:10:31 +0200 Subject: [PATCH 33/66] HDRP Decal doesn't support QueueSelection --- .../Editor/VFXGraph/VFXHDRPSubOutput.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs index f3a51a02169..1e3a97b4665 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs @@ -81,7 +81,7 @@ public override void OnSettingModified(VFXSetting setting) } protected bool isLit => owner is VFXAbstractParticleHDRPLitOutput; - protected bool supportsQueueSelection => !(owner is VFXAbstractDistortionOutput); // TODO Should be made in a more abstract way + protected bool supportsQueueSelection => !((owner is VFXAbstractDistortionOutput) || (owner is VFXDecalHDRPOutput)); // TODO Should be made in a more abstract way public override IEnumerable GetFilteredOutEnumerators(string name) { From 31c84e93fadaaa772444f90966307bacc78e1203 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 1 Jun 2021 16:58:06 +0200 Subject: [PATCH 34/66] Create variants for DECALS_4RT --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 5 + .../Templates/HDRPDecal/PassDBuffer.template | 9 +- .../HDRPDecal/PassForwardEmissive.template | 3 +- .../Templates/VFXParticleHDRPDecal.template | 2 +- .../Editor/VFXGraph/Shaders/VFXDecal.template | 109 +++++++++--------- 5 files changed, 65 insertions(+), 63 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 2ec49719574..c491f47e8a8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -19,6 +19,7 @@ public override void OnEnable() base.OnEnable(); blendMode = BlendMode.Opaque; useNormalScale = false; + sort = SortMode.Off; } public override IEnumerable attributes @@ -226,6 +227,8 @@ protected override IEnumerable filteredOutSettings yield return "zWriteMode"; yield return "castShadows"; yield return "materialType"; + yield return "sort"; + // yield return "useSoftParticle"; if (!enableDecalLayers) yield return "decalLayer"; @@ -256,6 +259,8 @@ public override IEnumerable additionalDefines yield return "AFFECT_AMBIENT_OCCLUSION"; if (affectSmoothness) yield return "AFFECT_SMOOTHNESS"; + if (useEmissive || useEmissiveMap) + yield return "NEEDS_FORWARD_EMISSIVE_PASS"; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 8099de77450..1f677a9ba16 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -25,6 +25,7 @@ Pass #pragma target 4.5 #pragma multi_compile _ LIGHT_LAYERS #pragma multi_compile _ DEBUG_DISPLAY + #pragma multi_compile_fragment DECALS_3RT DECALS_4RT #define UNITY_MATERIAL_LIT @@ -47,21 +48,15 @@ Pass ${VFXEnd} -//TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one ${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #define SHADERPASS SHADERPASS_VFX_DBUFFER_PROJECTOR ${VFXIncludeRP("VFXDecal.template")} - - -//EndTODO - #pragma fragment frag void frag(ps_input i, OUTPUT_DBUFFER(outDBuffer)) { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); - float3 normalWS = float3(0,1,0); //TODO : compute it properly - VFXComputePixelOutputToDBuffer(i, normalWS,outDBuffer); + VFXComputePixelOutputToDBuffer(i,outDBuffer); } ENDHLSL } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index 16794049cfb..fe4b1fc68e7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -50,10 +50,9 @@ ${VFXIncludeRP("VFXDecal.template")} void frag(ps_input i, out float4 outEmissive : SV_Target0) { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); - float3 normalWS = float3(0,1,0); //TODO : useless DecalSurfaceData surfaceData; ZERO_INITIALIZE(DecalSurfaceData, surfaceData); - VFXGetSurfaceDecalData(surfaceData,i,normalWS); + VFXGetSurfaceDecalData(surfaceData,i); outEmissive.rgb = surfaceData.emissive * GetCurrentExposureMultiplier(); outEmissive.a = 1.0f; } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template index 2d0913e9fc4..caf4f8facdd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleHDRPDecal.template @@ -4,6 +4,6 @@ ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXInclude("Shaders/ParticleHexahedron/PassSelection.template")} ${VFXIncludeRP("Templates/HDRPDecal/PassDBuffer.template")} - ${VFXIncludeRP("Templates/HDRPDecal/PassForwardEmissive.template", HDRP_USE_EMISSIVE_MAP | HDRP_USE_EMISSIVE_COLOR | HDRP_USE_ADDITIONAL_EMISSIVE_COLOR)} + ${VFXIncludeRP("Templates/HDRPDecal/PassForwardEmissive.template"), NEEDS_FORWARD_EMISSIVE_PASS} } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 2418e60c808..b98838c28ae 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -1,15 +1,15 @@ //TODO : Check for unnecessary includes / and for necessary ones -#define VFXComputePixelOutputToDBuffer(i, normalWS,outDBuffer) \ +#define VFXComputePixelOutputToDBuffer(i,outDBuffer) \ { \ DecalSurfaceData surfaceData; \ ZERO_INITIALIZE(DecalSurfaceData, surfaceData); \ - VFXGetSurfaceDecalData(surfaceData,i,normalWS); \ + VFXGetSurfaceDecalData(surfaceData,i); \ \ ENCODE_INTO_DBUFFER(surfaceData, outDBuffer); \ } -void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INPUTS i, float3 normalWS) +void VFXGetSurfaceDecalData(out DecalSurfaceData surfaceData, VFX_VARYING_PS_INPUTS i) { ZERO_INITIALIZE(DecalSurfaceData, surfaceData); VFXTransformPSInputs(i); @@ -43,7 +43,7 @@ if(_EnableDecalLayers) if(IsPerspectiveProjection()) { - clipPos *= VFXLinearEyeDepth(clipPos.z); //TODO: Does not work with Orthographic projection + clipPos *= VFXLinearEyeDepth(clipPos.z); viewPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; viewPos.y = clipPos.y / UNITY_MATRIX_P[1][1]; viewPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; @@ -73,7 +73,6 @@ if(_EnableDecalLayers) float3x3 worldToElement = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //Transposed//TODO: Won't be correct for non-uniform scalings worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it -//#if VFX_ENABLE_DECAL_LAYERS if(_EnableDecalLayers) { if (i.VFX_VARYING_ANGLEFADE.y < 0.0f) // if angle fade is enabled @@ -84,10 +83,9 @@ if(_EnableDecalLayers) angleFadeFactor = saturate(i.VFX_VARYING_ANGLEFADE.x + i.VFX_VARYING_ANGLEFADE.y * (dotAngle * (dotAngle - 2.0f))); } } -//#endif float fadeFactor = i.VFX_VARYING_FADEFACTOR; fadeFactor *= angleFadeFactor; - #if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR +#if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR float4 color = float4(1,1,1,1); #if HDRP_USE_BASE_COLOR @@ -116,55 +114,60 @@ if(_EnableDecalLayers) float albedoMapBlend = surfaceData.baseColor.a; float maskMapBlend = fadeFactor; + #ifdef DECALS_4RT + float metallic = 0.0f; + float ao = 0.0f; + #ifdef VFX_VARYING_METALLIC + metallic = i.VFX_VARYING_METALLIC; + #endif + #ifdef VFX_VARYING_AMBIENT_OCCLUSION + ao = i.VFX_VARYING_AMBIENT_OCCLUSION; + #endif + #endif - float metallic = 0.0f; - float smoothness = 0.5f; - float ao = 0.0f; -#ifdef VFX_VARYING_METALLIC - metallic = i.VFX_VARYING_METALLIC; -#endif -#ifdef VFX_VARYING_SMOOTHNESS - smoothness = i.VFX_VARYING_SMOOTHNESS; -#endif -#ifdef VFX_VARYING_AMBIENT_OCCLUSION - ao = i.VFX_VARYING_AMBIENT_OCCLUSION; -#endif - -#if HDRP_USE_MASK_MAP - float4 mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); - mask.xyz *= float3(metallic, ao, smoothness); - - surfaceData.mask = mask; - surfaceData.mask.z = surfaceData.mask.w; - maskMapBlend = mask.z * fadeFactor; - - -#else //HDRP_USE_MASK_MAP - surfaceData.mask.xyz = float3(metallic, ao, smoothness); -#endif - -#if VFX_MASK_BLEND_BASE_COLOR_ALPHA - surfaceData.mask.w = albedoMapBlend; -#elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity - surfaceData.mask.w = maskMapBlend; -#endif - - - #if USE_NORMAL_MAP - float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); - #else - float3 normalTS = float3(0.0f,0.0f,1.0f); - #endif - normalWS = normalize(mul(transpose(worldToElement), normalTS)); + float smoothness = 0.5f; + #ifdef VFX_VARYING_SMOOTHNESS + smoothness = i.VFX_VARYING_SMOOTHNESS; + #endif - surfaceData.normalWS.xyz = normalWS; - #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA - surfaceData.normalWS.w = albedoMapBlend; - #elif VFX_NORMAL_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; - surfaceData.normalWS.w = maskMapBlend; - #endif - surfaceData.MAOSBlend.xy = float2(surfaceData.mask.w, surfaceData.mask.w); + #if HDRP_USE_MASK_MAP + surfaceData.mask = SampleTexture(VFX_SAMPLER(maskMap), uvData); + maskMapBlend = surfaceData.mask.z * fadeFactor; + #ifdef DECALS_4RT + surfaceData.mask.x = lerp(0, metallic, surfaceData.mask.x); + surfaceData.mask.y = lerp(0, ao, surfaceData.mask.y); + #endif + surfaceData.mask.z = lerp(0, smoothness, surfaceData.mask.w); + #else //HDRP_USE_MASK_MAP + #ifdef DECALS_4RT + surfaceData.mask.xy = float2(metallic, ao); + #endif + surfaceData.mask.z = smoothness; + #endif + + #if VFX_MASK_BLEND_BASE_COLOR_ALPHA + surfaceData.mask.w = albedoMapBlend; + #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity + surfaceData.mask.w = maskMapBlend; + #endif + + + #if USE_NORMAL_MAP + float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); + #else + float3 normalTS = float3(0.0f,0.0f,1.0f); + #endif + float3 normalWS = normalize(mul(transpose(worldToElement), normalTS)); + + surfaceData.normalWS.xyz = normalWS; + #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA + surfaceData.normalWS.w = albedoMapBlend; + #elif VFX_NORMAL_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; + surfaceData.normalWS.w = maskMapBlend; + #endif + + surfaceData.MAOSBlend.xy = float2(surfaceData.mask.w, surfaceData.mask.w); #endif #if SHADERPASS == SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE #if defined(VFX_VARYING_EMISSIVE) From 7b202e3e91cc333cd8f92352dd36ac545cf972fe Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 1 Jun 2021 18:11:57 +0200 Subject: [PATCH 35/66] Better handling of emissive when no map is there --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 2 +- .../Editor/VFXGraph/Shaders/VFXDecal.template | 5 +- .../VFXGraph/Shaders/DecalVFXData.hlsl | 102 ++++++++++++++++++ 3 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index c491f47e8a8..a46b6389e91 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -10,7 +10,7 @@ namespace UnityEditor.VFX.HDRP [VFXInfo(experimental = true)] class VFXDecalHDRPOutput : VFXAbstractParticleHDRPOutput { - public override string name { get { return "Output Particle HDRP Decal"; } } + public override string name { get { return "Output Particle HDRP Lit Decal"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleHDRPDecal"); } } public override VFXTaskType taskType { get { return VFXTaskType.ParticleHexahedronOutput; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index b98838c28ae..be574793fa3 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -170,8 +170,9 @@ if(_EnableDecalLayers) surfaceData.MAOSBlend.xy = float2(surfaceData.mask.w, surfaceData.mask.w); #endif #if SHADERPASS == SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE - #if defined(VFX_VARYING_EMISSIVE) - surfaceData.emissive = i.VFX_VARYING_EMISSIVE * fadeFactor; + surfaceData.emissive = float3(1,1,1) * fadeFactor; + #if defined(VFX_VARYING_EMISSIVE) && (HDRP_USE_EMISSIVE_COLOR || HDRP_USE_ADDITIONAL_EMISSIVE_COLOR) + surfaceData.emissive = i.VFX_VARYING_EMISSIVE; #endif #ifdef HDRP_USE_EMISSIVE_MAP float emissiveScale = 1.0f; diff --git a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl new file mode 100644 index 00000000000..127db30ce06 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl @@ -0,0 +1,102 @@ +//------------------------------------------------------------------------------------- +// Fill SurfaceData/Builtin data function +//------------------------------------------------------------------------------------- +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl" +#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/SampleUVMapping.hlsl" + +void GetSurfaceData(VFX_VARYING_PS_INPUTS input, float3 V, float2 posSS, float angleFadeFactor, out DecalSurfaceData surfaceData) +{ +#if (SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR) || (SHADERPASS == SHADERPASS_FORWARD_EMISSIVE_PROJECTOR) + // With inspector version of decal we can use instancing to get normal to world access + float4x4 normalToWorld = UNITY_ACCESS_INSTANCED_PROP(Decal, _NormalToWorld); + float fadeFactor = clamp(normalToWorld[0][3], 0.0f, 1.0f) * angleFadeFactor; + float2 scale = float2(normalToWorld[3][0], normalToWorld[3][1]); + float2 offset = float2(normalToWorld[3][2], normalToWorld[3][3]); + float2 texCoords = input.texCoord0.xy * scale + offset; +#elif (SHADERPASS == SHADERPASS_DBUFFER_MESH) || (SHADERPASS == SHADERPASS_FORWARD_EMISSIVE_MESH) + + #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + LODDitheringTransition(ComputeFadeMaskSeed(V, posSS), unity_LODFade.x); + #endif + + float fadeFactor = _DecalBlend.x; + float2 texCoords = input.texCoord0.xy; +#endif + + float albedoMapBlend = fadeFactor; + float maskMapBlend = _DecalMaskMapBlueScale * fadeFactor; + + ZERO_INITIALIZE(DecalSurfaceData, surfaceData); + +#ifdef _MATERIAL_AFFECTS_EMISSION + surfaceData.emissive = _EmissiveColor.rgb * fadeFactor; + #ifdef _EMISSIVEMAP + surfaceData.emissive *= SAMPLE_TEXTURE2D(_EmissiveColorMap, sampler_EmissiveColorMap, texCoords).rgb; + #endif + + // Inverse pre-expose using _EmissiveExposureWeight weight + float3 emissiveRcpExposure = surfaceData.emissive * GetInverseCurrentExposureMultiplier(); + surfaceData.emissive = lerp(emissiveRcpExposure, surfaceData.emissive, _EmissiveExposureWeight); +#endif // _MATERIAL_AFFECTS_EMISSION + + // Following code match the code in DecalUtilities.hlsl used for cluster. It have the same kind of condition and similar code structure + surfaceData.baseColor = _BaseColor; +#ifdef _COLORMAP + surfaceData.baseColor *= SAMPLE_TEXTURE2D(_BaseColorMap, sampler_BaseColorMap, texCoords); + #endif + surfaceData.baseColor.w *= fadeFactor; + albedoMapBlend = surfaceData.baseColor.w; + // outside _COLORMAP because we still have base color for albedoMapBlend +#ifndef _MATERIAL_AFFECTS_ALBEDO + surfaceData.baseColor.w = 0.0; // dont blend any albedo - Note: as we already do RT color masking this is not needed, albedo will not be affected anyway +#endif + + // In case of Smoothness / AO / Metal, all the three are always computed but color mask can change + // Note: We always use a texture here as the decal atlas for transparent decal cluster only handle texture case + // If no texture is assign it is the white texture +#ifdef _MATERIAL_AFFECTS_MASKMAP + #ifdef _MASKMAP + surfaceData.mask = SAMPLE_TEXTURE2D(_MaskMap, sampler_MaskMap, texCoords); + maskMapBlend *= surfaceData.mask.z; // store before overwriting with smoothness + #ifdef DECALS_4RT + surfaceData.mask.x = lerp(_MetallicRemapMin, _MetallicRemapMax, surfaceData.mask.x); + surfaceData.mask.y = lerp(_AORemapMin, _AORemapMax, surfaceData.mask.y); + #endif + surfaceData.mask.z = lerp(_SmoothnessRemapMin, _SmoothnessRemapMax, surfaceData.mask.w); + #else + #ifdef DECALS_4RT + surfaceData.mask.x = _Metallic; + surfaceData.mask.y = _AO; + #endif + surfaceData.mask.z = _Smoothness; + #endif + + surfaceData.mask.w = _MaskBlendSrc ? maskMapBlend : albedoMapBlend; +#endif + + // needs to be after mask, because blend source could be in the mask map blue + // Note: We always use a texture here as the decal atlas for transparent decal cluster only handle texture case + // If no texture is assign it is the bump texture (0.0, 0.0, 1.0) +#ifdef _MATERIAL_AFFECTS_NORMAL + + #ifdef _NORMALMAP + float3 normalTS = UnpackNormalmapRGorAG(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, texCoords)); + #else + float3 normalTS = float3(0.0, 0.0, 1.0); + #endif + float3 normalWS = float3(0.0, 0.0, 0.0); + + #if (SHADERPASS == SHADERPASS_DBUFFER_PROJECTOR) + normalWS = mul((float3x3)normalToWorld, normalTS); + #elif (SHADERPASS == SHADERPASS_DBUFFER_MESH) + // We need to normalize as we use mikkt tangent space and this is expected (tangent space is not normalize) + normalWS = normalize(TransformTangentToWorld(normalTS, input.tangentToWorld)); + #endif + + surfaceData.normalWS.xyz = normalWS; + surfaceData.normalWS.w = _NormalBlendSrc ? maskMapBlend : albedoMapBlend; + +#endif + + surfaceData.MAOSBlend.xy = float2(surfaceData.mask.w, surfaceData.mask.w); +} From fe248940b6dd132d20eb69e16af46968109df8fc Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 2 Jun 2021 11:01:56 +0200 Subject: [PATCH 36/66] Force Opaque offset for decal output --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 22 +------------------ .../Editor/VFXGraph/VFXHDRPSubOutput.cs | 11 ++++++++-- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index a46b6389e91..ba8b81a88a6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -47,26 +47,6 @@ public override IEnumerable attributes } } - public class WithoutMaskMapProperties - { - [Range(0, 1), Tooltip("Controls the metallic of the decal.")] - public float metallic = 0.0f; - [Range(0, 1), Tooltip("Controls the ambient occlusion of the decal.")] - public float ambientOcclusion = 1.0f; - [Range(0, 1), Tooltip("Controls the smoothness of the decal.")] - public float smoothness = 0.5f; - } - - public class WithMaskMapProperties - { - [Range(0, 1), Tooltip("Controls the scale factor for the particle’s metallic.")] - public float metallic = 1.0f; - [Range(0, 1), Tooltip("Controls the scale factor for the particle’s ambient occlusion.")] - public float ambientOcclusion = 1.0f; - [Range(0, 1), Tooltip("Controls the scale factor for the particle’s smoothness.")] - public float smoothness = 1.0f; - } - protected IEnumerable materialProperties { get @@ -141,7 +121,7 @@ public class FadeFactorProperty public class AngleFadeProperty { - [Tooltip("Angle Fade. Between 0 and 180."), MinMax(0.0f, 180.0f)] //TODO : create range attribute? + [Tooltip("Angle Fade. Between 0 and 180."), MinMax(0.0f, 180.0f)] public Vector2 angleFade = new Vector2(0.0f, 180.0f); } protected override IEnumerable inputProperties diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs index 1e3a97b4665..1d688f2f5a0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -42,7 +43,7 @@ public override bool supportsMaterialOffset { get { - if (owner.isBlendModeOpaque) + if (owner.isBlendModeOpaque && !(owner is VFXDecalHDRPOutput)) return false; return true; } @@ -146,7 +147,13 @@ public override string GetRenderQueueStr() private int GetRenderQueueOffset() { var renderQueueType = GetRenderQueueType(); - return HDRenderQueue.ChangeType(renderQueueType, GetMaterialOffset(), owner.hasAlphaClipping); + int renderQueueOffset; + + if (owner is VFXDecalHDRPOutput) + renderQueueOffset = HDRenderQueue.Clamps(HDRenderQueue.k_RenderQueue_AllOpaque, HDRenderQueue.ChangeType(renderQueueType, 0, owner.hasAlphaClipping) + GetMaterialOffset()); + else + renderQueueOffset = HDRenderQueue.ChangeType(renderQueueType, GetMaterialOffset(), owner.hasAlphaClipping); + return renderQueueOffset; } private int GetMaterialOffset() From 3945dd64a242c082676420348e6c0fb1871ab710 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 2 Jun 2021 12:57:05 +0200 Subject: [PATCH 37/66] Remove OptimizeStateChanges from sortingCriteria to enable Output Render Order reorderablelist to work --- .../Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs index f7b16aed383..4d7d7a75d3e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs @@ -941,7 +941,8 @@ void RenderDBuffer(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle dec { passData.meshDecalsRendererList = builder.UseRendererList(renderGraph.CreateRendererList(new RendererListDesc(m_MeshDecalsPassNames, cullingResults, hdCamera.camera) { - sortingCriteria = SortingCriteria.CommonOpaque, + sortingCriteria = SortingCriteria.CommonOpaque + & ~SortingCriteria.OptimizeStateChanges, rendererConfiguration = PerObjectData.None, renderQueueRange = HDRenderQueue.k_RenderQueue_AllOpaque })); From 5cca57aadc89e8d914acafd859819c39a3c450eb Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 3 Jun 2021 09:54:08 +0200 Subject: [PATCH 38/66] Remove draft file --- .../VFXGraph/Shaders/DecalVFXData.hlsl | 102 ------------------ 1 file changed, 102 deletions(-) delete mode 100644 com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl diff --git a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl deleted file mode 100644 index 127db30ce06..00000000000 --- a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/DecalVFXData.hlsl +++ /dev/null @@ -1,102 +0,0 @@ -//------------------------------------------------------------------------------------- -// Fill SurfaceData/Builtin data function -//------------------------------------------------------------------------------------- -#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl" -#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/SampleUVMapping.hlsl" - -void GetSurfaceData(VFX_VARYING_PS_INPUTS input, float3 V, float2 posSS, float angleFadeFactor, out DecalSurfaceData surfaceData) -{ -#if (SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR) || (SHADERPASS == SHADERPASS_FORWARD_EMISSIVE_PROJECTOR) - // With inspector version of decal we can use instancing to get normal to world access - float4x4 normalToWorld = UNITY_ACCESS_INSTANCED_PROP(Decal, _NormalToWorld); - float fadeFactor = clamp(normalToWorld[0][3], 0.0f, 1.0f) * angleFadeFactor; - float2 scale = float2(normalToWorld[3][0], normalToWorld[3][1]); - float2 offset = float2(normalToWorld[3][2], normalToWorld[3][3]); - float2 texCoords = input.texCoord0.xy * scale + offset; -#elif (SHADERPASS == SHADERPASS_DBUFFER_MESH) || (SHADERPASS == SHADERPASS_FORWARD_EMISSIVE_MESH) - - #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group - LODDitheringTransition(ComputeFadeMaskSeed(V, posSS), unity_LODFade.x); - #endif - - float fadeFactor = _DecalBlend.x; - float2 texCoords = input.texCoord0.xy; -#endif - - float albedoMapBlend = fadeFactor; - float maskMapBlend = _DecalMaskMapBlueScale * fadeFactor; - - ZERO_INITIALIZE(DecalSurfaceData, surfaceData); - -#ifdef _MATERIAL_AFFECTS_EMISSION - surfaceData.emissive = _EmissiveColor.rgb * fadeFactor; - #ifdef _EMISSIVEMAP - surfaceData.emissive *= SAMPLE_TEXTURE2D(_EmissiveColorMap, sampler_EmissiveColorMap, texCoords).rgb; - #endif - - // Inverse pre-expose using _EmissiveExposureWeight weight - float3 emissiveRcpExposure = surfaceData.emissive * GetInverseCurrentExposureMultiplier(); - surfaceData.emissive = lerp(emissiveRcpExposure, surfaceData.emissive, _EmissiveExposureWeight); -#endif // _MATERIAL_AFFECTS_EMISSION - - // Following code match the code in DecalUtilities.hlsl used for cluster. It have the same kind of condition and similar code structure - surfaceData.baseColor = _BaseColor; -#ifdef _COLORMAP - surfaceData.baseColor *= SAMPLE_TEXTURE2D(_BaseColorMap, sampler_BaseColorMap, texCoords); - #endif - surfaceData.baseColor.w *= fadeFactor; - albedoMapBlend = surfaceData.baseColor.w; - // outside _COLORMAP because we still have base color for albedoMapBlend -#ifndef _MATERIAL_AFFECTS_ALBEDO - surfaceData.baseColor.w = 0.0; // dont blend any albedo - Note: as we already do RT color masking this is not needed, albedo will not be affected anyway -#endif - - // In case of Smoothness / AO / Metal, all the three are always computed but color mask can change - // Note: We always use a texture here as the decal atlas for transparent decal cluster only handle texture case - // If no texture is assign it is the white texture -#ifdef _MATERIAL_AFFECTS_MASKMAP - #ifdef _MASKMAP - surfaceData.mask = SAMPLE_TEXTURE2D(_MaskMap, sampler_MaskMap, texCoords); - maskMapBlend *= surfaceData.mask.z; // store before overwriting with smoothness - #ifdef DECALS_4RT - surfaceData.mask.x = lerp(_MetallicRemapMin, _MetallicRemapMax, surfaceData.mask.x); - surfaceData.mask.y = lerp(_AORemapMin, _AORemapMax, surfaceData.mask.y); - #endif - surfaceData.mask.z = lerp(_SmoothnessRemapMin, _SmoothnessRemapMax, surfaceData.mask.w); - #else - #ifdef DECALS_4RT - surfaceData.mask.x = _Metallic; - surfaceData.mask.y = _AO; - #endif - surfaceData.mask.z = _Smoothness; - #endif - - surfaceData.mask.w = _MaskBlendSrc ? maskMapBlend : albedoMapBlend; -#endif - - // needs to be after mask, because blend source could be in the mask map blue - // Note: We always use a texture here as the decal atlas for transparent decal cluster only handle texture case - // If no texture is assign it is the bump texture (0.0, 0.0, 1.0) -#ifdef _MATERIAL_AFFECTS_NORMAL - - #ifdef _NORMALMAP - float3 normalTS = UnpackNormalmapRGorAG(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, texCoords)); - #else - float3 normalTS = float3(0.0, 0.0, 1.0); - #endif - float3 normalWS = float3(0.0, 0.0, 0.0); - - #if (SHADERPASS == SHADERPASS_DBUFFER_PROJECTOR) - normalWS = mul((float3x3)normalToWorld, normalTS); - #elif (SHADERPASS == SHADERPASS_DBUFFER_MESH) - // We need to normalize as we use mikkt tangent space and this is expected (tangent space is not normalize) - normalWS = normalize(TransformTangentToWorld(normalTS, input.tangentToWorld)); - #endif - - surfaceData.normalWS.xyz = normalWS; - surfaceData.normalWS.w = _NormalBlendSrc ? maskMapBlend : albedoMapBlend; - -#endif - - surfaceData.MAOSBlend.xy = float2(surfaceData.mask.w, surfaceData.mask.w); -} From 97a76c893c7785a3d7c8e987f123241844c5f0a6 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 3 Jun 2021 18:15:48 +0200 Subject: [PATCH 39/66] Fix emissive fade factor application --- .../Editor/VFXGraph/Shaders/VFXDecal.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index be574793fa3..5ccc70696b0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -172,7 +172,7 @@ if(_EnableDecalLayers) #if SHADERPASS == SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE surfaceData.emissive = float3(1,1,1) * fadeFactor; #if defined(VFX_VARYING_EMISSIVE) && (HDRP_USE_EMISSIVE_COLOR || HDRP_USE_ADDITIONAL_EMISSIVE_COLOR) - surfaceData.emissive = i.VFX_VARYING_EMISSIVE; + surfaceData.emissive *= i.VFX_VARYING_EMISSIVE; #endif #ifdef HDRP_USE_EMISSIVE_MAP float emissiveScale = 1.0f; From 6fcaf5a28e8ce34f00dfc7b4e3e54cac6666482c Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 4 Jun 2021 09:57:40 +0200 Subject: [PATCH 40/66] Correct projection with Oblique Frustum (lens shift) --- .../Editor/VFXGraph/Shaders/VFXDecal.template | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 5ccc70696b0..3e22af2398d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -35,28 +35,12 @@ if(_EnableDecalLayers) float3 clipPos; clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; clipPos.z = VFXSampleDepth(i.pos); - if (_ProjectionParams.x < 0) clipPos.y = -clipPos.y; - float4 viewPos; - - if(IsPerspectiveProjection()) - { - clipPos *= VFXLinearEyeDepth(clipPos.z); - viewPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; - viewPos.y = clipPos.y / UNITY_MATRIX_P[1][1]; - viewPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; - viewPos.w = 1.0f ; - } - else - { - viewPos.x = (clipPos.x - UNITY_MATRIX_P[0][3]) / UNITY_MATRIX_P[0][0]; - viewPos.y = (clipPos.y - UNITY_MATRIX_P[1][3]) / UNITY_MATRIX_P[1][1]; - viewPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; - viewPos.w = 1.0f; - } - + float4 positionCS = float4(clipPos, 1.0f); + float4 hpositionWS = mul(UNITY_MATRIX_I_VP, positionCS); + float3 positionWS = hpositionWS.xyz / hpositionWS.w; float4x4 viewToElement; viewToElement[0] = i.viewToDecal0; @@ -64,14 +48,14 @@ if(_EnableDecalLayers) viewToElement[2] = i.viewToDecal2; viewToElement[3] = float4(0,0,0,1); - float3 elementPos = mul(viewToElement,viewPos).xyz * 2.0f; + float4x4 worldToElement = mul(viewToElement, UNITY_MATRIX_V); + worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it + float3 elementPos = mul(worldToElement, float4(positionWS,1.0f)).xyz * 2.0f; clip(1.0f - abs(elementPos)); float2 uv = elementPos.xy * 0.5f + 0.5f; VFXUVData uvData = GetUVData(uv); float angleFadeFactor = 1.0f; - float3x3 worldToElement = mul((float3x3)viewToElement, VFXGetWorldToViewRotMatrix()); //Transposed//TODO: Won't be correct for non-uniform scalings - worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it if(_EnableDecalLayers) { From cc2c3e8d50a8a1ade24af0aacab10b24a2bf3a46 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 4 Jun 2021 10:18:37 +0200 Subject: [PATCH 41/66] Fix Forward decal in Ortho + issues with Lens Shifting --- .../Editor/VFXGraph/Shaders/VFXDecal.template | 7 ++- .../Shaders/ParticleDecals/Pass.template | 47 ++++++++++--------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 3e22af2398d..d37fb555335 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -38,9 +38,8 @@ if(_EnableDecalLayers) if (_ProjectionParams.x < 0) clipPos.y = -clipPos.y; - float4 positionCS = float4(clipPos, 1.0f); - float4 hpositionWS = mul(UNITY_MATRIX_I_VP, positionCS); - float3 positionWS = hpositionWS.xyz / hpositionWS.w; + float4 hpositionWS = mul(UNITY_MATRIX_I_VP, float4(clipPos,1.0f)); + float4 worldPos = float4(hpositionWS.xyz / hpositionWS.w, 1.0f); float4x4 viewToElement; viewToElement[0] = i.viewToDecal0; @@ -50,7 +49,7 @@ if(_EnableDecalLayers) float4x4 worldToElement = mul(viewToElement, UNITY_MATRIX_V); worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it - float3 elementPos = mul(worldToElement, float4(positionWS,1.0f)).xyz * 2.0f; + float3 elementPos = mul(worldToElement, worldPos).xyz * 2.0f; clip(1.0f - abs(elementPos)); float2 uv = elementPos.xy * 0.5f + 0.5f; diff --git a/com.unity.visualeffectgraph/Shaders/ParticleDecals/Pass.template b/com.unity.visualeffectgraph/Shaders/ParticleDecals/Pass.template index 3004d555f19..69a934874dd 100644 --- a/com.unity.visualeffectgraph/Shaders/ParticleDecals/Pass.template +++ b/com.unity.visualeffectgraph/Shaders/ParticleDecals/Pass.template @@ -1,6 +1,6 @@ #pragma target 4.5 ${VFXPassForwardAdditionalPragma} - + struct ps_input { float4 pos : SV_POSITION; @@ -26,17 +26,17 @@ struct ps_input nointerpolation float2 builtInInterpolants2 : TEXCOORD7; #endif #endif - + nointerpolation float4 viewToDecal0 : TEXCOORD2; nointerpolation float4 viewToDecal1 : TEXCOORD3; nointerpolation float4 viewToDecal2 : TEXCOORD4; - + #if VFX_NEEDS_POSWS_INTERPOLATOR float3 posWS : TEXCOORD5; #endif - + UNITY_VERTEX_OUTPUT_STEREO - + #if USE_UV_SCALE_BIAS nointerpolation float4 scaleBias : TEXCOORD6; #endif @@ -62,7 +62,7 @@ struct ps_output #endif #endif #if USE_FLIPBOOK_MOTIONVECTORS -#define VFX_VARYING_MOTIONVECTORSCALE builtInInterpolants2.xy +#define VFX_VARYING_MOTIONVECTORSCALE builtInInterpolants2.xy #endif #if VFX_NEEDS_POSWS_INTERPOLATOR #define VFX_VARYING_POSWS posWS @@ -74,7 +74,7 @@ struct ps_output #define VFX_VARYING_UV_SCALE scaleBias.xy #define VFX_VARYING_UV_BIAS scaleBias.zw #endif - + ${VFXBegin:VFXVertexAdditionalProcess} float4x4 viewToDecal = GetVFXToElementMatrix( attributes.axisX, @@ -84,7 +84,7 @@ float4x4 viewToDecal = GetVFXToElementMatrix( float3(attributes.pivotX,attributes.pivotY,attributes.pivotZ), size3, attributes.position); - + #if VFX_LOCAL_SPACE viewToDecal = mul(viewToDecal, VFXGetWorldToObjectMatrix()); #endif @@ -93,40 +93,41 @@ o.viewToDecal0 = viewToDecal[0]; o.viewToDecal1 = viewToDecal[1]; o.viewToDecal2 = viewToDecal[2]; ${VFXEnd} - + ${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #if VFX_PASSDEPTH == VFX_PASSDEPTH_SELECTION int _ObjectId; int _PassValue; #endif - + #pragma fragment frag ps_output frag(ps_input i) { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); ps_output o = (ps_output)0; VFXTransformPSInputs(i); - + float3 clipPos; clipPos.xy = (i.pos.xy / _ScreenParams.xy) * 2.0f - 1.0f; clipPos.z = VFXSampleDepth(i.pos); - clipPos *= VFXLinearEyeDepth(clipPos.z); - - float4 worldPos; - worldPos.x = clipPos.x / UNITY_MATRIX_P[0][0]; - worldPos.y = clipPos.y / -UNITY_MATRIX_P[1][1]; - worldPos.z = (clipPos.z - UNITY_MATRIX_P[2][3]) / UNITY_MATRIX_P[2][2]; - worldPos.w = 1.0f; - + if (_ProjectionParams.x < 0) + clipPos.y = -clipPos.y; + + float4 hpositionWS = mul(UNITY_MATRIX_I_VP, float4(clipPos,1.0f)); + float4 worldPos = float4(hpositionWS.xyz / hpositionWS.w, 1.0f); + float4x4 viewToElement; viewToElement[0] = i.viewToDecal0; viewToElement[1] = i.viewToDecal1; viewToElement[2] = i.viewToDecal2; viewToElement[3] = float4(0,0,0,1); - - float3 elementPos = mul(viewToElement,worldPos).xyz * 2.0f; - + + float4x4 worldToElement = mul(viewToElement, UNITY_MATRIX_V); + worldToElement[2] *= -1.0f; //Z points TOWARDS the surface, so we need to revert it + + float3 elementPos = mul(worldToElement, worldPos).xyz * 2.0f; + const float bias = 0.0f; clip(1.0f - abs(elementPos) + bias); @@ -138,7 +139,7 @@ ps_output frag(ps_input i) o.color = VFXApplyPreExposure(o.color, i); o.color = VFXApplyFog(o.color,i); VFXClipFragmentColor(o.color.a,i); - + #if VFX_PASSDEPTH == VFX_PASSDEPTH_SELECTION o.color = float4(_ObjectId, _PassValue, 1.0, 1.0); #else From 78f5ea8d2b31c5b9cda2395b32819a289da6b7c1 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 4 Jun 2021 10:45:18 +0200 Subject: [PATCH 42/66] Dedicated RendererList for VFX Decals --- .../Templates/HDRPDecal/PassDBuffer.template | 2 +- .../RenderPipeline/HDRenderPipeline.Prepass.cs | 13 +++++++++++-- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 1 + .../Runtime/RenderPipeline/HDStringConstants.cs | 7 +++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 1f677a9ba16..9757f91ee98 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -1,7 +1,7 @@ Pass { Name "DBufferMesh" - Tags {"LightMode"="DBufferMesh"} + Tags {"LightMode"="DBufferVFX"} Cull Front diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs index 4d7d7a75d3e..15a40a0eea5 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs @@ -859,6 +859,7 @@ void BuildCoarseStencilAndResolveIfNeeded(RenderGraph renderGraph, HDCamera hdCa class RenderDBufferPassData { public RendererListHandle meshDecalsRendererList; + public RendererListHandle vfxDecalsRendererList; public TextureHandle depthTexture; public TextureHandle decalBuffer; } @@ -941,12 +942,19 @@ void RenderDBuffer(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle dec { passData.meshDecalsRendererList = builder.UseRendererList(renderGraph.CreateRendererList(new RendererListDesc(m_MeshDecalsPassNames, cullingResults, hdCamera.camera) { - sortingCriteria = SortingCriteria.CommonOpaque - & ~SortingCriteria.OptimizeStateChanges, + sortingCriteria = SortingCriteria.CommonOpaque, rendererConfiguration = PerObjectData.None, renderQueueRange = HDRenderQueue.k_RenderQueue_AllOpaque })); + passData.vfxDecalsRendererList = builder.UseRendererList(renderGraph.CreateRendererList( + new RendererListDesc(m_VfxDecalsPassNames, cullingResults, hdCamera.camera) + { + sortingCriteria = SortingCriteria.CommonOpaque & ~ SortingCriteria.OptimizeStateChanges, + rendererConfiguration = PerObjectData.None, + renderQueueRange = HDRenderQueue.k_RenderQueue_AllOpaque, + })); + SetupDBufferTargets(renderGraph, use4RTs, ref output, builder); passData.decalBuffer = builder.ReadTexture(decalBuffer); passData.depthTexture = canReadBoundDepthBuffer ? builder.ReadTexture(output.resolvedDepthBuffer) : builder.ReadTexture(output.depthPyramidTexture); @@ -958,6 +966,7 @@ void RenderDBuffer(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle dec context.cmd.SetGlobalTexture(HDShaderIDs._CameraDepthTexture, data.depthTexture); CoreUtils.DrawRendererList(context.renderContext, context.cmd, data.meshDecalsRendererList); + CoreUtils.DrawRendererList(context.renderContext, context.cmd, data.vfxDecalsRendererList); DecalSystem.instance.RenderIntoDBuffer(context.cmd); context.cmd.ClearRandomWriteTargets(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 768628faa03..70633181b3a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -138,6 +138,7 @@ internal static HDRenderPipeline currentPipeline ShaderTagId[] m_ForwardErrorPassNames = { HDShaderPassNames.s_AlwaysName, HDShaderPassNames.s_ForwardBaseName, HDShaderPassNames.s_DeferredName, HDShaderPassNames.s_PrepassBaseName, HDShaderPassNames.s_VertexName, HDShaderPassNames.s_VertexLMRGBMName, HDShaderPassNames.s_VertexLMName }; ShaderTagId[] m_SinglePassName = new ShaderTagId[1]; ShaderTagId[] m_MeshDecalsPassNames = { HDShaderPassNames.s_DBufferMeshName }; + ShaderTagId[] m_VfxDecalsPassNames = { HDShaderPassNames.s_DBufferVFXDecalName }; RenderStateBlock m_DepthStateOpaque; RenderStateBlock m_DepthStateNoWrite; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index ebaf9bdfa98..4f8ed2ec0c0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -52,6 +52,11 @@ public static class HDShaderPassNames public static readonly string s_DBufferMeshStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DBufferMesh]; /// Decal Mesh Forward Emissive pass name. public static readonly string s_DecalMeshForwardEmissiveStr = DecalSystem.s_MaterialDecalPassNames[(int)DecalSystem.MaterialDecalPass.DecalMeshForwardEmissive]; + /// DBuffer VFX Decal pass name + public static readonly string s_DBufferVFXDecalStr = "DBufferVFX"; + + + // ShaderPass name /// Empty shader tag id. @@ -91,6 +96,8 @@ public static class HDShaderPassNames public static readonly ShaderTagId s_DBufferMeshName = new ShaderTagId(s_DBufferMeshStr); /// Decal Mesh Forward Emissive shader tag id. public static readonly ShaderTagId s_DecalMeshForwardEmissiveName = new ShaderTagId(s_DecalMeshForwardEmissiveStr); + /// DBuffer VFX Decal shader tag id. + public static readonly ShaderTagId s_DBufferVFXDecalName = new ShaderTagId(s_DBufferVFXDecalStr); // Legacy name internal static readonly ShaderTagId s_AlwaysName = new ShaderTagId("Always"); From eef0a93a992b79821d8dd7705ce638e8e239fccd Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 7 Jun 2021 16:57:51 +0200 Subject: [PATCH 43/66] Added tailored refreshErrors for VFX when HDRP setting change --- .../RenderPipeline/HDRenderPipelineEditor.cs | 21 +++ .../RenderPipeline/HDRenderPipelineUI.cs | 13 +- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 135 ++++++++++++------ 3 files changed, 123 insertions(+), 46 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs index 27bd0705fba..6f990aa9ea7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs @@ -1,3 +1,6 @@ +using System.Linq; +using UnityEditor.VFX.HDRP; +using UnityEditor.VFX.UI; using UnityEngine.Rendering.HighDefinition; namespace UnityEditor.Rendering.HighDefinition @@ -9,6 +12,7 @@ sealed class HDRenderPipelineEditor : Editor SerializedHDRenderPipelineAsset m_SerializedHDRenderPipeline; internal bool largeLabelWidth = true; + internal bool needRefreshVfxWarnings = false; void OnEnable() { @@ -32,6 +36,23 @@ public override void OnInspectorGUI() EditorGUIUtility.labelWidth *= 0.5f; serialized.Apply(); + RefreshVfxErrorsIfNeeded(); + + } + + private void RefreshVfxErrorsIfNeeded() + { + if (needRefreshVfxWarnings) + { + var vfxWindow = VFXViewWindow.currentWindow; + if (vfxWindow != null) + { + var vfxGraph = vfxWindow.graphView.controller.graph; + foreach ( var output in vfxGraph.children.OfType()) + output.RefreshErrors(vfxGraph); + } + } + needRefreshVfxWarnings = false; } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs index 0673e305802..74471c3aa09 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -411,15 +411,26 @@ static void Drawer_SectionDecalSettings(SerializedHDRenderPipelineAsset serializ if (EditorGUI.EndChangeCheck()) serialized.renderPipelineSettings.decalSettings.atlasHeight.intValue = Mathf.Max(serialized.renderPipelineSettings.decalSettings.atlasHeight.intValue, 0); + EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.decalSettings.perChannelMask, Styles.metalAndAOContent); + if (EditorGUI.EndChangeCheck()) + { + // Tell VFX + ((HDRenderPipelineEditor) owner).needRefreshVfxWarnings = true; + } EditorGUI.BeginChangeCheck(); EditorGUILayout.DelayedIntField(serialized.renderPipelineSettings.lightLoopSettings.maxDecalsOnScreen, Styles.maxDecalContent); if (EditorGUI.EndChangeCheck()) serialized.renderPipelineSettings.lightLoopSettings.maxDecalsOnScreen.intValue = Mathf.Clamp(serialized.renderPipelineSettings.lightLoopSettings.maxDecalsOnScreen.intValue, 1, HDRenderPipeline.k_MaxDecalsOnScreen); + EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportDecalLayers, Styles.supportDecalLayersContent); - + if (EditorGUI.EndChangeCheck()) + { + // Tell VFX + ((HDRenderPipelineEditor) owner).needRefreshVfxWarnings = true; + } EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportSurfaceGradient, Styles.supportSurfaceGradientContent); if (serialized.renderPipelineSettings.supportSurfaceGradient.boolValue) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index ba8b81a88a6..df699594cd8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -10,9 +10,20 @@ namespace UnityEditor.VFX.HDRP [VFXInfo(experimental = true)] class VFXDecalHDRPOutput : VFXAbstractParticleHDRPOutput { - public override string name { get { return "Output Particle HDRP Lit Decal"; } } - public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleHDRPDecal"); } } - public override VFXTaskType taskType { get { return VFXTaskType.ParticleHexahedronOutput; } } + public override string name + { + get { return "Output Particle HDRP Lit Decal"; } + } + + public override string codeGeneratorTemplate + { + get { return RenderPipeTemplate("VFXParticleHDRPDecal"); } + } + + public override VFXTaskType taskType + { + get { return VFXTaskType.ParticleHexahedronOutput; } + } public override void OnEnable() { @@ -51,43 +62,45 @@ protected IEnumerable materialProperties { get { - if(affectMetal) + if (affectMetal) yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), - "metallic", - new TooltipAttribute(useMaskMap ? - "Controls the scale factor for the particle’s metallic." : - "Controls the metallic of the decal."), - new RangeAttribute(0,1)), 0.0f); + "metallic", + new TooltipAttribute(useMaskMap + ? "Controls the scale factor for the particle’s metallic." + : "Controls the metallic of the decal."), + new RangeAttribute(0, 1)), 0.0f); - if(affectAmbientOcclusion) + if (affectAmbientOcclusion) yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "ambientOcclusion", - new TooltipAttribute(useMaskMap ? - "Controls the scale factor for the particle’s ambient occlusion." : - "Controls the ambient occlusion of the decal."), - new RangeAttribute(0,1)), 1.0f); + new TooltipAttribute(useMaskMap + ? "Controls the scale factor for the particle’s ambient occlusion." + : "Controls the ambient occlusion of the decal."), + new RangeAttribute(0, 1)), 1.0f); - if(affectSmoothness) + if (affectSmoothness) yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "smoothness", - new TooltipAttribute(useMaskMap ? - "Controls the scale factor for the particle’s smoothness." : - "Controls the smoothness of the decal."), - new RangeAttribute(0,1)), 0.5f); + new TooltipAttribute(useMaskMap + ? "Controls the scale factor for the particle’s smoothness." + : "Controls the smoothness of the decal."), + new RangeAttribute(0, 1)), 0.5f); } } - public enum BlendSource { BaseColorMapAlpha, MaskMapBlue, } - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Normal Map.")] + + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + Tooltip("Specifies the source this Material uses as opacity for its Normal Map.")] BlendSource normalOpacityChannel = BlendSource.BaseColorMapAlpha; - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Mask Map.")] + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + Tooltip("Specifies the source this Material uses as opacity for its Mask Map.")] BlendSource maskOpacityChannel = BlendSource.BaseColorMapAlpha; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, @@ -95,19 +108,30 @@ public enum BlendSource private bool affectBaseColor = true; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, - Tooltip("When enabled, this decal uses the metallic channel of its Mask Map. When disabled, the decal has no metallic effect.")] + Tooltip( + "When enabled, this decal uses the metallic channel of its Mask Map. When disabled, the decal has no metallic effect.")] private bool affectMetal = true; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, - Tooltip("When enabled, this decal uses the ambient occlusion channel of its Mask Map. When disabled, the decal has no ambient occlusion effect.")] + Tooltip( + "When enabled, this decal uses the ambient occlusion channel of its Mask Map. When disabled, the decal has no ambient occlusion effect.")] private bool affectAmbientOcclusion = true; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, - Tooltip("When enabled, this decal uses the smoothness channel of its Mask Map. When disabled, the decal has no smoothness effect.")] + Tooltip( + "When enabled, this decal uses the smoothness channel of its Mask Map. When disabled, the decal has no smoothness effect.")] private bool affectSmoothness = true; - private bool enableDecalLayers => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals - && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers; + + private bool supportDecals => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals; + private bool enableDecalLayers => + supportDecals + && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers; + + private bool metalAndAODecals => + supportDecals + && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.decalSettings.perChannelMask; + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the layer mask of the decal.")] @@ -115,8 +139,7 @@ public enum BlendSource public class FadeFactorProperty { - [Range(0, 1), Tooltip("Fade Factor.")] - public float fadeFactor = 1.0f; + [Range(0, 1), Tooltip("Fade Factor.")] public float fadeFactor = 1.0f; } public class AngleFadeProperty @@ -124,6 +147,7 @@ public class AngleFadeProperty [Tooltip("Angle Fade. Between 0 and 180."), MinMax(0.0f, 180.0f)] public Vector2 angleFade = new Vector2(0.0f, 180.0f); } + protected override IEnumerable inputProperties { get @@ -140,7 +164,8 @@ protected override IEnumerable inputProperties } } - protected override IEnumerable CollectGPUExpressions(IEnumerable slotExpressions) + protected override IEnumerable CollectGPUExpressions( + IEnumerable slotExpressions) { foreach (var exp in base.CollectGPUExpressions(slotExpressions)) yield return exp; @@ -148,31 +173,29 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (GetOrRefreshShaderGraphObject() == null) { yield return slotExpressions.First(o => o.name == "fadeFactor"); - if(affectMetal) + if (affectMetal) yield return slotExpressions.First(o => o.name == "metallic"); - if(affectAmbientOcclusion) + if (affectAmbientOcclusion) yield return slotExpressions.First(o => o.name == "ambientOcclusion"); - if(affectSmoothness) + if (affectSmoothness) yield return slotExpressions.First(o => o.name == "smoothness"); var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); - yield return new VFXNamedExpression(VFXValue.Constant((uint)decalLayer), "decalLayerMask"); - - + yield return new VFXNamedExpression(VFXValue.Constant((uint) decalLayer), "decalLayerMask"); } } VFXExpression AngleFadeSimplification(VFXExpression angleFadeExp) { - angleFadeExp = angleFadeExp / VFXValue.Constant(new Vector2(180.0f,180.0f)); + angleFadeExp = angleFadeExp / VFXValue.Constant(new Vector2(180.0f, 180.0f)); var angleStart = new VFXExpressionExtractComponent(angleFadeExp, 0); var angleEnd = new VFXExpressionExtractComponent(angleFadeExp, 1); var range = new VFXExpressionMax(VFXValue.Constant(0.0001f), angleEnd - angleStart); var simplifiedAngleFade = new VFXExpressionCombine( VFXValue.Constant(1.0f) - (VFXValue.Constant(0.25f) - angleStart) / range, - VFXValue.Constant(-0.25f)/ range); + VFXValue.Constant(-0.25f) / range); return simplifiedAngleFade; } @@ -241,7 +264,6 @@ public override IEnumerable additionalDefines yield return "AFFECT_SMOOTHNESS"; if (useEmissive || useEmissiveMap) yield return "NEEDS_FORWARD_EMISSIVE_PASS"; - } } @@ -251,10 +273,12 @@ protected VFXShaderWriter GetDecalMaskColor(int maskIndex) var maskString = ""; switch (maskIndex) { - case 0 : - rs.Write(affectBaseColor ? "RBGA" : "0"); break; - case 1 : - rs.Write(useNormalMap ? "RGBA" : "0"); break; + case 0: + rs.Write(affectBaseColor ? "RBGA" : "0"); + break; + case 1: + rs.Write(useNormalMap ? "RGBA" : "0"); + break; case 2: { if (affectMetal) @@ -277,7 +301,7 @@ protected VFXShaderWriter GetDecalMaskColor(int maskIndex) rs.Write(maskString); break; } - case 3 : + case 3: if (affectMetal) { maskString += "R"; @@ -287,6 +311,7 @@ protected VFXShaderWriter GetDecalMaskColor(int maskIndex) { maskString += "G"; } + if (String.IsNullOrEmpty(maskString)) maskString = "0"; rs.Write(maskString); @@ -306,9 +331,29 @@ public override IEnumerable> additionalRep for (int i = 0; i < 4; i++) { - yield return new KeyValuePair("${VFXDecalColorMask" + i + "}", GetDecalMaskColor(i)); + yield return new KeyValuePair("${VFXDecalColorMask" + i + "}", + GetDecalMaskColor(i)); } } } + + protected override void GenerateErrors(VFXInvalidateErrorReporter manager) + { + base.GenerateErrors(manager); + if (!enableDecalLayers) + { + manager.RegisterError("DecalLayersDisabled", VFXErrorType.Warning, + $"The Angle Fade parameter won't have any effect, because the 'Decal Layers' setting is disabled." + + $" Enable 'Decal Layers' in your HDRP Asset if you want to control the Angle Fade." + + $" There is a performance cost of enabling this option."); + } + + if (!metalAndAODecals) + { + manager.RegisterError("DecalMetalAODisabled", VFXErrorType.Warning, + $"The Metallic and Ambient Occlusion parameters won't have any effect, because the 'Metal and AO properties' setting is disabled." + + $" Enable 'Metal and AO properties' in your HDRP Asset if you want to control the Metal and AO properties of decals. There is a performance cost of enabling this option."); + } + } } } From 7393ddbe4aaf255c15266cc1f2d078715b889df8 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 8 Jun 2021 12:51:14 +0200 Subject: [PATCH 44/66] Support for flipbook --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 66 +++++++++++-------- .../Editor/VFXGraph/Shaders/VFXDecal.template | 2 +- .../Shaders/VFXDecalVaryings.template | 48 ++++++++++++-- 3 files changed, 82 insertions(+), 34 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index df699594cd8..4fbd87560e7 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -55,38 +55,12 @@ public override IEnumerable attributes yield return new VFXAttributeInfo(VFXAttribute.ScaleX, VFXAttributeMode.Read); yield return new VFXAttributeInfo(VFXAttribute.ScaleY, VFXAttributeMode.Read); yield return new VFXAttributeInfo(VFXAttribute.ScaleZ, VFXAttributeMode.Read); + if (usesFlipbook) + yield return new VFXAttributeInfo(VFXAttribute.TexIndex, VFXAttributeMode.Read); } } - protected IEnumerable materialProperties - { - get - { - if (affectMetal) - yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), - "metallic", - new TooltipAttribute(useMaskMap - ? "Controls the scale factor for the particle’s metallic." - : "Controls the metallic of the decal."), - new RangeAttribute(0, 1)), 0.0f); - - if (affectAmbientOcclusion) - yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), - "ambientOcclusion", - new TooltipAttribute(useMaskMap - ? "Controls the scale factor for the particle’s ambient occlusion." - : "Controls the ambient occlusion of the decal."), - new RangeAttribute(0, 1)), 1.0f); - if (affectSmoothness) - yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), - "smoothness", - new TooltipAttribute(useMaskMap - ? "Controls the scale factor for the particle’s smoothness." - : "Controls the smoothness of the decal."), - new RangeAttribute(0, 1)), 0.5f); - } - } public enum BlendSource @@ -137,6 +111,9 @@ public enum BlendSource Tooltip("Specifies the layer mask of the decal.")] private DecalLayerEnum decalLayer = DecalLayerEnum.LightLayerDefault; + public override bool supportsUV { get { return GetOrRefreshShaderGraphObject() == null; } } + + public class FadeFactorProperty { [Range(0, 1), Tooltip("Fade Factor.")] public float fadeFactor = 1.0f; @@ -144,10 +121,41 @@ public class FadeFactorProperty public class AngleFadeProperty { - [Tooltip("Angle Fade. Between 0 and 180."), MinMax(0.0f, 180.0f)] + [Tooltip("Use the min-max slider to control the fade out range of the decal based on the angle between the Decal backward direction and the vertex normal of the receiving surface." + + " Only available if Decal Layers feature is enabled."), MinMax(0.0f, 180.0f)] public Vector2 angleFade = new Vector2(0.0f, 180.0f); } + protected IEnumerable materialProperties + { + get + { + if (affectMetal) + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), + "metallic", + new TooltipAttribute(useMaskMap + ? "Controls the scale factor for the particle’s metallic." + : "Controls the metallic of the decal."), + new RangeAttribute(0, 1)), 0.0f); + + if (affectAmbientOcclusion) + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), + "ambientOcclusion", + new TooltipAttribute(useMaskMap + ? "Controls the scale factor for the particle’s ambient occlusion." + : "Controls the ambient occlusion of the decal."), + new RangeAttribute(0, 1)), 1.0f); + + if (affectSmoothness) + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), + "smoothness", + new TooltipAttribute(useMaskMap + ? "Controls the scale factor for the particle’s smoothness." + : "Controls the smoothness of the decal."), + new RangeAttribute(0, 1)), 0.5f); + } + } + protected override IEnumerable inputProperties { get diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index d37fb555335..df66af4f07b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -53,7 +53,7 @@ if(_EnableDecalLayers) clip(1.0f - abs(elementPos)); float2 uv = elementPos.xy * 0.5f + 0.5f; - VFXUVData uvData = GetUVData(uv); + VFXUVData uvData = GetUVData(i,uv); float angleFadeFactor = 1.0f; if(_EnableDecalLayers) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template index 3cc2f062e8a..362dc57b59c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -31,9 +31,30 @@ ${VFXBegin:VFXHDRPDecalVaryingsMacros} #define VFX_VARYING_EXPOSUREWEIGHT emissiveColor.a #endif + +#if USE_FLIPBOOK +#if USE_FLIPBOOK_ARRAY_LAYOUT + #define VFX_VARYING_FLIPBOOKSIZE flipBookSize +#else + #define VFX_VARYING_FLIPBOOKSIZE flipBookSize.xy + #define VFX_VARYING_INVFLIPBOOKSIZE flipBookSize.zw +#endif +#if USE_FLIPBOOK_MOTIONVECTORS +#define VFX_VARYING_MOTIONVECTORSCALE builtInInterpolants.xy +#define VFX_VARYING_TEXINDEX builtInInterpolants.z +#else +#define VFX_VARYING_TEXINDEX texIndex +#endif +#endif + +#if USE_UV_SCALE_BIAS +#define VFX_VARYING_UV_SCALE scaleBias.xy +#define VFX_VARYING_UV_BIAS scaleBias.zw +#endif + + #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos -#define VFX_VARYING_UV uv #define VFX_VARYING_POSWS posWS #define VFX_VARYING_FADEFACTOR fadeParameters.x #define VFX_VARYING_ANGLEFADE fadeParameters.yz @@ -53,9 +74,28 @@ VFX_OPTIONAL_INTERPOLATION float4 emissiveColor : COLOR1; // z: smoothness // w: emissive scale VFX_OPTIONAL_INTERPOLATION float4 materialProperties : TEXCOORD0; -float2 uv : TEXCOORD1; //unsure about the necessity of this one -float3 posWS : TEXCOORD2; -float3 fadeParameters : TEXCOORD3; +#if USE_FLIPBOOK +#if USE_FLIPBOOK_ARRAY_LAYOUT + nointerpolation float flipBookSize : TEXCOORD1; +#else + nointerpolation float4 flipBookSize : TEXCOORD1; +#endif +#if USE_FLIPBOOK_MOTIONVECTORS +// x: motion vectors scale X +// y: motion vectors scale Y +// z: texIndex +nointerpolation float3 builtInInterpolants : TEXCOORD2; +#else +nointerpolation float texIndex : TEXCOORD2; +#endif +#endif + +#if USE_UV_SCALE_BIAS +nointerpolation float4 scaleBias : TEXCOORD1; +#endif + +float3 posWS : TEXCOORD3; +float3 fadeParameters : TEXCOORD4; nointerpolation float4 viewToDecal0 : TEXCOORD5; nointerpolation float4 viewToDecal1 : TEXCOORD6; From 58fd537dbbd0a7565be669171c5b742e05bcd510 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 8 Jun 2021 14:50:54 +0200 Subject: [PATCH 45/66] Better handling of unsupported settings transfer (not exhaustive yet) --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 12 ++++++++++++ .../Outputs/VFXLitPlanarPrimitiveOutput.cs | 12 ++++++++++++ .../Editor/GraphView/Elements/VFXContextUI.cs | 3 +-- .../VFXPlanarPrimitiveOutput.cs | 13 +++++++++++++ .../Editor/Models/Contexts/VFXContext.cs | 19 +++++++++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 4fbd87560e7..88434604168 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -363,5 +363,17 @@ protected override void GenerateErrors(VFXInvalidateErrorReporter manager) $" Enable 'Metal and AO properties' in your HDRP Asset if you want to control the Metal and AO properties of decals. There is a performance cost of enabling this option."); } } + + protected override IEnumerable untransferableSettings + { + get + { + foreach (var setting in base.untransferableSettings) + { + yield return setting; + } + yield return "blendMode"; + } + } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitPlanarPrimitiveOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitPlanarPrimitiveOutput.cs index 0609cb56dd5..dfba85669d2 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitPlanarPrimitiveOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXLitPlanarPrimitiveOutput.cs @@ -94,5 +94,17 @@ public override IEnumerable additionalDefines yield return VFXPlanarPrimitiveHelper.GetShaderDefine(primitiveType); } } + + protected override IEnumerable untransferableSettings + { + get + { + foreach (var setting in base.untransferableSettings) + { + yield return setting; + } + yield return "primitiveType"; + } + } } } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs index bb51dfdb7c4..aa5c8f19017 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Elements/VFXContextUI.cs @@ -814,8 +814,7 @@ void ConvertContext(VFXNodeProvider.Descriptor d, Vector2 mPos) var contextType = controller.model.GetType(); foreach (var setting in newContextController.model.GetSettings(true)) { - if (((newContextController.model is VFXPlanarPrimitiveOutput || newContextController.model.GetType().Name == "VFXLitPlanarPrimitiveOutput") && setting.field.Name == "primitiveType") || - (newContextController.model.GetType().Name == "VFXDecalHDRPOutput" && setting.field.Name == "blendMode")) //TODO : These are not the only outputs/settings that do not support conversion correctly, need a cleaner way to handle those + if (!newContextController.model.CanTransferSetting(setting)) continue; if (!setting.valid || setting.field.GetCustomAttributes(typeof(VFXSettingAttribute), true).Length == 0) diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs index 90ad97de4c4..63b16257167 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs @@ -114,5 +114,18 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (primitiveType == VFXPrimitiveType.Octagon) yield return slotExpressions.First(o => o.name == "cropFactor"); } + + protected override IEnumerable untransferableSettings + { + get + { + foreach (var setting in base.untransferableSettings) + { + yield return setting; + } + yield return "primitiveType"; + } + } } + } diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs index 3a0a41c4e18..b5c1473bb9b 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/VFXContext.cs @@ -611,5 +611,24 @@ public override void CheckGraphBeforeImport() foreach (var block in children) block.CheckGraphBeforeImport(); } + + //TODO: Register all the contexts that have issues when transfering settings (in ConvertContext() ) + protected virtual IEnumerable untransferableSettings + { + get + { + return Enumerable.Empty(); + } + } + + public bool CanTransferSetting(string settingName) + { + return !untransferableSettings.Contains(settingName); + } + + public bool CanTransferSetting(VFXSetting setting) + { + return CanTransferSetting(setting.field.Name); + } } } From 8a8e833c0f75341a4fe1cc82e4c8e4a240f1f16b Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 8 Jun 2021 15:33:23 +0200 Subject: [PATCH 46/66] Added Alpha clipping option --- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 2 -- .../VFXGraph/Shaders/VFXDecalVaryings.template | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 88434604168..1405636ba6c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -231,7 +231,6 @@ protected override IEnumerable filteredOutSettings yield return setting; yield return "cullMode"; yield return "blendMode"; - yield return "useAlphaClipping"; yield return "doubleSided"; yield return "shaderGraph"; yield return "zTestMode"; @@ -239,7 +238,6 @@ protected override IEnumerable filteredOutSettings yield return "castShadows"; yield return "materialType"; yield return "sort"; - // yield return "useSoftParticle"; if (!enableDecalLayers) yield return "decalLayer"; diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template index 362dc57b59c..d8d81ab61bb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -58,6 +58,9 @@ ${VFXBegin:VFXHDRPDecalVaryingsMacros} #define VFX_VARYING_POSWS posWS #define VFX_VARYING_FADEFACTOR fadeParameters.x #define VFX_VARYING_ANGLEFADE fadeParameters.yz +#if USE_ALPHA_TEST +#define VFX_VARYING_ALPHATHRESHOLD fadeParameters.w +#endif ${VFXEnd} ${VFXBegin:VFXHDRPDecalDeclareVaryings} @@ -95,7 +98,19 @@ nointerpolation float4 scaleBias : TEXCOORD1; #endif float3 posWS : TEXCOORD3; -float3 fadeParameters : TEXCOORD4; +#if USE_ALPHA_TEST +// x: fade factor +// y: angle fade start +// z: angle fade end +// w: alpha threshold +nointerpolation float4 fadeParameters : TEXCOORD4; +#else +// x: fade factor +// y: angle fade start +// z: angle fade end +nointerpolation float3 fadeParameters : TEXCOORD4; +#endif + nointerpolation float4 viewToDecal0 : TEXCOORD5; nointerpolation float4 viewToDecal1 : TEXCOORD6; From 318ed17ca68a58d253f2b1f093f84eff99e50141 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Tue, 15 Jun 2021 14:56:49 +0200 Subject: [PATCH 47/66] Attempt to make sub slots ranges --- com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs | 6 ++++++ .../Editor/Types/VFXPropertyAttribute.cs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs index fc0aa3ccbdd..606a10e7dee 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs @@ -381,6 +381,12 @@ private static VFXSlot CreateSub(VFXProperty property, Direction direction) foreach (var subInfo in property.SubProperties()) { var subSlot = CreateSub(subInfo, direction); + if (slot.property.attributes.attributes.OfType().Any()) + { + var parentRange = property.attributes.FindRange(); + var attributesPlusRange = subSlot.property.attributes.attributes.Append(new RangeAttribute(parentRange.x, parentRange.y)); + subSlot.UpdateAttributes(new VFXPropertyAttributes( new RangeAttribute(parentRange.x, parentRange.y)), false); + } if (subSlot != null) { subSlot.Attach(slot, false); diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs index 8347f4218e7..cf48b05a81e 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs @@ -179,6 +179,11 @@ public VFXExpression ApplyToExpressionGraph(VFXExpression exp) var enumAttribute = (EnumAttribute)attribute; exp = new VFXExpressionMin(exp, VFXValue.Constant((uint)enumAttribute.values.Length - 1)); } + else if (attribute is MinMaxAttribute) + { + var minMaxAttribute = (MinMaxAttribute) attribute; + exp = VFXOperatorUtility.Clamp(exp, VFXValue.Constant(minMaxAttribute.min), VFXValue.Constant(minMaxAttribute.max)); + } else throw new NotImplementedException("Unrecognized expression attribute: " + attribute); } From 0b032409d1ca169b9097702ac38f732dcdb4d549 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 16 Jun 2021 09:33:51 +0200 Subject: [PATCH 48/66] Update warning when changing default frame settings --- .../Settings/DefaultSettingsPanel.cs | 18 ++++++++++++++++++ .../Settings/OverridableFrameSettingsArea.cs | 2 ++ .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 19 ++++++++++++++----- .../Editor/Models/Slots/VFXSlot.cs | 1 - 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs index 5fa2391934f..7111fc849d2 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs @@ -7,6 +7,8 @@ using UnityEditorInternal; using System.Linq; using System.Reflection; +using UnityEditor.VFX.HDRP; +using UnityEditor.VFX.UI; namespace UnityEditor.Rendering.HighDefinition { @@ -117,6 +119,21 @@ static DefaultSettingsPanelIMGUI() SerializedHDRenderPipelineGlobalSettings serializedSettings; HDRenderPipelineGlobalSettings settingsSerialized; + internal static bool needRefreshVfxErrors = false; + private void RefreshVfxErrorsIfNeeded() + { + if (needRefreshVfxErrors) + { + var vfxWindow = VFXViewWindow.currentWindow; + if (vfxWindow != null) + { + var vfxGraph = vfxWindow.graphView.controller.graph; + foreach ( var output in vfxGraph.children.OfType()) + output.RefreshErrors(vfxGraph); + } + } + needRefreshVfxErrors = false; + } public void DoGUI(string searchContext) { // When the asset being serialized has been deleted before its reconstruction @@ -147,6 +164,7 @@ public void DoGUI(string searchContext) EditorGUILayout.Space(); Inspector.Draw(serializedSettings, null); serializedSettings.serializedObject?.ApplyModifiedProperties(); + RefreshVfxErrorsIfNeeded(); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs index 8382e6dbe23..cb423df8e98 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs @@ -253,6 +253,8 @@ void DrawField(Field field, bool withOverride) bool newBool = (bool)DrawFieldShape(fieldRect, oldBool); if (oldBool ^ newBool) { + if(field.field == FrameSettingsField.Decals || field.field == FrameSettingsField.DecalLayers) + DefaultSettingsPanelIMGUI.needRefreshVfxErrors = true; Undo.RecordObject(serializedFrameSettings.serializedObject.targetObject, "Changed FrameSettings " + field.field); serializedFrameSettings.SetEnabled(field.field, newBool); } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 1405636ba6c..345aa7c3105 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -97,10 +97,12 @@ public enum BlendSource private bool affectSmoothness = true; - private bool supportDecals => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals; + private bool supportDecals => HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecals && + HDRenderPipelineGlobalSettings.instance.GetDefaultFrameSettings(FrameSettingsRenderType.Camera).IsEnabled(FrameSettingsField.Decals); private bool enableDecalLayers => supportDecals - && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers; + && HDRenderPipeline.currentAsset.currentPlatformRenderPipelineSettings.supportDecalLayers + && HDRenderPipelineGlobalSettings.instance.GetDefaultFrameSettings(FrameSettingsRenderType.Camera).IsEnabled(FrameSettingsField.DecalLayers); private bool metalAndAODecals => supportDecals @@ -116,13 +118,13 @@ public enum BlendSource public class FadeFactorProperty { - [Range(0, 1), Tooltip("Fade Factor.")] public float fadeFactor = 1.0f; + [Range(0, 1), Tooltip("Controls the transparency of the decal.")] public float fadeFactor = 1.0f; } public class AngleFadeProperty { [Tooltip("Use the min-max slider to control the fade out range of the decal based on the angle between the Decal backward direction and the vertex normal of the receiving surface." + - " Only available if Decal Layers feature is enabled."), MinMax(0.0f, 180.0f)] + " Works only if Decal Layers is enabled both in the HDRP Asset and in the HDRP Settings."), MinMax(0.0f, 180.0f)] public Vector2 angleFade = new Vector2(0.0f, 180.0f); } @@ -346,11 +348,17 @@ public override IEnumerable> additionalRep protected override void GenerateErrors(VFXInvalidateErrorReporter manager) { base.GenerateErrors(manager); + if (!supportDecals) + { + manager.RegisterError("DecalsDisabled", VFXErrorType.Warning, + $"Decals will not be rendered because the 'Decals' is disabled in your HDRP Settings. Enable 'Decals' in your HDRP Asset and your HDRP Settings to make this output work."); + } + if (!enableDecalLayers) { manager.RegisterError("DecalLayersDisabled", VFXErrorType.Warning, $"The Angle Fade parameter won't have any effect, because the 'Decal Layers' setting is disabled." + - $" Enable 'Decal Layers' in your HDRP Asset if you want to control the Angle Fade." + + $" Enable 'Decal Layers' in your HDRP Asset and in the HDRP Settings if you want to control the Angle Fade." + $" There is a performance cost of enabling this option."); } @@ -360,6 +368,7 @@ protected override void GenerateErrors(VFXInvalidateErrorReporter manager) $"The Metallic and Ambient Occlusion parameters won't have any effect, because the 'Metal and AO properties' setting is disabled." + $" Enable 'Metal and AO properties' in your HDRP Asset if you want to control the Metal and AO properties of decals. There is a performance cost of enabling this option."); } + } protected override IEnumerable untransferableSettings diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs index 606a10e7dee..2f3e401db06 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs @@ -384,7 +384,6 @@ private static VFXSlot CreateSub(VFXProperty property, Direction direction) if (slot.property.attributes.attributes.OfType().Any()) { var parentRange = property.attributes.FindRange(); - var attributesPlusRange = subSlot.property.attributes.attributes.Append(new RangeAttribute(parentRange.x, parentRange.y)); subSlot.UpdateAttributes(new VFXPropertyAttributes( new RangeAttribute(parentRange.x, parentRange.y)), false); } if (subSlot != null) From 81ea8f95fee993140526e747e75b9066b897c57a Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 16 Jun 2021 10:45:43 +0200 Subject: [PATCH 49/66] Add normal scale possibility --- .../Outputs/VFXAbstractParticleHDRPOutput.cs | 9 ++------- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 1 - .../Editor/VFXGraph/Shaders/VFXDecal.template | 8 ++++++-- .../VFXGraph/Shaders/VFXDecalVaryings.template | 15 ++++++++++++++- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs index f35f3f0630a..02dcfc2a9bb 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs @@ -54,8 +54,6 @@ protected VFXAbstractParticleHDRPOutput(bool strip = false) : base(strip) {} protected virtual bool allowTextures { get { return GetOrRefreshShaderGraphObject() == null; }} - protected bool useNormalScale = true; - protected IEnumerable baseColorMapProperties { get @@ -76,9 +74,7 @@ protected IEnumerable normalMapsProperties get { yield return new VFXPropertyWithValue(new VFXProperty(GetTextureType(), "normalMap", new TooltipAttribute("Specifies the Normal map to obtain normals in tangent space for the particle."))); - - if(useNormalScale) - yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "normalScale", new TooltipAttribute("Sets the scale of the normals. Larger values increase the impact of the normals.")), 1.0f); + yield return new VFXPropertyWithValue(new VFXProperty(typeof(float), "normalScale", new TooltipAttribute("Sets the scale of the normals. Larger values increase the impact of the normals.")), 1.0f); } } protected IEnumerable emissiveMapsProperties @@ -162,8 +158,7 @@ protected override IEnumerable CollectGPUExpressions(IEnumer if (useNormalMap) { yield return slotExpressions.First(o => o.name == "normalMap"); - if(useNormalScale) - yield return slotExpressions.First(o => o.name == "normalScale"); + yield return slotExpressions.First(o => o.name == "normalScale"); } if (useEmissiveMap) { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 345aa7c3105..fa5d7fd5831 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -29,7 +29,6 @@ public override void OnEnable() { base.OnEnable(); blendMode = BlendMode.Opaque; - useNormalScale = false; sort = SortMode.Off; } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index df66af4f07b..47adba16781 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -135,13 +135,17 @@ if(_EnableDecalLayers) surfaceData.mask.w = maskMapBlend; #endif - + float normalScale = 1.0f; #if USE_NORMAL_MAP float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); + #ifdef VFX_VARYING_NORMALSCALE + normalScale = i.VFX_VARYING_NORMALSCALE; + #endif #else float3 normalTS = float3(0.0f,0.0f,1.0f); #endif - float3 normalWS = normalize(mul(transpose(worldToElement), normalTS)); + float3 normalWS = lerp(worldToElement._m20_m21_m22, mul(transpose(worldToElement), normalTS), normalScale); + normalWS = normalize(normalWS); surfaceData.normalWS.xyz = normalWS; #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template index d8d81ab61bb..6c9164c5754 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecalVaryings.template @@ -52,6 +52,10 @@ ${VFXBegin:VFXHDRPDecalVaryingsMacros} #define VFX_VARYING_UV_BIAS scaleBias.zw #endif +#if USE_NORMAL_MAP +#define VFX_VARYING_NORMALSCALE normalScale +#endif + #define VFX_VARYING_PS_INPUTS ps_input #define VFX_VARYING_POSCS pos @@ -111,10 +115,14 @@ nointerpolation float4 fadeParameters : TEXCOORD4; nointerpolation float3 fadeParameters : TEXCOORD4; #endif - nointerpolation float4 viewToDecal0 : TEXCOORD5; nointerpolation float4 viewToDecal1 : TEXCOORD6; nointerpolation float4 viewToDecal2 : TEXCOORD7; + +#if USE_NORMAL_MAP +VFX_OPTIONAL_INTERPOLATION float normalScale : TEXCOORD8; +#endif + ${VFXEnd} ${VFXBegin:VFXHDRPDecalFillVaryings} @@ -175,4 +183,9 @@ viewToDecal = mul(viewToDecal, VFXGetViewToWorldMatrix()); o.viewToDecal0 = viewToDecal[0]; o.viewToDecal1 = viewToDecal[1]; o.viewToDecal2 = viewToDecal[2]; + +#ifdef VFX_VARYING_NORMALSCALE +${VFXLoadParameter:{normalScale}} +o.VFX_VARYING_NORMALSCALE = normalScale; +#endif ${VFXEnd} From 8c921277e199dc9018ad93711cf5bdefb1adf818 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 16 Jun 2021 11:24:03 +0200 Subject: [PATCH 50/66] BaseColor opacity affect emissive --- .../Editor/VFXGraph/Shaders/VFXDecal.template | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index df66af4f07b..9c42875c15d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -68,9 +68,9 @@ if(_EnableDecalLayers) } float fadeFactor = i.VFX_VARYING_FADEFACTOR; fadeFactor *= angleFadeFactor; -#if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR - float4 color = float4(1,1,1,1); +//Compute color even for emissive, to have the correct opacity + float4 color = float4(1,1,1,1); #if HDRP_USE_BASE_COLOR color *= VFXGetParticleColor(i); #elif HDRP_USE_ADDITIONAL_BASE_COLOR @@ -92,6 +92,8 @@ if(_EnableDecalLayers) #endif color.a *= fadeFactor; VFXClipFragmentColor(color.a,i); + +#if SHADERPASS == SHADERPASS_VFX_DBUFFER_PROJECTOR surfaceData.baseColor.rgb = saturate(color.rgb); surfaceData.baseColor.a = color.a; @@ -173,6 +175,7 @@ if(_EnableDecalLayers) #else surfaceData.emissive = lerp(emissiveRcpExposure, surfaceData.emissive, 1.0f); #endif + surfaceData.emissive *= saturate(color.a); #endif } From 018c5401bc3e0925dd031fca0f0fcb10d23adcd8 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 16 Jun 2021 13:47:51 +0200 Subject: [PATCH 51/66] Surface Gradient mapping + normal scale --- .../Settings/OverridableFrameSettingsArea.cs | 2 +- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 2 +- .../Templates/HDRPDecal/PassDBuffer.template | 3 +++ .../Editor/VFXGraph/Shaders/VFXDecal.template | 24 +++++++++++++++---- .../HDRenderPipeline.Prepass.cs | 2 +- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs index cb423df8e98..472ed53002c 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs @@ -254,7 +254,7 @@ void DrawField(Field field, bool withOverride) if (oldBool ^ newBool) { if(field.field == FrameSettingsField.Decals || field.field == FrameSettingsField.DecalLayers) - DefaultSettingsPanelIMGUI.needRefreshVfxErrors = true; + HDGlobalSettingsPanelIMGUI.needRefreshVfxErrors = true; Undo.RecordObject(serializedFrameSettings.serializedObject.targetObject, "Changed FrameSettings " + field.field); serializedFrameSettings.SetEnabled(field.field, newBool); } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index fa5d7fd5831..38b43fd2692 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -110,7 +110,7 @@ public enum BlendSource [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies the layer mask of the decal.")] - private DecalLayerEnum decalLayer = DecalLayerEnum.LightLayerDefault; + private DecalLayerEnum decalLayer = DecalLayerEnum.DecalLayerDefault; public override bool supportsUV { get { return GetOrRefreshShaderGraphObject() == null; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template index 9757f91ee98..36bd6daa2ce 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassDBuffer.template @@ -26,12 +26,15 @@ Pass #pragma multi_compile _ LIGHT_LAYERS #pragma multi_compile _ DEBUG_DISPLAY #pragma multi_compile_fragment DECALS_3RT DECALS_4RT + #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT #define UNITY_MATERIAL_LIT ${VFXIncludeRP("VFXDecalVaryings.template")} #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/Decal.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + struct ps_input diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 47adba16781..9cfbf992814 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -136,16 +136,32 @@ if(_EnableDecalLayers) #endif float normalScale = 1.0f; - #if USE_NORMAL_MAP - float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); + + #ifdef DECAL_SURFACE_GRADIENT + + #if USE_NORMAL_MAP #ifdef VFX_VARYING_NORMALSCALE normalScale = i.VFX_VARYING_NORMALSCALE; #endif - #else + float2 deriv = UnpackDerivativeNormalRGorAG(SampleTexture(VFX_SAMPLER(normalMap),uvData)) * normalScale; + #else // USE_NORMAL_MAP + float2 deriv = float2(0.0f,0.0f); + #endif // USE_NORMAL_MAP + float3 normalWS = SurfaceGradientFromTBN(deriv, worldToElement._m00_m01_m02, worldToElement._m10_m11_m12); + + #else //DECAL_SURFACE_GRADIENT + #if USE_NORMAL_MAP + #ifdef VFX_VARYING_NORMALSCALE + normalScale = i.VFX_VARYING_NORMALSCALE; + #endif + float3 normalTS = SampleNormalMap(VFX_SAMPLER(normalMap),uvData); + #else //USE_NORMAL_MAP float3 normalTS = float3(0.0f,0.0f,1.0f); - #endif + #endif //USE_NORMAL_MAP float3 normalWS = lerp(worldToElement._m20_m21_m22, mul(transpose(worldToElement), normalTS), normalScale); normalWS = normalize(normalWS); + #endif //DECAL_SURFACE_GRADIENT + surfaceData.normalWS.xyz = normalWS; #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs index 2b7fcf38878..450f10c0c08 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs @@ -958,7 +958,7 @@ void RenderDBuffer(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle dec })); passData.vfxDecalsRendererList = builder.UseRendererList(renderGraph.CreateRendererList( - new RendererListDesc(m_VfxDecalsPassNames, cullingResults, hdCamera.camera) + new RendererUtils.RendererListDesc(m_VfxDecalsPassNames, cullingResults, hdCamera.camera) { sortingCriteria = SortingCriteria.CommonOpaque & ~ SortingCriteria.OptimizeStateChanges, rendererConfiguration = PerObjectData.None, From 8c23f87a89d1ac82352f7004f476de0bcc5e8c0c Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 20 May 2021 15:04:48 +0200 Subject: [PATCH 52/66] Revert "Fix Orthographic mode" --- .../Runtime/VFXGraph/Shaders/VFXCommon.hlsl | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl index 8c97d440314..079f711de89 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/VFXGraph/Shaders/VFXCommon.hlsl @@ -146,17 +146,10 @@ float VFXSampleDepth(float4 posSS) float VFXLinearEyeDepth(float depth) { - if (IsPerspectiveProjection()) - return LinearEyeDepth(depth, _ZBufferParams); - else - { - #if UNITY_REVERSED_Z - depth = 1 - depth; - #endif - return _ProjectionParams.y + depth * (_ProjectionParams.z - _ProjectionParams.y); - } + return LinearEyeDepth(depth,_ZBufferParams); } + void VFXApplyShadowBias(inout float4 posCS, inout float3 posWS, float3 normalWS) { } From 46a7dc7629c536507067588e07381efe007bcda6 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 16 Jun 2021 14:03:13 +0200 Subject: [PATCH 53/66] Add MinMaxAttribute to GraphAttributes --- .../Editor/Types/VFXPropertyAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs index cf48b05a81e..e15fc54f29b 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs @@ -58,7 +58,7 @@ public enum Type Delayed = 1 << 7, BitField = 1 << 8, Enum = GraphAttribute | 1 << 9, - MinMax = 1 << 10, + MinMax = GraphAttribute | 1 << 10, // Tells whether this attribute modifies the expression graph GraphAttribute = 1 << 31, From 8803b0038776164ec9c2ea59c310f1517aec9510 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 17 Jun 2021 10:21:27 +0200 Subject: [PATCH 54/66] updated tooltips --- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 345aa7c3105..4f91b35e0cc 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -78,22 +78,22 @@ public enum BlendSource BlendSource maskOpacityChannel = BlendSource.BaseColorMapAlpha; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, - Tooltip("When enabled, this decal uses its base color. When disabled, the decal has no base color effect.")] + Tooltip("When enabled, modifies the base color of the surface it projects onto.")] private bool affectBaseColor = true; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip( - "When enabled, this decal uses the metallic channel of its Mask Map. When disabled, the decal has no metallic effect.")] + "When enabled, modifies the metallic look of the surface it projects onto using the (R) channel of the Mask Map if one is provided.")] private bool affectMetal = true; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip( - "When enabled, this decal uses the ambient occlusion channel of its Mask Map. When disabled, the decal has no ambient occlusion effect.")] + "When enabled, modifies the ambient occlusion (AO) of the surface it projects onto using the (G) channel of the Mask Map if one is provided.")] private bool affectAmbientOcclusion = true; [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip( - "When enabled, this decal uses the smoothness channel of its Mask Map. When disabled, the decal has no smoothness effect.")] + "When enabled, modifies the smoothness of the surface it projects onto using the (A) channel of the Mask Map if one is provided.")] private bool affectSmoothness = true; @@ -118,7 +118,8 @@ public enum BlendSource public class FadeFactorProperty { - [Range(0, 1), Tooltip("Controls the transparency of the decal.")] public float fadeFactor = 1.0f; + [Range(0, 1), Tooltip("Controls the transparency of the decal.")] + public float fadeFactor = 1.0f; } public class AngleFadeProperty From 68a3a89221dfa3db6d7de270c7de5f329255a3f0 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 1 Jul 2021 10:59:51 +0200 Subject: [PATCH 55/66] Added Graphics Tests + Necessary hdrp project settings change --- .../VFXTests/GraphicsTests/37_DecalsHDRP.meta | 8 + .../37_DecalsHDRP/37_DecalsHDRP.unity | 1180 ++++++++ .../37_DecalsHDRP/37_DecalsHDRP.unity.meta | 7 + .../37_DecalsHDRP/37_DecalsHDRP.vfx | 2398 +++++++++++++++++ .../37_DecalsHDRP/37_DecalsHDRP.vfx.meta | 7 + .../37_DecalsHDRP/Capsules.prefab | 1213 +++++++++ .../37_DecalsHDRP/Capsules.prefab.meta | 7 + .../37_DecalsHDRP/LitMaterial1.mat | 265 ++ .../37_DecalsHDRP/LitMaterial1.mat.meta | 8 + .../37_DecalsHDRP/LitMaterialCapsules.mat | 265 ++ .../LitMaterialCapsules.mat.meta | 8 + .../GraphicsTests/37_DecalsHDRP/RefHDRP.mat | 289 ++ .../37_DecalsHDRP/RefHDRP.mat.meta | 8 + .../Assets/HDRP/HDRenderPipelineAsset.asset | 13 +- .../HDRenderPipelineGlobalSettings.asset | 35 +- .../LinuxEditor/Vulkan/None/37_DecalsHDRP.png | 3 + .../Vulkan/None/37_DecalsHDRP.png.meta | 98 + .../LinuxPlayer/Vulkan/None/37_DecalsHDRP.png | 3 + .../Vulkan/None/37_DecalsHDRP.png.meta | 98 + .../OSXEditor/Metal/None/37_DecalsHDRP.png | 3 + .../Metal/None/37_DecalsHDRP.png.meta | 98 + .../Direct3D11/None/37_DecalsHDRP.png | 3 + .../Direct3D11/None/37_DecalsHDRP.png.meta | 98 + .../Direct3D12/None/37_DecalsHDRP.png | 3 + .../Direct3D12/None/37_DecalsHDRP.png.meta | 98 + .../Vulkan/None/37_DecalsHDRP.png | 3 + .../Vulkan/None/37_DecalsHDRP.png.meta | 98 + .../Direct3D11/None/37_DecalsHDRP.png | 3 + .../Direct3D11/None/37_DecalsHDRP.png.meta | 98 + .../Direct3D12/None/37_DecalsHDRP.png | 3 + .../Direct3D12/None/37_DecalsHDRP.png.meta | 98 + .../Vulkan/None/37_DecalsHDRP.png | 3 + .../Vulkan/None/37_DecalsHDRP.png.meta | 98 + 33 files changed, 6599 insertions(+), 21 deletions(-) create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png.meta create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png create mode 100644 TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png.meta diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP.meta new file mode 100644 index 00000000000..4bcdd9e0344 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82efa38f7d3fe3b43b021b9af5fabace +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity new file mode 100644 index 00000000000..5246943fe08 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity @@ -0,0 +1,1180 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &7919341 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7919344} + - component: {fileID: 7919343} + - component: {fileID: 7919342} + - component: {fileID: 7919345} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &7919342 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7919341} + m_Enabled: 1 +--- !u!20 &7919343 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7919341} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 0 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &7919344 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7919341} + m_LocalRotation: {x: 0.21424943, y: -0.20426108, z: -0.045869093, w: 0.95408106} + m_LocalPosition: {x: 2.08, y: 5.22, z: -6.16} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 22.96, y: -26.401, z: -10.959} +--- !u!114 &7919345 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7919341} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 23c1ce4fb46143f46bc5cb5224c934f6, type: 3} + m_Name: + m_EditorClassIdentifier: + clearColorMode: 0 + backgroundColorHDR: {r: 0.025, g: 0.07, b: 0.19, a: 0} + clearDepth: 1 + volumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + volumeAnchorOverride: {fileID: 0} + antialiasing: 0 + SMAAQuality: 2 + dithering: 0 + stopNaNs: 0 + taaSharpenStrength: 0.5 + TAAQuality: 1 + taaHistorySharpening: 0.35 + taaAntiFlicker: 0.5 + taaMotionVectorRejection: 0 + taaAntiHistoryRinging: 0 + physicalParameters: + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + flipYMode: 0 + xrRendering: 1 + fullscreenPassthrough: 0 + allowDynamicResolution: 0 + customRenderingSettings: 0 + invertFaceCulling: 0 + probeLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + hasPersistentHistory: 0 + allowDeepLearningSuperSampling: 1 + deepLearningSuperSamplingUseCustomQualitySettings: 0 + deepLearningSuperSamplingQuality: 0 + deepLearningSuperSamplingUseCustomAttributes: 0 + deepLearningSuperSamplingUseOptimalSettings: 1 + deepLearningSuperSamplingSharpening: 0 + exposureTarget: {fileID: 0} + materialMipBias: 0 + m_RenderingPathCustomFrameSettings: + bitDatas: + data1: 72198260625768269 + data2: 13763000477350297624 + lodBias: 1 + lodBiasMode: 0 + lodBiasQualityLevel: 0 + maximumLODLevel: 0 + maximumLODLevelMode: 0 + maximumLODLevelQualityLevel: 0 + sssQualityMode: 0 + sssQualityLevel: 0 + sssCustomSampleBudget: 20 + msaaMode: 1 + materialQuality: 0 + renderingPathCustomFrameSettingsOverrideMask: + mask: + data1: 0 + data2: 0 + defaultFrameSettings: 0 + m_Version: 8 + m_ObsoleteRenderingPath: 0 + m_ObsoleteFrameSettings: + overrides: 0 + enableShadow: 0 + enableContactShadows: 0 + enableShadowMask: 0 + enableSSR: 0 + enableSSAO: 0 + enableSubsurfaceScattering: 0 + enableTransmission: 0 + enableAtmosphericScattering: 0 + enableVolumetrics: 0 + enableReprojectionForVolumetrics: 0 + enableLightLayers: 0 + enableExposureControl: 1 + diffuseGlobalDimmer: 0 + specularGlobalDimmer: 0 + shaderLitMode: 0 + enableDepthPrepassWithDeferredRendering: 0 + enableTransparentPrepass: 0 + enableMotionVectors: 0 + enableObjectMotionVectors: 0 + enableDecals: 0 + enableRoughRefraction: 0 + enableTransparentPostpass: 0 + enableDistortion: 0 + enablePostprocess: 0 + enableOpaqueObjects: 0 + enableTransparentObjects: 0 + enableRealtimePlanarReflection: 0 + enableMSAA: 0 + enableAsyncCompute: 0 + runLightListAsync: 0 + runSSRAsync: 0 + runSSAOAsync: 0 + runContactShadowsAsync: 0 + runVolumeVoxelizationAsync: 0 + lightLoopSettings: + overrides: 0 + enableDeferredTileAndCluster: 0 + enableComputeLightEvaluation: 0 + enableComputeLightVariants: 0 + enableComputeMaterialVariants: 0 + enableFptlForForwardOpaque: 0 + enableBigTilePrepass: 0 + isFptlEnabled: 0 +--- !u!1 &111821124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 111821126} + - component: {fileID: 111821125} + - component: {fileID: 111821127} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &111821125 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 111821124} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 4 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 2 + m_AreaSize: {x: 0.5, y: 0.5} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &111821126 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 111821124} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!114 &111821127 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 111821124} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Intensity: 4 + m_EnableSpotReflector: 1 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 2 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_ShapeWidth: 0.5 + m_ShapeHeight: 0.5 + m_AspectRatio: 1 + m_ShapeRadius: 0.025 + m_SoftnessScale: 1 + m_UseCustomSpotLightShadowCone: 0 + m_CustomSpotLightShadowCone: 30 + m_MaxSmoothness: 0.99 + m_ApplyRangeAttenuation: 1 + m_DisplayAreaLightEmissiveMesh: 0 + m_AreaLightCookie: {fileID: 0} + m_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + m_AreaLightShadowCone: 120 + m_UseScreenSpaceShadows: 0 + m_InteractsWithSky: 1 + m_AngularDiameter: 0.5 + m_FlareSize: 2 + m_FlareTint: {r: 1, g: 1, b: 1, a: 1} + m_FlareFalloff: 4 + m_SurfaceTexture: {fileID: 0} + m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + m_Distance: 1.5e+11 + m_UseRayTracedShadows: 0 + m_NumRayTracingSamples: 4 + m_FilterTracedShadow: 1 + m_FilterSizeTraced: 16 + m_SunLightConeAngle: 0.5 + m_LightShadowRadius: 0.5 + m_SemiTransparentShadow: 0 + m_ColorShadow: 1 + m_DistanceBasedFiltering: 0 + m_EvsmExponent: 15 + m_EvsmLightLeakBias: 0 + m_EvsmVarianceBias: 0.00001 + m_EvsmBlurPasses: 0 + m_LightlayersMask: 1 + m_LinkShadowLayers: 1 + m_ShadowNearPlane: 0.1 + m_BlockerSampleCount: 24 + m_FilterSampleCount: 16 + m_MinFilterSize: 0.1 + m_KernelSize: 5 + m_LightAngle: 1 + m_MaxDepthBias: 0.001 + m_ShadowResolution: + m_Override: 512 + m_UseOverride: 1 + m_Level: 0 + m_ShadowDimmer: 1 + m_VolumetricShadowDimmer: 1 + m_ShadowFadeDistance: 10000 + m_UseContactShadow: + m_Override: 0 + m_UseOverride: 1 + m_Level: 0 + m_RayTracedContactShadow: 0 + m_ShadowTint: {r: 0, g: 0, b: 0, a: 1} + m_PenumbraTint: 0 + m_NormalBias: 0.75 + m_SlopeBias: 0.5 + m_ShadowUpdateMode: 0 + m_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.2 + - 0.3 + m_ShadowCascadeBorders: + - 0.2 + - 0.2 + - 0.2 + - 0.2 + m_ShadowAlgorithm: 0 + m_ShadowVariant: 0 + m_ShadowPrecision: 0 + useOldInspector: 0 + useVolumetric: 1 + featuresFoldout: 1 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 11 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 +--- !u!1001 &227902493 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 364701056500851380, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_Name + value: Capsules (2) + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.x + value: -5 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.y + value: 3.19 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.z + value: -0.5 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 90 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: dd7bc03a52648064c9774166951246f4, type: 3} +--- !u!1 &857781994 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 857781995} + - component: {fileID: 857781998} + - component: {fileID: 857781997} + - component: {fileID: 857781996} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &857781995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 857781994} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 5, z: 5} + m_LocalScale: {x: 10, y: 0.099999994, z: 10} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1625580323} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!65 &857781996 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 857781994} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &857781997 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 857781994} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &857781998 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 857781994} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &930477061 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 930477062} + - component: {fileID: 930477065} + - component: {fileID: 930477064} + - component: {fileID: 930477063} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &930477062 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 930477061} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: -5, y: 5, z: 0} + m_LocalScale: {x: 10, y: 0.099999994, z: 10} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1625580323} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!65 &930477063 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 930477061} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &930477064 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 930477061} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &930477065 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 930477061} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1625580322 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1625580323} + m_Layer: 0 + m_Name: Walls + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1625580323 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1625580322} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1889418976} + - {fileID: 857781995} + - {fileID: 930477062} + - {fileID: 1864588316} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1822477097 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 364701056500851380, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_Name + value: Capsules (1) + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.y + value: 3.19 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.z + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.w + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.z + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 90 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: dd7bc03a52648064c9774166951246f4, type: 3} +--- !u!1 &1864588315 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1864588316} + - component: {fileID: 1864588319} + - component: {fileID: 1864588318} + - component: {fileID: 1864588317} + m_Layer: 0 + m_Name: Cube (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1864588316 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1864588315} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 0.099999994, z: 10} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1625580323} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1864588317 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1864588315} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1864588318 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1864588315} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9487358daf87dc245ada35ed43dda09b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1864588319 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1864588315} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1889418975 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1889418976} + - component: {fileID: 1889418979} + - component: {fileID: 1889418978} + - component: {fileID: 1889418977} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1889418976 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889418975} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 0.099999994, z: 10} + m_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 1625580323} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &1889418977 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889418975} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1889418978 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889418975} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1889418979 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1889418975} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &364701055728504394 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 364701056500851380, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_Name + value: Capsules + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 364701056500851381, guid: dd7bc03a52648064c9774166951246f4, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: dd7bc03a52648064c9774166951246f4, type: 3} diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity.meta new file mode 100644 index 00000000000..0c7c154d4a5 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b1a2d5cb5366cc14c84167107a4c11c9 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx new file mode 100644 index 00000000000..c34d4987804 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx @@ -0,0 +1,2398 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &114340500867371532 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d01270efd3285ea4a9d6c555cb0a8027, type: 3} + m_Name: VFXUI + m_EditorClassIdentifier: + groupInfos: [] + stickyNoteInfos: [] + categories: [] + uiBounds: + serializedVersion: 2 + x: 941 + y: -190 + width: 450 + height: 1753 +--- !u!114 &114350483966674976 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d4c867f6b72b714dbb5fd1780afe208, type: 3} + m_Name: 37_DecalsHDRP + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614555} + - {fileID: 8926484042661614558} + - {fileID: 8926484042661614583} + - {fileID: 8926484042661614596} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_UIInfos: {fileID: 114340500867371532} + m_ParameterInfo: [] + m_ImportDependencies: [] + m_GraphVersion: 8 + m_ResourceVersion: 1 + m_SubgraphDependencies: [] + m_CategoryPath: +--- !u!2058629511 &8926484042661614527 +VisualEffectResource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 37_DecalsHDRP + m_Graph: {fileID: 114350483966674976} + m_Infos: + m_RendererSettings: + motionVectorGenerationMode: 0 + shadowCastingMode: 0 + receiveShadows: 0 + reflectionProbeUsage: 0 + lightProbeUsage: 0 + m_CullingFlags: 3 + m_UpdateMode: 0 + m_PreWarmDeltaTime: 0.05 + m_PreWarmStepCount: 0 + m_InitialEventName: OnPlay +--- !u!114 &8926484042661614555 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 73a13919d81fb7444849bae8b5c812a2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: + - {fileID: 8926484042661614556} + m_UIPosition: {x: 941, y: -190} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: [] + m_OutputSlots: [] + m_Label: Spawn system + m_Data: {fileID: 8926484042661614595} + m_InputFlowSlot: + - link: [] + - link: [] + m_OutputFlowSlot: + - link: + - context: {fileID: 8926484042661614558} + slotIndex: 0 + loopDuration: 0 + loopCount: 0 + delayBeforeLoop: 0 + delayAfterLoop: 0 +--- !u!114 &8926484042661614556 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f05c6884b705ce14d82ae720f0ec209f, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614555} + m_Children: [] + m_UIPosition: {x: 233.38269, y: 57.572144} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614557} + m_OutputSlots: [] + m_Disabled: 0 +--- !u!114 &8926484042661614557 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614557} + m_MasterData: + m_Owner: {fileID: 8926484042661614556} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 16 + m_Space: 2147483647 + m_Property: + name: Rate + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614558 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9dfea48843f53fc438eabc12a3a30abc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: + - {fileID: 8926484042661614607} + - {fileID: 8926484042661614626} + - {fileID: 8926484042661614628} + m_UIPosition: {x: 954, y: 75} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614559} + m_OutputSlots: [] + m_Label: + m_Data: {fileID: 8926484042661614568} + m_InputFlowSlot: + - link: + - context: {fileID: 8926484042661614555} + slotIndex: 0 + m_OutputFlowSlot: + - link: + - context: {fileID: 8926484042661614583} + slotIndex: 0 +--- !u!114 &8926484042661614559 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b605c022ee79394a8a776c0869b3f9a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614560} + - {fileID: 8926484042661614564} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 8926484042661614558} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.AABox, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"center":{"x":0.0,"y":1.0,"z":0.0},"size":{"x":2.0,"y":3.0,"z":2.0}}' + m_Space: 0 + m_Property: + name: bounds + m_serializedType: + m_SerializableType: UnityEditor.VFX.AABox, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614560 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614559} + m_Children: + - {fileID: 8926484042661614561} + - {fileID: 8926484042661614562} + - {fileID: 8926484042661614563} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: center + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614561 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614560} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614562 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614560} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614563 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614560} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614559} + m_Children: + - {fileID: 8926484042661614565} + - {fileID: 8926484042661614566} + - {fileID: 8926484042661614567} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: size + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614565 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614564} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614566 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614564} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614567 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614564} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614559} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614568 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d78581a96eae8bf4398c282eb0b098bd, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + title: + m_Owners: + - {fileID: 8926484042661614558} + - {fileID: 8926484042661614583} + - {fileID: 8926484042661614596} + dataType: 0 + capacity: 7 + stripCapacity: 16 + particlePerStripCount: 16 + needsComputeBounds: 0 + boundsSettingMode: 1 + m_Space: 0 +--- !u!114 &8926484042661614583 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2dc095764ededfa4bb32fa602511ea4b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 942, y: 806} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: [] + m_OutputSlots: [] + m_Label: + m_Data: {fileID: 8926484042661614568} + m_InputFlowSlot: + - link: + - context: {fileID: 8926484042661614558} + slotIndex: 0 + m_OutputFlowSlot: + - link: + - context: {fileID: 8926484042661614596} + slotIndex: 0 + integration: 0 + angularIntegration: 0 + ageParticles: 1 + reapParticles: 1 + skipZeroDeltaUpdate: 0 +--- !u!114 &8926484042661614595 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f68759077adc0b143b6e1c101e82065e, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + title: + m_Owners: + - {fileID: 8926484042661614555} +--- !u!114 &8926484042661614596 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e68693b8b943efc4488917ca7c41f0b2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 114350483966674976} + m_Children: + - {fileID: 8926484042661614640} + m_UIPosition: {x: 967, y: 1023} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614597} + - {fileID: 8926484042661614598} + - {fileID: 8926484042661614601} + - {fileID: 8926484042661614651} + - {fileID: 8926484042661614652} + - {fileID: 8926484042661614653} + - {fileID: 8926484042661614677} + - {fileID: 8926484042661614678} + - {fileID: 8926484042661614684} + - {fileID: 8926484042661614602} + - {fileID: 8926484042661614604} + m_OutputSlots: [] + m_Label: + m_Data: {fileID: 8926484042661614568} + m_InputFlowSlot: + - link: + - context: {fileID: 8926484042661614583} + slotIndex: 0 + m_OutputFlowSlot: + - link: [] + blendMode: 3 + useAlphaClipping: 0 + generateMotionVector: 0 + excludeFromTAA: 0 + materialOffset: 0 + m_SubOutputs: + - {fileID: 8926484042661614606} + cullMode: 0 + zWriteMode: 0 + zTestMode: 0 + colorMapping: 0 + uvMode: 0 + useSoftParticle: 0 + sortPriority: 0 + sort: 1 + indirectDraw: 0 + computeCulling: 0 + frustumCulling: 0 + castShadows: 0 + useExposureWeight: 0 + flipbookLayout: 0 + shaderGraph: {fileID: 0} + materialSettings: + m_PropertyNames: [] + m_PropertyValues: [] + useBaseColorMap: 3 + useMaskMap: 1 + useNormalMap: 1 + useEmissiveMap: 1 + colorMode: 1 + useEmissive: 1 + normalOpacityChannel: 0 + maskOpacityChannel: 0 + affectBaseColor: 1 + affectMetal: 1 + affectAmbientOcclusion: 0 + affectSmoothness: 1 + decalLayer: 1 +--- !u!114 &8926484042661614597 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614597} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 1 + m_Space: 2147483647 + m_Property: + name: fadeFactor + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614598 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1b2b751071c7fc14f9fa503163991826, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614599} + - {fileID: 8926484042661614600} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614598} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"x":0.0,"y":50.0}' + m_Space: 2147483647 + m_Property: + name: angleFade + m_serializedType: + m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614599 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614598} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614598} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614600 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614598} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614598} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614601 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70a331b1d86cc8d4aa106ccbe0da5852, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614601} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"obj":{"fileID":2800000,"guid":"276d9e395ae18fe40a9b4988549f2349","type":3}}' + m_Space: 2147483647 + m_Property: + name: baseColorMap + m_serializedType: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614602 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614602} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0.8 + m_Space: 2147483647 + m_Property: + name: metallic + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614604 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614604} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0.8 + m_Space: 2147483647 + m_Property: + name: smoothness + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614606 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 081ffb0090424ba4cb05370a42ead6b9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + opaqueRenderQueue: 0 + transparentRenderQueue: 1 +--- !u!114 &8926484042661614607 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3ab9b05052599f344a6b1ae204834e10, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614558} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614608} + - {fileID: 8926484042661614609} + - {fileID: 8926484042661614610} + - {fileID: 8926484042661614615} + - {fileID: 8926484042661614620} + - {fileID: 8926484042661614625} + m_OutputSlots: [] + m_Disabled: 0 + compositionPosition: 0 + compositionDirection: 0 + compositionTargetPosition: 1 + shape: 1 + index: 0 + writePosition: 1 + writeTargetPosition: 0 + mode: 0 +--- !u!114 &8926484042661614608 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4d246e354feb93041a837a9ef59437cb, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614608} + m_MasterData: + m_Owner: {fileID: 8926484042661614607} + m_Value: + m_Type: + m_SerializableType: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 0 + m_Space: 2147483647 + m_Property: + name: OffsetIndex + m_serializedType: + m_SerializableType: System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614609 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c52d920e7fff73b498050a6b3c4404ca, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614609} + m_MasterData: + m_Owner: {fileID: 8926484042661614607} + m_Value: + m_Type: + m_SerializableType: System.UInt32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 8 + m_Space: 2147483647 + m_Property: + name: Count + m_serializedType: + m_SerializableType: System.UInt32, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614610 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5265657162cc1a241bba03a3b0476d99, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614611} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614610} + m_MasterData: + m_Owner: {fileID: 8926484042661614607} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.Position, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"position":{"x":0.0,"y":0.0,"z":0.0}}' + m_Space: 0 + m_Property: + name: Center + m_serializedType: + m_SerializableType: UnityEditor.VFX.Position, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614611 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614610} + m_Children: + - {fileID: 8926484042661614612} + - {fileID: 8926484042661614613} + - {fileID: 8926484042661614614} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614610} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: position + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614612 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614611} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614610} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614613 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614611} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614610} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614614 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614611} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614610} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8f2b4a846fd4c14a893cde576ad172b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614616} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614615} + m_MasterData: + m_Owner: {fileID: 8926484042661614607} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"direction":{"x":0.0,"y":1.0,"z":0.0}}' + m_Space: 0 + m_Property: + name: Normal + m_serializedType: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614616 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614615} + m_Children: + - {fileID: 8926484042661614617} + - {fileID: 8926484042661614618} + - {fileID: 8926484042661614619} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614615} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: direction + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614617 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614616} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614615} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614618 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614616} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614615} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614619 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614616} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614615} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614620 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8f2b4a846fd4c14a893cde576ad172b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614621} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614620} + m_MasterData: + m_Owner: {fileID: 8926484042661614607} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"direction":{"x":1.0,"y":0.0,"z":0.0}}' + m_Space: 0 + m_Property: + name: Up + m_serializedType: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614621 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614620} + m_Children: + - {fileID: 8926484042661614622} + - {fileID: 8926484042661614623} + - {fileID: 8926484042661614624} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614620} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: direction + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614622 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614621} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614620} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614623 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614621} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614620} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614624 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614621} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614620} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614625 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614625} + m_MasterData: + m_Owner: {fileID: 8926484042661614607} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 2 + m_Space: 2147483647 + m_Property: + name: Radius + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614626 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614558} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614627} + m_OutputSlots: [] + m_Disabled: 0 + attribute: size + Composition: 0 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614627 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614627} + m_MasterData: + m_Owner: {fileID: 8926484042661614626} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 2 + m_Space: 2147483647 + m_Property: + name: Size + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614628 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a971fa2e110a0ac42ac1d8dae408704b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614558} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614629} + m_OutputSlots: [] + m_Disabled: 1 + attribute: lifetime + Composition: 0 + Source: 0 + Random: 0 + channels: 6 +--- !u!114 &8926484042661614629 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614629} + m_MasterData: + m_Owner: {fileID: 8926484042661614628} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 1 + m_Space: 2147483647 + m_Property: + name: Lifetime + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614640 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d16c6aeaef944094b9a1633041804207, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614596} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 0 + m_UISuperCollapsed: 0 + m_InputSlots: + - {fileID: 8926484042661614641} + - {fileID: 8926484042661614646} + m_OutputSlots: [] + m_Disabled: 0 + mode: 4 + axes: 4 +--- !u!114 &8926484042661614641 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8f2b4a846fd4c14a893cde576ad172b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614642} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614641} + m_MasterData: + m_Owner: {fileID: 8926484042661614640} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"direction":{"x":0.0,"y":-1.0,"z":0.0}}' + m_Space: 0 + m_Property: + name: AxisZ + m_serializedType: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614642 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614641} + m_Children: + - {fileID: 8926484042661614643} + - {fileID: 8926484042661614644} + - {fileID: 8926484042661614645} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614641} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: direction + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614643 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614642} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614641} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614644 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614642} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614641} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614645 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614642} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614641} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614646 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8f2b4a846fd4c14a893cde576ad172b, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614647} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614646} + m_MasterData: + m_Owner: {fileID: 8926484042661614640} + m_Value: + m_Type: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"direction":{"x":0.0,"y":0.0,"z":1.0}}' + m_Space: 0 + m_Property: + name: AxisY + m_serializedType: + m_SerializableType: UnityEditor.VFX.DirectionType, Unity.VisualEffectGraph.Editor, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614647 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ac39bd03fca81b849929b9c966f1836a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614646} + m_Children: + - {fileID: 8926484042661614648} + - {fileID: 8926484042661614649} + - {fileID: 8926484042661614650} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614646} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: direction + m_serializedType: + m_SerializableType: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614648 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614647} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614646} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: x + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614649 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614647} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614646} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: y + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614650 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614647} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614646} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: z + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614651 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70a331b1d86cc8d4aa106ccbe0da5852, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614651} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"obj":{"fileID":2800000,"guid":"ce77a084d49e57c4abd17b6630e76d69","type":3}}' + m_Space: 2147483647 + m_Property: + name: maskMap + m_serializedType: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614652 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70a331b1d86cc8d4aa106ccbe0da5852, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614652} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"obj":{"fileID":2800000,"guid":"67132172251318649ae8ea1101a5377a","type":3}}' + m_Space: 2147483647 + m_Property: + name: normalMap + m_serializedType: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614653 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614653} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 1 + m_Space: 2147483647 + m_Property: + name: normalScale + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614677 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70a331b1d86cc8d4aa106ccbe0da5852, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614677} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"obj":{"fileID":10300,"guid":"0000000000000000f000000000000000","type":0}}' + m_Space: 2147483647 + m_Property: + name: emissiveMap + m_serializedType: + m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614678 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614678} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_SerializableObject: 2 + m_Space: 2147483647 + m_Property: + name: emissiveScale + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614684 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c82227d5759e296488798b1554a72a15, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 0} + m_Children: + - {fileID: 8926484042661614685} + - {fileID: 8926484042661614686} + - {fileID: 8926484042661614687} + - {fileID: 8926484042661614688} + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614684} + m_MasterData: + m_Owner: {fileID: 8926484042661614596} + m_Value: + m_Type: + m_SerializableType: UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_SerializableObject: '{"r":1.0,"g":0.0,"b":0.0,"a":1.0}' + m_Space: 2147483647 + m_Property: + name: emissiveColor + m_serializedType: + m_SerializableType: UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, + Culture=neutral, PublicKeyToken=null + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614685 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614684} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614684} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: r + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614684} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614684} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: g + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614684} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614684} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: b + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] +--- !u!114 &8926484042661614688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UIIgnoredErrors: [] + m_Parent: {fileID: 8926484042661614684} + m_Children: [] + m_UIPosition: {x: 0, y: 0} + m_UICollapsed: 1 + m_UISuperCollapsed: 0 + m_MasterSlot: {fileID: 8926484042661614684} + m_MasterData: + m_Owner: {fileID: 0} + m_Value: + m_Type: + m_SerializableType: + m_SerializableObject: + m_Space: 2147483647 + m_Property: + name: a + m_serializedType: + m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + m_Direction: 0 + m_LinkedSlots: [] diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx.meta new file mode 100644 index 00000000000..42b85eff66b --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/37_DecalsHDRP.vfx.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9cefe43b6adf6c047b6faada83577ce1 +VisualEffectImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab new file mode 100644 index 00000000000..a37ebf16bcf --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab @@ -0,0 +1,1213 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &364701055776209177 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701055776209180} + - component: {fileID: 364701055776209183} + - component: {fileID: 364701055776209182} + m_Layer: 0 + m_Name: 37_DecalsHDRP + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701055776209180 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701055776209177} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!2083052967 &364701055776209183 +VisualEffect: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701055776209177} + m_Enabled: 1 + m_Asset: {fileID: 8926484042661614526, guid: 9cefe43b6adf6c047b6faada83577ce1, type: 3} + m_InitialEventName: OnPlay + m_InitialEventNameOverriden: 0 + m_StartSeed: 0 + m_ResetSeedOnPlay: 1 + m_ResourceVersion: 1 + m_PropertySheet: + m_Float: + m_Array: [] + m_Vector2f: + m_Array: [] + m_Vector3f: + m_Array: [] + m_Vector4f: + m_Array: [] + m_Uint: + m_Array: [] + m_Int: + m_Array: [] + m_Matrix4x4f: + m_Array: [] + m_AnimationCurve: + m_Array: [] + m_Gradient: + m_Array: [] + m_NamedObject: + m_Array: [] + m_Bool: + m_Array: [] +--- !u!73398921 &364701055776209182 +VFXRenderer: + serializedVersion: 1 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701055776209177} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &364701056104474092 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701056104474093} + - component: {fileID: 364701056104474080} + - component: {fileID: 364701056104474083} + - component: {fileID: 364701056104474082} + m_Layer: 0 + m_Name: Capsule (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701056104474093 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056104474092} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.419, y: 0, z: 1.419} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701056104474080 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056104474092} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701056104474083 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056104474092} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701056104474082 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056104474092} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701056409421204 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701056409421205} + - component: {fileID: 364701056409421224} + - component: {fileID: 364701056409421227} + - component: {fileID: 364701056409421226} + m_Layer: 0 + m_Name: Capsule (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701056409421205 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056409421204} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701056409421224 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056409421204} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701056409421227 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056409421204} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701056409421226 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056409421204} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701056500851380 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701056500851381} + m_Layer: 0 + m_Name: Capsules + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701056500851381 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056500851380} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 364701057388305624} + - {fileID: 364701056894017701} + - {fileID: 364701055776209180} + - {fileID: 364701057174334415} + - {fileID: 364701056979496344} + - {fileID: 364701056409421205} + - {fileID: 364701056948667657} + - {fileID: 364701057035830014} + - {fileID: 364701056104474093} + - {fileID: 364701057355917769} + - {fileID: 364701056822749211} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &364701056822749210 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701056822749211} + - component: {fileID: 364701056822749214} + - component: {fileID: 364701056822749209} + - component: {fileID: 364701056822749208} + m_Layer: 0 + m_Name: Capsule (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701056822749211 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056822749210} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.419, y: 0, z: 1.419} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701056822749214 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056822749210} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701056822749209 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056822749210} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701056822749208 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056822749210} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701056894017702 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701056894017701} + - component: {fileID: 364701056894017700} + - component: {fileID: 364701056894017703} + m_Layer: 0 + m_Name: Point Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701056894017701 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056894017702} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &364701056894017700 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056894017702} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 2 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 15.915494 + m_Range: 3.34 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 2 + m_AreaSize: {x: 0.5, y: 0.5} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!114 &364701056894017703 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056894017702} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Intensity: 200 + m_EnableSpotReflector: 1 + m_LuxAtDistance: 1 + m_InnerSpotPercent: 0 + m_SpotIESCutoffPercent: 100 + m_LightDimmer: 1 + m_VolumetricDimmer: 1 + m_LightUnit: 0 + m_FadeDistance: 10000 + m_VolumetricFadeDistance: 10000 + m_AffectDiffuse: 1 + m_AffectSpecular: 1 + m_NonLightmappedOnly: 0 + m_ShapeWidth: 0.5 + m_ShapeHeight: 0.5 + m_AspectRatio: 1 + m_ShapeRadius: 0.025 + m_SoftnessScale: 1 + m_UseCustomSpotLightShadowCone: 0 + m_CustomSpotLightShadowCone: 30 + m_MaxSmoothness: 0.99 + m_ApplyRangeAttenuation: 1 + m_DisplayAreaLightEmissiveMesh: 0 + m_AreaLightCookie: {fileID: 0} + m_IESPoint: {fileID: 0} + m_IESSpot: {fileID: 0} + m_IncludeForRayTracing: 1 + m_AreaLightShadowCone: 120 + m_UseScreenSpaceShadows: 0 + m_InteractsWithSky: 1 + m_AngularDiameter: 0.5 + m_FlareSize: 2 + m_FlareTint: {r: 1, g: 1, b: 1, a: 1} + m_FlareFalloff: 4 + m_SurfaceTexture: {fileID: 0} + m_SurfaceTint: {r: 1, g: 1, b: 1, a: 1} + m_Distance: 1.5e+11 + m_UseRayTracedShadows: 0 + m_NumRayTracingSamples: 4 + m_FilterTracedShadow: 1 + m_FilterSizeTraced: 16 + m_SunLightConeAngle: 0.5 + m_LightShadowRadius: 0.5 + m_SemiTransparentShadow: 0 + m_ColorShadow: 1 + m_DistanceBasedFiltering: 0 + m_EvsmExponent: 15 + m_EvsmLightLeakBias: 0 + m_EvsmVarianceBias: 0.00001 + m_EvsmBlurPasses: 0 + m_LightlayersMask: 1 + m_LinkShadowLayers: 1 + m_ShadowNearPlane: 0.1 + m_BlockerSampleCount: 24 + m_FilterSampleCount: 16 + m_MinFilterSize: 0.1 + m_KernelSize: 5 + m_LightAngle: 1 + m_MaxDepthBias: 0.001 + m_ShadowResolution: + m_Override: 512 + m_UseOverride: 1 + m_Level: 0 + m_ShadowDimmer: 1 + m_VolumetricShadowDimmer: 1 + m_ShadowFadeDistance: 10000 + m_UseContactShadow: + m_Override: 0 + m_UseOverride: 1 + m_Level: 0 + m_RayTracedContactShadow: 0 + m_ShadowTint: {r: 0, g: 0, b: 0, a: 1} + m_PenumbraTint: 0 + m_NormalBias: 0.75 + m_SlopeBias: 0.5 + m_ShadowUpdateMode: 0 + m_AlwaysDrawDynamicShadows: 0 + m_UpdateShadowOnLightMovement: 0 + m_CachedShadowTranslationThreshold: 0.01 + m_CachedShadowAngularThreshold: 0.5 + m_BarnDoorAngle: 90 + m_BarnDoorLength: 0.05 + m_preserveCachedShadow: 0 + m_OnDemandShadowRenderOnPlacement: 1 + m_ShadowCascadeRatios: + - 0.05 + - 0.2 + - 0.3 + m_ShadowCascadeBorders: + - 0.2 + - 0.2 + - 0.2 + - 0.2 + m_ShadowAlgorithm: 0 + m_ShadowVariant: 0 + m_ShadowPrecision: 0 + useOldInspector: 0 + useVolumetric: 1 + featuresFoldout: 1 + m_AreaLightEmissiveMeshShadowCastingMode: 0 + m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0 + m_AreaLightEmissiveMeshLayer: -1 + m_Version: 11 + m_ObsoleteShadowResolutionTier: 1 + m_ObsoleteUseShadowQualitySettings: 0 + m_ObsoleteCustomShadowResolution: 512 + m_ObsoleteContactShadows: 0 + m_PointlightHDType: 0 + m_SpotLightShape: 0 + m_AreaLightShape: 0 +--- !u!1 &364701056948667656 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701056948667657} + - component: {fileID: 364701056948667660} + - component: {fileID: 364701056948667663} + - component: {fileID: 364701056948667662} + m_Layer: 0 + m_Name: Capsule (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701056948667657 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056948667656} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -1.419, y: 0, z: -1.419} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701056948667660 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056948667656} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701056948667663 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056948667656} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701056948667662 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056948667656} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701056979496347 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701056979496344} + - component: {fileID: 364701056979496351} + - component: {fileID: 364701056979496350} + - component: {fileID: 364701056979496345} + m_Layer: 0 + m_Name: Capsule (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701056979496344 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056979496347} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.419, y: 0, z: -1.419} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701056979496351 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056979496347} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701056979496350 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056979496347} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701056979496345 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701056979496347} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701057035830009 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701057035830014} + - component: {fileID: 364701057035830013} + - component: {fileID: 364701057035830012} + - component: {fileID: 364701057035830015} + m_Layer: 0 + m_Name: Capsule (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701057035830014 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057035830009} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -2, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701057035830013 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057035830009} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701057035830012 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057035830009} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701057035830015 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057035830009} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701057174334414 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701057174334415} + - component: {fileID: 364701057174334402} + - component: {fileID: 364701057174334413} + - component: {fileID: 364701057174334412} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701057174334415 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057174334414} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701057174334402 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057174334414} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701057174334413 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057174334414} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701057174334412 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057174334414} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701057355917768 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701057355917769} + - component: {fileID: 364701057355917772} + - component: {fileID: 364701057355917775} + - component: {fileID: 364701057355917774} + m_Layer: 0 + m_Name: Capsule (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701057355917769 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057355917768} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &364701057355917772 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057355917768} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &364701057355917775 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057355917768} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: eed0c2bb5fd8b324aab0aa1b6eb984e4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!136 &364701057355917774 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057355917768} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &364701057388305626 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 364701057388305624} + - component: {fileID: 364701057388305627} + m_Layer: 0 + m_Name: Decal Projector + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &364701057388305624 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057388305626} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 1.419, y: 0, z: 1.419} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 364701056500851381} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &364701057388305627 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 364701057388305626} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f19d9143a39eb3b46bc4563e9889cfbd, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 2100000, guid: ed1d038f1e4536848997eb65c4fb3008, type: 2} + m_DrawDistance: 1000 + m_FadeScale: 0.9 + m_StartAngleFade: 0 + m_EndAngleFade: 49.723755 + m_UVScale: {x: 1, y: 1} + m_UVBias: {x: 0, y: 0} + m_AffectsTransparency: 0 + m_DecalLayerMask: 1 + m_ScaleMode: 0 + m_Offset: {x: 0, y: 0, z: 0} + m_Size: {x: 2, y: 2, z: 2} + m_FadeFactor: 1 + m_Version: 2 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab.meta new file mode 100644 index 00000000000..de29edd7b6a --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/Capsules.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dd7bc03a52648064c9774166951246f4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat new file mode 100644 index 00000000000..481a56033ff --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat @@ -0,0 +1,265 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-822871840289685783 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LitMaterial1 + m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} + m_ShaderKeywords: _DISABLE_SSR_TRANSPARENT _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2225 + stringTagMap: {} + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - ForwardEmissiveForDeferred + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AnisotropyMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _CoatMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissiveColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HeightMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecularColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubsurfaceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmittanceColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AORemapMax: 1 + - _AORemapMin: 0 + - _ATDistance: 1 + - _AddPrecomputedVelocity: 0 + - _AlbedoAffectEmissive: 0 + - _AlphaCutoff: 0.5 + - _AlphaCutoffEnable: 0 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Anisotropy: 0 + - _BlendMode: 0 + - _CoatMask: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 0 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnergyConservingSpecularColor: 1 + - _ForceForwardEmissive: 0 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 1 + - _MetallicRemapMax: 1 + - _MetallicRemapMin: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _OpaqueCullMode: 2 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _Smoothness: 0.5 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _TransmissionEnable: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} + - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat.meta new file mode 100644 index 00000000000..fd1af2e7e54 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterial1.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9487358daf87dc245ada35ed43dda09b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat new file mode 100644 index 00000000000..6c72501daf6 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat @@ -0,0 +1,265 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-822871840289685783 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LitMaterialCapsules + m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} + m_ShaderKeywords: _DISABLE_SSR_TRANSPARENT _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2225 + stringTagMap: {} + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - ForwardEmissiveForDeferred + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AnisotropyMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _CoatMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissiveColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HeightMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecularColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubsurfaceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmittanceColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AORemapMax: 1 + - _AORemapMin: 0 + - _ATDistance: 1 + - _AddPrecomputedVelocity: 0 + - _AlbedoAffectEmissive: 0 + - _AlphaCutoff: 0.5 + - _AlphaCutoffEnable: 0 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Anisotropy: 0 + - _BlendMode: 0 + - _CoatMask: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 0 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnergyConservingSpecularColor: 1 + - _ForceForwardEmissive: 0 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 0 + - _MetallicRemapMax: 1 + - _MetallicRemapMin: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _OpaqueCullMode: 2 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _Smoothness: 0 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _TransmissionEnable: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 0.6179246, b: 0.87605566, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 1, g: 0.6179245, b: 0.87605566, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} + - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat.meta new file mode 100644 index 00000000000..21ac8d2b315 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/LitMaterialCapsules.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eed0c2bb5fd8b324aab0aa1b6eb984e4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat new file mode 100644 index 00000000000..8d54d110051 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat @@ -0,0 +1,289 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: RefHDRP + m_Shader: {fileID: 4800000, guid: 1d64af84bdc970c4fae0c1e06dd95b73, type: 3} + m_ShaderKeywords: _COLORMAP _EMISSIVEMAP _MASKMAP _MATERIAL_AFFECTS_ALBEDO _MATERIAL_AFFECTS_MASKMAP + _MATERIAL_AFFECTS_NORMAL _NORMALMAP + m_LightmapFlags: 4 + m_EnableInstancingVariants: 1 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + - ForwardEmissiveForDeferred + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AnisotropyMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 276d9e395ae18fe40a9b4988549f2349, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _CoatMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissiveColorMap: + m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HeightMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 2800000, guid: ce77a084d49e57c4abd17b6630e76d69, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 67132172251318649ae8ea1101a5377a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecularColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubsurfaceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmittanceColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AO: 1 + - _AORemapMax: 1 + - _AORemapMin: 0 + - _ATDistance: 1 + - _AddPrecomputedVelocity: 0 + - _AffectAO: 0 + - _AffectAlbedo: 1 + - _AffectEmission: 1 + - _AffectMetal: 1 + - _AffectNormal: 1 + - _AffectSmoothness: 1 + - _AlbedoAffectEmissive: 0 + - _AlphaCutoff: 0.5 + - _AlphaCutoffEnable: 0 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Anisotropy: 0 + - _BlendMode: 0 + - _CoatMask: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DecalBlend: 1 + - _DecalColorMask0: 15 + - _DecalColorMask1: 15 + - _DecalColorMask2: 11 + - _DecalColorMask3: 8 + - _DecalMaskMapBlueScale: 1 + - _DecalMeshBiasType: 0 + - _DecalMeshDepthBias: 0 + - _DecalMeshViewBias: 0 + - _DecalStencilRef: 16 + - _DecalStencilWriteMask: 16 + - _DepthOffsetEnable: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 1 + - _DrawOrder: 0 + - _DstBlend: 0 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnergyConservingSpecularColor: 1 + - _ForceForwardEmissive: 0 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaskBlendSrc: 0 + - _MaterialID: 1 + - _Metallic: 0 + - _MetallicRemapMax: 0.81714284 + - _MetallicRemapMin: 0 + - _NormalBlendSrc: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _OpaqueCullMode: 2 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _Smoothness: 0.5 + - _SmoothnessRemapMax: 0.83428574 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _TransmissionEnable: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _Unity_Identify_HDRP_Decal: 1 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 1, g: 0, b: 0, a: 1} + - _EmissiveColorHDR: {r: 1, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} + - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] +--- !u!114 &294827378403032639 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat.meta new file mode 100644 index 00000000000..891e52de14d --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/AllTests/VFXTests/GraphicsTests/37_DecalsHDRP/RefHDRP.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed1d038f1e4536848997eb65c4fb3008 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/HDRP/HDRenderPipelineAsset.asset b/TestProjects/VisualEffectGraph_HDRP/Assets/HDRP/HDRenderPipelineAsset.asset index c7b393e7f9d..22c590b718d 100644 --- a/TestProjects/VisualEffectGraph_HDRP/Assets/HDRP/HDRenderPipelineAsset.asset +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/HDRP/HDRenderPipelineAsset.asset @@ -38,10 +38,10 @@ MonoBehaviour: m_Values: 000100000004000000080000 m_SchemaId: m_Id: With3Levels - supportDecals: 0 - supportDecalLayers: 0 - supportSurfaceGradient: 0 - decalNormalBufferHP: 0 + supportDecals: 1 + supportDecalLayers: 1 + supportSurfaceGradient: 1 + decalNormalBufferHP: 1 msaaSampleCount: 1 supportMotionVectors: 1 supportRuntimeDebugDisplay: 1 @@ -113,7 +113,7 @@ MonoBehaviour: drawDistance: 1000 atlasWidth: 4096 atlasHeight: 4096 - perChannelMask: 0 + perChannelMask: 1 postProcessSettings: m_LutSize: 32 lutFormat: 48 @@ -131,6 +131,7 @@ MonoBehaviour: upsampleFilter: 1 forceResolution: 0 forcedPercentage: 100 + lowResTransparencyMinimumThreshold: 0 lowresTransparentSettings: enabled: 1 checkerboardDepthBuffer: 1 @@ -259,7 +260,7 @@ MonoBehaviour: m_ObsoleteDecalLayerName6: m_ObsoleteDecalLayerName7: allowShaderVariantStripping: 1 - enableSRPBatcher: 0 + enableSRPBatcher: 1 availableMaterialQualityLevels: -1 m_DefaultMaterialQualityLevel: 4 diffusionProfileSettings: {fileID: 11400000, guid: cbe1ee9036c47b84ba1b8b3dbcde2aff, diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/HDRPDefaultResources/HDRenderPipelineGlobalSettings.asset b/TestProjects/VisualEffectGraph_HDRP/Assets/HDRPDefaultResources/HDRenderPipelineGlobalSettings.asset index 0f6b7eae15d..746c7214d84 100644 --- a/TestProjects/VisualEffectGraph_HDRP/Assets/HDRPDefaultResources/HDRenderPipelineGlobalSettings.asset +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/HDRPDefaultResources/HDRenderPipelineGlobalSettings.asset @@ -18,7 +18,7 @@ MonoBehaviour: m_RenderingPathDefaultCameraFrameSettings: bitDatas: data1: 87872878411613 - data2: 4539628434053070872 + data2: 4539628438348038168 lodBias: 1 lodBiasMode: 0 lodBiasQualityLevel: 0 @@ -68,26 +68,31 @@ MonoBehaviour: afterPostProcessCustomPostProcesses: [] beforeTAACustomPostProcesses: [] lightLayerName0: - lightLayerName1: - lightLayerName2: - lightLayerName3: - lightLayerName4: - lightLayerName5: - lightLayerName6: - lightLayerName7: - decalLayerName0: - decalLayerName1: - decalLayerName2: - decalLayerName3: + lightLayerName1: Light Layer 1 + lightLayerName2: Light Layer 2 + lightLayerName3: Light Layer 3 + lightLayerName4: Light Layer 4 + lightLayerName5: Light Layer 5 + lightLayerName6: Light Layer 6 + lightLayerName7: Light Layer 7 + decalLayerName0: Decal Layer default + decalLayerName1: Decal Layer 1 + decalLayerName2: Decal Layer 2 + decalLayerName3: Decal Layer 3 decalLayerName4: - decalLayerName5: - decalLayerName6: - decalLayerName7: + decalLayerName5: Decal Layer 5 + decalLayerName6: Decal Layer 6 + decalLayerName7: Decal Layer 7 shaderVariantLogLevel: 0 lensAttenuationMode: 0 diffusionProfileSettingsList: - {fileID: 11400000, guid: cbe1ee9036c47b84ba1b8b3dbcde2aff, type: 2} - {fileID: 11400000, guid: 38c0905fbe269274782e939ce4393d85, type: 2} + rendererListCulling: 0 DLSSProjectId: 000000 useDLSSCustomProjectId: 0 + supportProbeVolumes: 0 + apvScenesBounds: + serializedBounds: [] + serializedHasVolumes: [] m_Version: 2 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..8ae061c0c91 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 9655da80160d59a40a82d27add0290e2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..c3f7a6f1854 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 79ac2f6b7062a424dbfc361b52e0ea53 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..09de007bfae --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 77f642163b47b784eabcc9229b812051 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..8527a8f2b29 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: dcf63f1b9ead33245ad0cd5f1ecb6f3e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..79977b6c214 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: ac76a2057cd2e3643b18e065ab952c3a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..cdde6b70788 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: b271a885576a2ac4aa9663abf9b6be4c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..a49f4cb391f --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: d8ada9b048d5ee44fba8cdf09897e05c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..e16f2cdbdc6 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D12/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 9544fd4e22b632d4cb99a25be779d1c0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png new file mode 100644 index 00000000000..afc1f549c80 --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a11d568173264982bed4124d55bf503d99f10fbf1553c050262462ec1642d3f +size 310999 diff --git a/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png.meta b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png.meta new file mode 100644 index 00000000000..aeb3d134d0e --- /dev/null +++ b/TestProjects/VisualEffectGraph_HDRP/Assets/ReferenceImages/Linear/WindowsPlayer/Vulkan/None/37_DecalsHDRP.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 2c966983ed08ed745a49db65de0ab278 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: From 34116cda8e855e8a784fe1d69eed40368c2f8946 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Thu, 1 Jul 2021 11:59:17 +0200 Subject: [PATCH 56/66] Update changelog --- com.unity.visualeffectgraph/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index 732c57f8d9b..53d9855fd72 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Provide explicit access to spawnCount in graph - Support of direct link event to initialize context (which support several event within the same frame) - Structured Graphics Buffer support as exposed type +- Added HDRP Decal output context ### Changed - Allow remaking an existing link. From d4407efa3cfb9ddd0d89c68ce3c078ada42c1d28 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 5 Jul 2021 08:58:28 +0200 Subject: [PATCH 57/66] add headers --- .../Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 4f91b35e0cc..ffa0e78ef0e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -69,7 +69,7 @@ public enum BlendSource MaskMapBlue, } - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), Header("Opacity Channels"), SerializeField, Tooltip("Specifies the source this Material uses as opacity for its Normal Map.")] BlendSource normalOpacityChannel = BlendSource.BaseColorMapAlpha; @@ -77,7 +77,7 @@ public enum BlendSource Tooltip("Specifies the source this Material uses as opacity for its Mask Map.")] BlendSource maskOpacityChannel = BlendSource.BaseColorMapAlpha; - [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, + [VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), Header("Surface options"), SerializeField, Tooltip("When enabled, modifies the base color of the surface it projects onto.")] private bool affectBaseColor = true; From e2b3dbf31c2a101872b100025e0632f1744f33fb Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 5 Jul 2021 10:06:47 +0200 Subject: [PATCH 58/66] Refresh error feedback refactor + formatting --- .../RenderPipeline/HDRenderPipelineEditor.cs | 18 +- .../RenderPipeline/HDRenderPipelineUI.cs | 4 +- .../Settings/HDGlobalSettingsWindow.cs | 17 +- .../HDGlobalSettingsWindow.cs.preformat.bak | 592 ++++++++++++++++++ .../Settings/OverridableFrameSettingsArea.cs | 2 +- .../Outputs/VFXAbstractParticleHDRPOutput.cs | 3 +- .../VFXGraph/Outputs/VFXDecalHDRPOutput.cs | 8 +- .../Utility/VFXHDRPSettingsUtility.cs | 23 + .../Editor/VFXGraph/VFXHDRPSubOutput.cs | 11 +- .../HDRenderPipeline.Prepass.cs | 2 +- .../RenderPipeline/HDStringConstants.cs | 2 - .../Editor/Controls/VFXMinMaxSliderField.cs | 23 +- .../Views/Properties/Vector2PropertyRM.cs | 10 +- .../VFXPlanarPrimitiveOutput.cs | 1 - .../Editor/Models/Slots/VFXSlot.cs | 2 +- .../Editor/Types/VFXPropertyAttribute.cs | 2 +- 16 files changed, 644 insertions(+), 76 deletions(-) create mode 100644 com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs index 6f990aa9ea7..ca82f39223d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineEditor.cs @@ -36,23 +36,7 @@ public override void OnInspectorGUI() EditorGUIUtility.labelWidth *= 0.5f; serialized.Apply(); - RefreshVfxErrorsIfNeeded(); - - } - - private void RefreshVfxErrorsIfNeeded() - { - if (needRefreshVfxWarnings) - { - var vfxWindow = VFXViewWindow.currentWindow; - if (vfxWindow != null) - { - var vfxGraph = vfxWindow.graphView.controller.graph; - foreach ( var output in vfxGraph.children.OfType()) - output.RefreshErrors(vfxGraph); - } - } - needRefreshVfxWarnings = false; + VFXHDRPSettingsUtility.RefreshVfxErrorsIfNeeded(ref needRefreshVfxWarnings); } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs index ccc56d189fa..f22f3a21ced 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/HDRenderPipelineUI.cs @@ -416,7 +416,7 @@ static void Drawer_SectionDecalSettings(SerializedHDRenderPipelineAsset serializ if (EditorGUI.EndChangeCheck()) { // Tell VFX - ((HDRenderPipelineEditor) owner).needRefreshVfxWarnings = true; + ((HDRenderPipelineEditor)owner).needRefreshVfxWarnings = true; } EditorGUI.BeginChangeCheck(); @@ -429,7 +429,7 @@ static void Drawer_SectionDecalSettings(SerializedHDRenderPipelineAsset serializ if (EditorGUI.EndChangeCheck()) { // Tell VFX - ((HDRenderPipelineEditor) owner).needRefreshVfxWarnings = true; + ((HDRenderPipelineEditor)owner).needRefreshVfxWarnings = true; } EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportSurfaceGradient, Styles.supportSurfaceGradientContent); diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs index fada0b25529..49bfad65062 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs @@ -76,20 +76,7 @@ public void OnTitleBarGUI() } internal static bool needRefreshVfxErrors = false; - private void RefreshVfxErrorsIfNeeded() - { - if (needRefreshVfxErrors) - { - var vfxWindow = VFXViewWindow.currentWindow; - if (vfxWindow != null) - { - var vfxGraph = vfxWindow.graphView.controller.graph; - foreach ( var output in vfxGraph.children.OfType()) - output.RefreshErrors(vfxGraph); - } - } - needRefreshVfxErrors = false; - } + public void DoGUI(string searchContext) { // When the asset being serialized has been deleted before its reconstruction @@ -120,7 +107,7 @@ public void DoGUI(string searchContext) EditorGUILayout.Space(); Inspector.Draw(serializedSettings, null); serializedSettings.serializedObject?.ApplyModifiedProperties(); - RefreshVfxErrorsIfNeeded(); + VFXHDRPSettingsUtility.RefreshVfxErrorsIfNeeded(ref needRefreshVfxErrors); } } diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak new file mode 100644 index 00000000000..fada0b25529 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak @@ -0,0 +1,592 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering.HighDefinition; +using UnityEngine.Rendering; +using UnityEngine.UIElements; +using UnityEditorInternal; +using System.Linq; +using System.Reflection; +using UnityEditor.VFX.HDRP; +using UnityEditor.VFX.UI; + +namespace UnityEditor.Rendering.HighDefinition +{ + using CED = CoreEditorDrawer; + + class HDGlobalSettingsPanelProvider + { + static HDGlobalSettingsPanelIMGUI s_IMGUIImpl = new HDGlobalSettingsPanelIMGUI(); + + [SettingsProvider] + public static SettingsProvider CreateSettingsProvider() + { + return new SettingsProvider("Project/Graphics/HDRP Global Settings", SettingsScope.Project) + { + activateHandler = s_IMGUIImpl.OnActivate, + keywords = SettingsProvider.GetSearchKeywordsFromGUIContentProperties() + .Concat(OverridableFrameSettingsArea.frameSettingsKeywords) + .ToArray(), + guiHandler = s_IMGUIImpl.DoGUI, + titleBarGuiHandler = s_IMGUIImpl.OnTitleBarGUI + }; + } + } + + internal partial class HDGlobalSettingsPanelIMGUI + { + public static readonly CED.IDrawer Inspector; + + public class DocumentationUrls + { + public static readonly string k_Volumes = "Volume-Profile"; + public static readonly string k_DiffusionProfiles = "Override-Diffusion-Profile"; + public static readonly string k_FrameSettings = "Frame-Settings"; + public static readonly string k_LightLayers = "Light-Layers"; + public static readonly string k_DecalLayers = "Decal"; + public static readonly string k_CustomPostProcesses = "Custom-Post-Process"; + } + + static HDGlobalSettingsPanelIMGUI() + { + Inspector = CED.Group( + VolumeSection, + CED.Group((serialized, owner) => EditorGUILayout.Space()), + DiffusionProfileSettingsSection, + CED.Group((serialized, owner) => EditorGUILayout.Space()), + FrameSettingsSection, + CED.Group((serialized, owner) => EditorGUILayout.Space()), + LayerNamesSection, + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CustomPostProcessesSection, + CED.Group((serialized, owner) => EditorGUILayout.Space()), + MiscSection, + CED.Group((serialized, owner) => EditorGUILayout.Space()), + ResourcesSection + ); + } + + SerializedHDRenderPipelineGlobalSettings serializedSettings; + HDRenderPipelineGlobalSettings settingsSerialized; + + public void OnTitleBarGUI() + { + if (GUILayout.Button(CoreEditorStyles.iconHelp, CoreEditorStyles.iconHelpStyle)) + Help.BrowseURL(Documentation.GetPageLink("Default-Settings-Window")); + } + + internal static bool needRefreshVfxErrors = false; + private void RefreshVfxErrorsIfNeeded() + { + if (needRefreshVfxErrors) + { + var vfxWindow = VFXViewWindow.currentWindow; + if (vfxWindow != null) + { + var vfxGraph = vfxWindow.graphView.controller.graph; + foreach ( var output in vfxGraph.children.OfType()) + output.RefreshErrors(vfxGraph); + } + } + needRefreshVfxErrors = false; + } + public void DoGUI(string searchContext) + { + // When the asset being serialized has been deleted before its reconstruction + if (serializedSettings != null && serializedSettings.serializedObject.targetObject == null) + { + serializedSettings = null; + settingsSerialized = null; + } + + if (serializedSettings == null || settingsSerialized != HDRenderPipelineGlobalSettings.instance) + { + if (HDRenderPipeline.currentAsset != null || HDRenderPipelineGlobalSettings.instance != null) + { + settingsSerialized = HDRenderPipelineGlobalSettings.Ensure(); + var serializedObject = new SerializedObject(settingsSerialized); + serializedSettings = new SerializedHDRenderPipelineGlobalSettings(serializedObject); + } + } + else if (settingsSerialized != null && serializedSettings != null) + { + serializedSettings.serializedObject.Update(); + } + + DrawAssetSelection(ref serializedSettings, null); + DrawWarnings(ref serializedSettings, null); + if (settingsSerialized != null && serializedSettings != null) + { + EditorGUILayout.Space(); + Inspector.Draw(serializedSettings, null); + serializedSettings.serializedObject?.ApplyModifiedProperties(); + RefreshVfxErrorsIfNeeded(); + } + } + + /// + /// Executed when activate is called from the settings provider. + /// + /// + /// + public void OnActivate(string searchContext, VisualElement rootElement) + { + } + + void DrawWarnings(ref SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + bool isHDRPinUse = HDRenderPipeline.currentAsset != null; + if (isHDRPinUse && serialized != null) + return; + + if (isHDRPinUse) + { + EditorGUILayout.HelpBox(Styles.warningGlobalSettingsMissing, MessageType.Warning); + } + else + { + EditorGUILayout.HelpBox(Styles.warningHdrpNotActive, MessageType.Warning); + if (serialized == null) + EditorGUILayout.HelpBox(Styles.infoGlobalSettingsMissing, MessageType.Info); + } + } + + #region Global HDRenderPipelineGlobalSettings asset selection + void DrawAssetSelection(ref SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + var oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = Styles.labelWidth; + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUI.BeginChangeCheck(); + var newAsset = (HDRenderPipelineGlobalSettings)EditorGUILayout.ObjectField(settingsSerialized , typeof(HDRenderPipelineGlobalSettings), false); + if (EditorGUI.EndChangeCheck()) + { + HDRenderPipelineGlobalSettings.UpdateGraphicsSettings(newAsset); + if (settingsSerialized != null && !settingsSerialized.Equals(null)) + EditorUtility.SetDirty(settingsSerialized); + } + + if (GUILayout.Button(Styles.newAssetButtonLabel, GUILayout.Width(45), GUILayout.Height(18))) + { + HDAssetFactory.HDRenderPipelineGlobalSettingsCreator.Create(useProjectSettingsFolder: true, assignToActiveAsset: true); + } + + bool guiEnabled = GUI.enabled; + GUI.enabled = guiEnabled && (settingsSerialized != null); + if (GUILayout.Button(Styles.cloneAssetButtonLabel, GUILayout.Width(45), GUILayout.Height(18))) + { + HDAssetFactory.HDRenderPipelineGlobalSettingsCreator.Clone(settingsSerialized, assignToActiveAsset: true); + } + GUI.enabled = guiEnabled; + } + EditorGUIUtility.labelWidth = oldWidth; + EditorGUILayout.Space(); + } + + #endregion // Global HDRenderPipelineGlobalSettings asset selection + + #region Resources + + static readonly CED.IDrawer ResourcesSection = CED.Group( + CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.resourceLabel)), + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CED.Group(DrawResourcesSection), + CED.Group((serialized, owner) => EditorGUILayout.Space()) + ); + static void DrawResourcesSection(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + using (new EditorGUI.IndentLevelScope()) + { + var oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = Styles.labelWidth; + + EditorGUILayout.PropertyField(serialized.renderPipelineResources, Styles.renderPipelineResourcesContent); + bool oldGuiEnabled = GUI.enabled; + GUI.enabled = false; + + EditorGUILayout.PropertyField(serialized.renderPipelineRayTracingResources, Styles.renderPipelineRayTracingResourcesContent); + + // Not serialized as editor only datas... Retrieve them in data + EditorGUI.showMixedValue = serialized.editorResourceHasMultipleDifferentValues; + var editorResources = EditorGUILayout.ObjectField(Styles.renderPipelineEditorResourcesContent, serialized.firstEditorResources, typeof(HDRenderPipelineEditorResources), allowSceneObjects: false) as HDRenderPipelineEditorResources; + + EditorGUI.showMixedValue = false; + + GUI.enabled = oldGuiEnabled; + EditorGUIUtility.labelWidth = oldWidth; + } + } + + #endregion // Resources + + #region Frame Settings + + static readonly CED.IDrawer FrameSettingsSection = CED.Group( + CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.frameSettingsLabel, Documentation.GetPageLink(DocumentationUrls.k_FrameSettings))), + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CED.Group(DrawFrameSettings), + CED.Group((serialized, owner) => EditorGUILayout.Space()) + ); + + static void DrawFrameSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + using (new EditorGUI.IndentLevelScope()) + { + EditorGUILayout.LabelField(Styles.frameSettingsLabel_Camera, CoreEditorStyles.subSectionHeaderStyle); + DrawFrameSettingsSubsection(0, serialized.defaultCameraFrameSettings, owner); + EditorGUILayout.Space(); + + EditorGUILayout.LabelField(Styles.frameSettingsLabel_RTProbe, CoreEditorStyles.subSectionHeaderStyle); + DrawFrameSettingsSubsection(1, serialized.defaultRealtimeReflectionFrameSettings, owner); + EditorGUILayout.Space(); + + EditorGUILayout.LabelField(Styles.frameSettingsLabel_BakedProbe, CoreEditorStyles.subSectionHeaderStyle); + DrawFrameSettingsSubsection(2, serialized.defaultBakedOrCustomReflectionFrameSettings, owner); + EditorGUILayout.Space(); + } + } + + static private bool[] m_ShowFrameSettings_Rendering = { false, false, false }; + static private bool[] m_ShowFrameSettings_Lighting = { false, false, false }; + static private bool[] m_ShowFrameSettings_AsyncCompute = { false, false, false }; + static private bool[] m_ShowFrameSettings_LightLoopDebug = { false, false, false }; + + static void DrawFrameSettingsSubsection(int index, SerializedFrameSettings serialized, Editor owner) + { + var oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = Styles.labelWidth; + + CoreEditorUtils.DrawSplitter(); + m_ShowFrameSettings_Rendering[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.renderingSettingsHeaderContent, m_ShowFrameSettings_Rendering[index]); + if (m_ShowFrameSettings_Rendering[index]) + { + using (new EditorGUI.IndentLevelScope()) + { + FrameSettingsUI.Drawer_SectionRenderingSettings(serialized, owner, withOverride: false); + } + } + + CoreEditorUtils.DrawSplitter(); + m_ShowFrameSettings_Lighting[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.lightSettingsHeaderContent, m_ShowFrameSettings_Lighting[index]); + if (m_ShowFrameSettings_Lighting[index]) + { + using (new EditorGUI.IndentLevelScope()) + { + FrameSettingsUI.Drawer_SectionLightingSettings(serialized, owner, withOverride: false); + } + } + + CoreEditorUtils.DrawSplitter(); + m_ShowFrameSettings_AsyncCompute[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.asyncComputeSettingsHeaderContent, m_ShowFrameSettings_AsyncCompute[index]); + if (m_ShowFrameSettings_AsyncCompute[index]) + { + using (new EditorGUI.IndentLevelScope()) + { + FrameSettingsUI.Drawer_SectionAsyncComputeSettings(serialized, owner, withOverride: false); + } + } + + CoreEditorUtils.DrawSplitter(); + m_ShowFrameSettings_LightLoopDebug[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.lightLoopSettingsHeaderContent, m_ShowFrameSettings_LightLoopDebug[index]); + if (m_ShowFrameSettings_LightLoopDebug[index]) + { + using (new EditorGUI.IndentLevelScope()) + { + FrameSettingsUI.Drawer_SectionLightLoopSettings(serialized, owner, withOverride: false); + } + } + CoreEditorUtils.DrawSplitter(); + EditorGUIUtility.labelWidth = oldWidth; + } + + #endregion // Frame Settings + + #region Custom Post Processes + + static readonly CED.IDrawer CustomPostProcessesSection = CED.Group( + CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.customPostProcessOrderLabel, Documentation.GetPageLink(DocumentationUrls.k_CustomPostProcesses))), + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CED.Group(DrawCustomPostProcess) + ); + static void DrawCustomPostProcess(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.Space(5); + serialized.uiBeforeTransparentCustomPostProcesses.DoLayoutList(); + } + GUILayout.Space(2); + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.Space(5); + serialized.uiBeforeTAACustomPostProcesses.DoLayoutList(); + } + GUILayout.Space(2); + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.Space(5); + serialized.uiBeforePostProcessCustomPostProcesses.DoLayoutList(); + } + GUILayout.Space(2); + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.Space(5); + serialized.uiAfterPostProcessCustomPostProcesses.DoLayoutList(); + } + } + + #endregion // Custom Post Processes + + #region Diffusion Profile Settings List + + static readonly CED.IDrawer DiffusionProfileSettingsSection = CED.Group( + CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.diffusionProfileSettingsLabel, Documentation.GetPageLink(DocumentationUrls.k_DiffusionProfiles))), + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CED.Group(DrawDiffusionProfileSettings) + ); + static void DrawDiffusionProfileSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + using (new EditorGUILayout.HorizontalScope()) + { + GUILayout.Space(5); + serialized.m_DiffusionProfileUI.OnGUI(serialized.diffusionProfileSettingsList); + } + } + + #endregion //Diffusion Profile Settings List + + #region Volume Profiles + static Editor m_CachedDefaultVolumeProfileEditor; + static Editor m_CachedLookDevVolumeProfileEditor; + static int m_CurrentVolumeProfileInstanceID; + + static readonly CED.IDrawer VolumeSection = CED.Group( + CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.volumeComponentsLabel, Documentation.GetPageLink(DocumentationUrls.k_Volumes))), + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CED.Group(DrawVolumeSection), + CED.Group((serialized, owner) => EditorGUILayout.Space()) + ); + + static void DrawVolumeSection(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + using (new EditorGUI.IndentLevelScope()) + { + var oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = Styles.labelWidth; + + HDRenderPipelineGlobalSettings globalSettings = serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings; + VolumeProfile asset = null; + using (new EditorGUILayout.HorizontalScope()) + { + var oldAssetValue = serialized.defaultVolumeProfile.objectReferenceValue; + EditorGUILayout.PropertyField(serialized.defaultVolumeProfile, Styles.defaultVolumeProfileLabel); + asset = serialized.defaultVolumeProfile.objectReferenceValue as VolumeProfile; + if (asset == null && oldAssetValue != null) + { + Debug.Log("Default Volume Profile Asset cannot be null. Rolling back to previous value."); + serialized.defaultVolumeProfile.objectReferenceValue = oldAssetValue; + } + + if (GUILayout.Button(Styles.newVolumeProfileLabel, GUILayout.Width(38), GUILayout.Height(18))) + { + HDAssetFactory.VolumeProfileCreator.CreateAndAssign(HDAssetFactory.VolumeProfileCreator.Kind.Default, globalSettings); + } + } + if (asset != null) + { + // The state of the profile can change without the asset reference changing so in this case we need to reset the editor. + if (m_CurrentVolumeProfileInstanceID != asset.GetInstanceID() && m_CachedDefaultVolumeProfileEditor != null) + { + m_CurrentVolumeProfileInstanceID = asset.GetInstanceID(); + m_CachedDefaultVolumeProfileEditor = null; + } + + Editor.CreateCachedEditor(asset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedDefaultVolumeProfileEditor); + bool oldEnabled = GUI.enabled; + GUI.enabled = AssetDatabase.IsOpenForEdit(asset); + m_CachedDefaultVolumeProfileEditor.OnInspectorGUI(); + GUI.enabled = oldEnabled; + } + + EditorGUILayout.Space(); + + VolumeProfile lookDevAsset = null; + using (new EditorGUILayout.HorizontalScope()) + { + var oldAssetValue = serialized.lookDevVolumeProfile.objectReferenceValue; + EditorGUILayout.PropertyField(serialized.lookDevVolumeProfile, Styles.lookDevVolumeProfileLabel); + lookDevAsset = serialized.lookDevVolumeProfile.objectReferenceValue as VolumeProfile; + if (lookDevAsset == null && oldAssetValue != null) + { + Debug.Log("LookDev Volume Profile Asset cannot be null. Rolling back to previous value."); + serialized.lookDevVolumeProfile.objectReferenceValue = oldAssetValue; + } + + if (GUILayout.Button(Styles.newVolumeProfileLabel, GUILayout.Width(38), GUILayout.Height(18))) + { + HDAssetFactory.VolumeProfileCreator.CreateAndAssign(HDAssetFactory.VolumeProfileCreator.Kind.LookDev, globalSettings); + } + } + if (lookDevAsset != null) + { + Editor.CreateCachedEditor(lookDevAsset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedLookDevVolumeProfileEditor); + bool oldEnabled = GUI.enabled; + GUI.enabled = AssetDatabase.IsOpenForEdit(lookDevAsset); + m_CachedLookDevVolumeProfileEditor.OnInspectorGUI(); + GUI.enabled = oldEnabled; + + if (lookDevAsset.Has()) + EditorGUILayout.HelpBox("VisualEnvironment is not modifiable and will be overridden by the LookDev", MessageType.Warning); + if (lookDevAsset.Has()) + EditorGUILayout.HelpBox("HDRISky is not modifiable and will be overridden by the LookDev", MessageType.Warning); + } + EditorGUIUtility.labelWidth = oldWidth; + } + } + + #endregion // Volume Profiles + + #region Misc Settings + + static MethodInfo s_CleanupRenderPipelineMethod = typeof(RenderPipelineManager).GetMethod("CleanupRenderPipeline", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); + + static readonly CED.IDrawer MiscSection = CED.Group( + CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.generalSettingsLabel)), + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CED.Group(DrawMiscSettings), + CED.Group((serialized, owner) => EditorGUILayout.Space()) + ); + static void DrawMiscSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + var oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = Styles.labelWidth; + + using (new EditorGUI.IndentLevelScope()) + { + EditorGUILayout.PropertyField(serialized.shaderVariantLogLevel, Styles.shaderVariantLogLevelLabel); + EditorGUILayout.PropertyField(serialized.lensAttenuation, Styles.lensAttenuationModeContentLabel); + EditorGUILayout.PropertyField(serialized.rendererListCulling, Styles.rendererListCulling); + +#if ENABLE_NVIDIA && ENABLE_NVIDIA_MODULE + EditorGUILayout.PropertyField(serialized.useDLSSCustomProjectId, Styles.useDLSSCustomProjectIdLabel); + if (serialized.useDLSSCustomProjectId.boolValue) + EditorGUILayout.PropertyField(serialized.DLSSProjectId, Styles.DLSSProjectIdLabel); +#endif + + EditorGUI.BeginChangeCheck(); + EditorGUILayout.PropertyField(serialized.supportProbeVolumes, Styles.probeVolumeSupportContentLabel); + if (EditorGUI.EndChangeCheck()) + { + // If we are running HDRP, we need to make sure the RP is reinitialized + if (HDRenderPipeline.currentPipeline != null) + s_CleanupRenderPipelineMethod?.Invoke(null, null); + } + + EditorGUILayout.PropertyField(serialized.supportRuntimeDebugDisplay, Styles.supportRuntimeDebugDisplayContentLabel); + } + EditorGUIUtility.labelWidth = oldWidth; + } + + #endregion // Misc Settings + + #region Rendering Layer Names + + static readonly CED.IDrawer LayerNamesSection = CED.Group( + CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.layerNamesLabel, contextAction: pos => OnContextClickRenderingLayerNames(pos, serialized), documentationURL: Documentation.GetPageLink(DocumentationUrls.k_LightLayers))), + CED.Group((serialized, owner) => EditorGUILayout.Space()), + CED.Group(DrawLayerNamesSettings), + CED.Group((serialized, owner) => EditorGUILayout.Space()) + ); + + static void DrawLayerNamesSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + var oldWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = Styles.labelWidth; + + CoreEditorUtils.DrawSplitter(); + DrawLightLayerNames(serialized, owner); + CoreEditorUtils.DrawSplitter(); + DrawDecalLayerNames(serialized, owner); + CoreEditorUtils.DrawSplitter(); + EditorGUILayout.Space(); + + EditorGUIUtility.labelWidth = oldWidth; + } + + static private bool m_ShowLightLayerNames = false; + static private bool m_ShowDecalLayerNames = false; + static void DrawLightLayerNames(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + m_ShowLightLayerNames = CoreEditorUtils.DrawHeaderFoldout(Styles.lightLayersLabel, + m_ShowLightLayerNames, + documentationURL: Documentation.GetPageLink(DocumentationUrls.k_LightLayers), + contextAction: pos => OnContextClickRenderingLayerNames(pos, serialized, section: 1) + ); + if (m_ShowLightLayerNames) + { + using (new EditorGUI.IndentLevelScope()) + { + using (var changed = new EditorGUI.ChangeCheckScope()) + { + EditorGUILayout.DelayedTextField(serialized.lightLayerName0, Styles.lightLayerName0); + EditorGUILayout.DelayedTextField(serialized.lightLayerName1, Styles.lightLayerName1); + EditorGUILayout.DelayedTextField(serialized.lightLayerName2, Styles.lightLayerName2); + EditorGUILayout.DelayedTextField(serialized.lightLayerName3, Styles.lightLayerName3); + EditorGUILayout.DelayedTextField(serialized.lightLayerName4, Styles.lightLayerName4); + EditorGUILayout.DelayedTextField(serialized.lightLayerName5, Styles.lightLayerName5); + EditorGUILayout.DelayedTextField(serialized.lightLayerName6, Styles.lightLayerName6); + EditorGUILayout.DelayedTextField(serialized.lightLayerName7, Styles.lightLayerName7); + if (changed.changed) + { + serialized.serializedObject?.ApplyModifiedProperties(); + (serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings).UpdateRenderingLayerNames(); + } + } + } + } + } + + static void DrawDecalLayerNames(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) + { + m_ShowDecalLayerNames = CoreEditorUtils.DrawHeaderFoldout(Styles.decalLayersLabel, m_ShowDecalLayerNames, + documentationURL: Documentation.GetPageLink(DocumentationUrls.k_DecalLayers), + contextAction: pos => OnContextClickRenderingLayerNames(pos, serialized, section: 2)); + if (m_ShowDecalLayerNames) + { + using (new EditorGUI.IndentLevelScope()) + { + using (var changed = new EditorGUI.ChangeCheckScope()) + { + EditorGUILayout.DelayedTextField(serialized.decalLayerName0, Styles.decalLayerName0); + EditorGUILayout.DelayedTextField(serialized.decalLayerName1, Styles.decalLayerName1); + EditorGUILayout.DelayedTextField(serialized.decalLayerName2, Styles.decalLayerName2); + EditorGUILayout.DelayedTextField(serialized.decalLayerName3, Styles.decalLayerName3); + EditorGUILayout.DelayedTextField(serialized.decalLayerName4, Styles.decalLayerName4); + EditorGUILayout.DelayedTextField(serialized.decalLayerName5, Styles.decalLayerName5); + EditorGUILayout.DelayedTextField(serialized.decalLayerName6, Styles.decalLayerName6); + EditorGUILayout.DelayedTextField(serialized.decalLayerName7, Styles.decalLayerName7); + if (changed.changed) + { + serialized.serializedObject?.ApplyModifiedProperties(); + (serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings).UpdateRenderingLayerNames(); + } + } + } + } + } + + static void OnContextClickRenderingLayerNames(Vector2 position, SerializedHDRenderPipelineGlobalSettings serialized, int section = 0) + { + var menu = new GenericMenu(); + menu.AddItem(section == 0 ? CoreEditorStyles.resetAllButtonLabel : CoreEditorStyles.resetButtonLabel, false, () => + { + var globalSettings = (serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings); + globalSettings.ResetRenderingLayerNames(lightLayers: section < 2, decalLayers: section != 1); + }); + menu.DropDown(new Rect(position, Vector2.zero)); + } + + #endregion + } +} diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs index 77e2e698c48..37531d19e1b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs +++ b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/OverridableFrameSettingsArea.cs @@ -253,7 +253,7 @@ void DrawField(Field field, bool withOverride) bool newBool = (bool)DrawFieldShape(fieldRect, oldBool); if (oldBool ^ newBool) { - if(field.field == FrameSettingsField.Decals || field.field == FrameSettingsField.DecalLayers) + if (field.field == FrameSettingsField.Decals || field.field == FrameSettingsField.DecalLayers) HDGlobalSettingsPanelIMGUI.needRefreshVfxErrors = true; Undo.RecordObject(serializedFrameSettings.serializedObject.targetObject, "Changed FrameSettings " + field.field); serializedFrameSettings.SetEnabled(field.field, newBool); diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs index 02dcfc2a9bb..b7e435b10ca 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXAbstractParticleHDRPOutput.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using UnityEngine; @@ -256,6 +256,5 @@ public override void OnEnable() colorMapping = ColorMappingMode.Default; base.OnEnable(); } - } } diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs index 90407ff0779..e08566fe843 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Outputs/VFXDecalHDRPOutput.cs @@ -60,8 +60,6 @@ public override IEnumerable attributes } - - public enum BlendSource { BaseColorMapAlpha, @@ -124,7 +122,7 @@ public class FadeFactorProperty public class AngleFadeProperty { [Tooltip("Use the min-max slider to control the fade out range of the decal based on the angle between the Decal backward direction and the vertex normal of the receiving surface." + - " Works only if Decal Layers is enabled both in the HDRP Asset and in the HDRP Settings."), MinMax(0.0f, 180.0f)] + " Works only if Decal Layers is enabled both in the HDRP Asset and in the HDRP Settings."), MinMax(0.0f, 180.0f)] public Vector2 angleFade = new Vector2(0.0f, 180.0f); } @@ -193,7 +191,7 @@ protected override IEnumerable CollectGPUExpressions( var angleFadeExp = slotExpressions.First(o => o.name == "angleFade"); yield return new VFXNamedExpression(AngleFadeSimplification(angleFadeExp.exp), "angleFade"); - yield return new VFXNamedExpression(VFXValue.Constant((uint) decalLayer), "decalLayerMask"); + yield return new VFXNamedExpression(VFXValue.Constant((uint)decalLayer), "decalLayerMask"); } } @@ -329,7 +327,6 @@ protected VFXShaderWriter GetDecalMaskColor(int maskIndex) return rs; } - public override IEnumerable> additionalReplacements { get @@ -368,7 +365,6 @@ protected override void GenerateErrors(VFXInvalidateErrorReporter manager) $"The Metallic and Ambient Occlusion parameters won't have any effect, because the 'Metal and AO properties' setting is disabled." + $" Enable 'Metal and AO properties' in your HDRP Asset if you want to control the Metal and AO properties of decals. There is a performance cost of enabling this option."); } - } protected override IEnumerable untransferableSettings diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs new file mode 100644 index 00000000000..0818bba676a --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs @@ -0,0 +1,23 @@ +using System.Linq; +using UnityEditor.VFX.UI; + +namespace UnityEditor.VFX.HDRP +{ + public static class VFXHDRPSettingsUtility + { + public static void RefreshVfxErrorsIfNeeded(ref bool needRefreshVfxErrors) + { + if (needRefreshVfxErrors) + { + var vfxWindow = VFXViewWindow.currentWindow; + if (vfxWindow != null) + { + var vfxGraph = vfxWindow.graphView.controller.graph; + foreach (var output in vfxGraph.children.OfType()) + output.RefreshErrors(vfxGraph); + } + } + needRefreshVfxErrors = false; + } + } +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs index 1d688f2f5a0..ebf1feb103d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/VFXHDRPSubOutput.cs @@ -147,13 +147,10 @@ public override string GetRenderQueueStr() private int GetRenderQueueOffset() { var renderQueueType = GetRenderQueueType(); - int renderQueueOffset; - - if (owner is VFXDecalHDRPOutput) - renderQueueOffset = HDRenderQueue.Clamps(HDRenderQueue.k_RenderQueue_AllOpaque, HDRenderQueue.ChangeType(renderQueueType, 0, owner.hasAlphaClipping) + GetMaterialOffset()); - else - renderQueueOffset = HDRenderQueue.ChangeType(renderQueueType, GetMaterialOffset(), owner.hasAlphaClipping); - return renderQueueOffset; + var materialOffset = GetMaterialOffset(); + return owner is VFXDecalHDRPOutput ? + HDRenderQueue.Clamps(k_RenderQueue_AllOpaque, ChangeType(renderQueueType, 0, owner.hasAlphaClipping) + materialOffset) : + ChangeType(renderQueueType, materialOffset, owner.hasAlphaClipping); } private int GetMaterialOffset() diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs index 450f10c0c08..5a2c833837a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Prepass.cs @@ -960,7 +960,7 @@ void RenderDBuffer(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle dec passData.vfxDecalsRendererList = builder.UseRendererList(renderGraph.CreateRendererList( new RendererUtils.RendererListDesc(m_VfxDecalsPassNames, cullingResults, hdCamera.camera) { - sortingCriteria = SortingCriteria.CommonOpaque & ~ SortingCriteria.OptimizeStateChanges, + sortingCriteria = SortingCriteria.CommonOpaque & ~SortingCriteria.OptimizeStateChanges, rendererConfiguration = PerObjectData.None, renderQueueRange = HDRenderQueue.k_RenderQueue_AllOpaque, })); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 7624563a783..7c0a8aee2c2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -56,8 +56,6 @@ public static class HDShaderPassNames public static readonly string s_DBufferVFXDecalStr = "DBufferVFX"; - - // ShaderPass name /// Empty shader tag id. public static readonly ShaderTagId s_EmptyName = new ShaderTagId(s_EmptyStr); diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs index 1d924706fe9..a8bb1680efc 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs @@ -75,7 +75,7 @@ protected void ValueDragStarted() public VFXMinMaxSliderField() { AddToClassList("sliderMinMaxField"); - m_Slider = new MinMaxSlider(1,10, 0, 100); + m_Slider = new MinMaxSlider(1, 10, 0, 100); // m_Slider.AddToClassList("textfield"); m_Slider.RegisterValueChangedCallback(evt => ValueChanged(evt.newValue)); @@ -90,6 +90,7 @@ public VFXMinMaxSliderField() Add(m_Slider); RegisterCallBack(); } + protected void RegisterCallBack() { m_Slider.Children().First().AddManipulator(new StartFinishSliderManipulator()); @@ -110,15 +111,8 @@ void OnFocusLost(BlurEvent e) public Vector2 value { - get - { - return m_Value; - } - - set - { - SetValueAndNotify(value); - } + get => m_Value; + set => SetValueAndNotify(value); } private Vector2 m_Range; @@ -172,6 +166,7 @@ protected void ValueChanged(ChangeEvent e) if (!m_IgnoreNotification) SetValueAndNotify(e.newValue); } + void ValueChanged(Vector2 newValue) { SetValueAndNotify(newValue); @@ -200,12 +195,6 @@ public bool indeterminate } } } - public bool hasFocus - { - get - { - return m_Slider.HasFocus(); - } - } + public bool hasFocus => m_Slider.HasFocus(); } } diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs index 56d1838995d..ad4a3c01539 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs @@ -1,10 +1,9 @@ -using UnityEditor.UIElements; +using UnityEditor.UIElements; using UnityEditor.VFX.UI; using UnityEngine; using UnityEngine.UIElements; namespace UnityEditor.VFX.UI - { class Vector2PropertyRM : SimpleUIPropertyRM { @@ -12,7 +11,7 @@ class Vector2PropertyRM : SimpleUIPropertyRM protected VFXMinMaxSliderField m_Slider; public Vector2PropertyRM(IPropertyRMProvider controller, float labelWidth) : base(controller, labelWidth) - { } + {} private void ValueDragStarted() { @@ -51,11 +50,13 @@ public override INotifyValueChanged CreateField() return result; } + void OnFocusLost(BlurEvent e) { DelayedNotifyValueChange(); UpdateGUI(true); } + void DelayedNotifyValueChange() { if (isDelayed && hasChangeDelayed) @@ -70,6 +71,7 @@ protected override void UpdateIndeterminate() if (m_Slider != null) m_Slider.indeterminate = indeterminate; } + public override void UpdateGUI(bool force) { if (m_Slider != null) @@ -104,12 +106,14 @@ protected override bool HasFocus() return m_VectorField.HasFocus(); return false; } + protected INotifyValueChanged CreateSliderField(out VFXMinMaxSliderField slider) { var field = new VFXLabeledField(m_Label); slider = field.control; return field; } + protected INotifyValueChanged CreateSimpleField(out VFXVector2Field textField) { var field = new VFXLabeledField(m_Label); diff --git a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs index 63b16257167..349a7e1ac2a 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Contexts/Implementations/VFXPlanarPrimitiveOutput.cs @@ -127,5 +127,4 @@ protected override IEnumerable untransferableSettings } } } - } diff --git a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs index 2f3e401db06..ae5b425199b 100644 --- a/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs +++ b/com.unity.visualeffectgraph/Editor/Models/Slots/VFXSlot.cs @@ -384,7 +384,7 @@ private static VFXSlot CreateSub(VFXProperty property, Direction direction) if (slot.property.attributes.attributes.OfType().Any()) { var parentRange = property.attributes.FindRange(); - subSlot.UpdateAttributes(new VFXPropertyAttributes( new RangeAttribute(parentRange.x, parentRange.y)), false); + subSlot.UpdateAttributes(new VFXPropertyAttributes(new RangeAttribute(parentRange.x, parentRange.y)), false); } if (subSlot != null) { diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs index e15fc54f29b..9b9d748017f 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs @@ -181,7 +181,7 @@ public VFXExpression ApplyToExpressionGraph(VFXExpression exp) } else if (attribute is MinMaxAttribute) { - var minMaxAttribute = (MinMaxAttribute) attribute; + var minMaxAttribute = (MinMaxAttribute)attribute; exp = VFXOperatorUtility.Clamp(exp, VFXValue.Constant(minMaxAttribute.min), VFXValue.Constant(minMaxAttribute.max)); } else From d3e24f80662a333629d127e3876f162c561d7c8b Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 5 Jul 2021 10:08:50 +0200 Subject: [PATCH 59/66] add meta files --- .../Editor/VFXGraph/Utility.meta | 8 ++++++++ .../VFXGraph/Utility/VFXHDRPSettingsUtility.cs.meta | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility.meta create mode 100644 com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs.meta diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility.meta new file mode 100644 index 00000000000..2acc5993cd5 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e22a8d6e32b6b7c41839067fc572d48e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs.meta new file mode 100644 index 00000000000..cf7a006c6ce --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Utility/VFXHDRPSettingsUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c75f8e4a0474424e8643fbe09e52d78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From be36a89a6fd50c13bedd258d9b4ce3b8adf62f4a Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 7 Jul 2021 11:25:15 +0200 Subject: [PATCH 60/66] remove preformat.back --- .../HDGlobalSettingsWindow.cs.preformat.bak | 592 ------------------ com.unity.visualeffectgraph/CHANGELOG.md | 2 +- 2 files changed, 1 insertion(+), 593 deletions(-) delete mode 100644 com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak diff --git a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak b/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak deleted file mode 100644 index fada0b25529..00000000000 --- a/com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/HDGlobalSettingsWindow.cs.preformat.bak +++ /dev/null @@ -1,592 +0,0 @@ -using System; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Rendering.HighDefinition; -using UnityEngine.Rendering; -using UnityEngine.UIElements; -using UnityEditorInternal; -using System.Linq; -using System.Reflection; -using UnityEditor.VFX.HDRP; -using UnityEditor.VFX.UI; - -namespace UnityEditor.Rendering.HighDefinition -{ - using CED = CoreEditorDrawer; - - class HDGlobalSettingsPanelProvider - { - static HDGlobalSettingsPanelIMGUI s_IMGUIImpl = new HDGlobalSettingsPanelIMGUI(); - - [SettingsProvider] - public static SettingsProvider CreateSettingsProvider() - { - return new SettingsProvider("Project/Graphics/HDRP Global Settings", SettingsScope.Project) - { - activateHandler = s_IMGUIImpl.OnActivate, - keywords = SettingsProvider.GetSearchKeywordsFromGUIContentProperties() - .Concat(OverridableFrameSettingsArea.frameSettingsKeywords) - .ToArray(), - guiHandler = s_IMGUIImpl.DoGUI, - titleBarGuiHandler = s_IMGUIImpl.OnTitleBarGUI - }; - } - } - - internal partial class HDGlobalSettingsPanelIMGUI - { - public static readonly CED.IDrawer Inspector; - - public class DocumentationUrls - { - public static readonly string k_Volumes = "Volume-Profile"; - public static readonly string k_DiffusionProfiles = "Override-Diffusion-Profile"; - public static readonly string k_FrameSettings = "Frame-Settings"; - public static readonly string k_LightLayers = "Light-Layers"; - public static readonly string k_DecalLayers = "Decal"; - public static readonly string k_CustomPostProcesses = "Custom-Post-Process"; - } - - static HDGlobalSettingsPanelIMGUI() - { - Inspector = CED.Group( - VolumeSection, - CED.Group((serialized, owner) => EditorGUILayout.Space()), - DiffusionProfileSettingsSection, - CED.Group((serialized, owner) => EditorGUILayout.Space()), - FrameSettingsSection, - CED.Group((serialized, owner) => EditorGUILayout.Space()), - LayerNamesSection, - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CustomPostProcessesSection, - CED.Group((serialized, owner) => EditorGUILayout.Space()), - MiscSection, - CED.Group((serialized, owner) => EditorGUILayout.Space()), - ResourcesSection - ); - } - - SerializedHDRenderPipelineGlobalSettings serializedSettings; - HDRenderPipelineGlobalSettings settingsSerialized; - - public void OnTitleBarGUI() - { - if (GUILayout.Button(CoreEditorStyles.iconHelp, CoreEditorStyles.iconHelpStyle)) - Help.BrowseURL(Documentation.GetPageLink("Default-Settings-Window")); - } - - internal static bool needRefreshVfxErrors = false; - private void RefreshVfxErrorsIfNeeded() - { - if (needRefreshVfxErrors) - { - var vfxWindow = VFXViewWindow.currentWindow; - if (vfxWindow != null) - { - var vfxGraph = vfxWindow.graphView.controller.graph; - foreach ( var output in vfxGraph.children.OfType()) - output.RefreshErrors(vfxGraph); - } - } - needRefreshVfxErrors = false; - } - public void DoGUI(string searchContext) - { - // When the asset being serialized has been deleted before its reconstruction - if (serializedSettings != null && serializedSettings.serializedObject.targetObject == null) - { - serializedSettings = null; - settingsSerialized = null; - } - - if (serializedSettings == null || settingsSerialized != HDRenderPipelineGlobalSettings.instance) - { - if (HDRenderPipeline.currentAsset != null || HDRenderPipelineGlobalSettings.instance != null) - { - settingsSerialized = HDRenderPipelineGlobalSettings.Ensure(); - var serializedObject = new SerializedObject(settingsSerialized); - serializedSettings = new SerializedHDRenderPipelineGlobalSettings(serializedObject); - } - } - else if (settingsSerialized != null && serializedSettings != null) - { - serializedSettings.serializedObject.Update(); - } - - DrawAssetSelection(ref serializedSettings, null); - DrawWarnings(ref serializedSettings, null); - if (settingsSerialized != null && serializedSettings != null) - { - EditorGUILayout.Space(); - Inspector.Draw(serializedSettings, null); - serializedSettings.serializedObject?.ApplyModifiedProperties(); - RefreshVfxErrorsIfNeeded(); - } - } - - /// - /// Executed when activate is called from the settings provider. - /// - /// - /// - public void OnActivate(string searchContext, VisualElement rootElement) - { - } - - void DrawWarnings(ref SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - bool isHDRPinUse = HDRenderPipeline.currentAsset != null; - if (isHDRPinUse && serialized != null) - return; - - if (isHDRPinUse) - { - EditorGUILayout.HelpBox(Styles.warningGlobalSettingsMissing, MessageType.Warning); - } - else - { - EditorGUILayout.HelpBox(Styles.warningHdrpNotActive, MessageType.Warning); - if (serialized == null) - EditorGUILayout.HelpBox(Styles.infoGlobalSettingsMissing, MessageType.Info); - } - } - - #region Global HDRenderPipelineGlobalSettings asset selection - void DrawAssetSelection(ref SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - var oldWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = Styles.labelWidth; - using (new EditorGUILayout.HorizontalScope()) - { - EditorGUI.BeginChangeCheck(); - var newAsset = (HDRenderPipelineGlobalSettings)EditorGUILayout.ObjectField(settingsSerialized , typeof(HDRenderPipelineGlobalSettings), false); - if (EditorGUI.EndChangeCheck()) - { - HDRenderPipelineGlobalSettings.UpdateGraphicsSettings(newAsset); - if (settingsSerialized != null && !settingsSerialized.Equals(null)) - EditorUtility.SetDirty(settingsSerialized); - } - - if (GUILayout.Button(Styles.newAssetButtonLabel, GUILayout.Width(45), GUILayout.Height(18))) - { - HDAssetFactory.HDRenderPipelineGlobalSettingsCreator.Create(useProjectSettingsFolder: true, assignToActiveAsset: true); - } - - bool guiEnabled = GUI.enabled; - GUI.enabled = guiEnabled && (settingsSerialized != null); - if (GUILayout.Button(Styles.cloneAssetButtonLabel, GUILayout.Width(45), GUILayout.Height(18))) - { - HDAssetFactory.HDRenderPipelineGlobalSettingsCreator.Clone(settingsSerialized, assignToActiveAsset: true); - } - GUI.enabled = guiEnabled; - } - EditorGUIUtility.labelWidth = oldWidth; - EditorGUILayout.Space(); - } - - #endregion // Global HDRenderPipelineGlobalSettings asset selection - - #region Resources - - static readonly CED.IDrawer ResourcesSection = CED.Group( - CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.resourceLabel)), - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CED.Group(DrawResourcesSection), - CED.Group((serialized, owner) => EditorGUILayout.Space()) - ); - static void DrawResourcesSection(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - using (new EditorGUI.IndentLevelScope()) - { - var oldWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = Styles.labelWidth; - - EditorGUILayout.PropertyField(serialized.renderPipelineResources, Styles.renderPipelineResourcesContent); - bool oldGuiEnabled = GUI.enabled; - GUI.enabled = false; - - EditorGUILayout.PropertyField(serialized.renderPipelineRayTracingResources, Styles.renderPipelineRayTracingResourcesContent); - - // Not serialized as editor only datas... Retrieve them in data - EditorGUI.showMixedValue = serialized.editorResourceHasMultipleDifferentValues; - var editorResources = EditorGUILayout.ObjectField(Styles.renderPipelineEditorResourcesContent, serialized.firstEditorResources, typeof(HDRenderPipelineEditorResources), allowSceneObjects: false) as HDRenderPipelineEditorResources; - - EditorGUI.showMixedValue = false; - - GUI.enabled = oldGuiEnabled; - EditorGUIUtility.labelWidth = oldWidth; - } - } - - #endregion // Resources - - #region Frame Settings - - static readonly CED.IDrawer FrameSettingsSection = CED.Group( - CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.frameSettingsLabel, Documentation.GetPageLink(DocumentationUrls.k_FrameSettings))), - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CED.Group(DrawFrameSettings), - CED.Group((serialized, owner) => EditorGUILayout.Space()) - ); - - static void DrawFrameSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - using (new EditorGUI.IndentLevelScope()) - { - EditorGUILayout.LabelField(Styles.frameSettingsLabel_Camera, CoreEditorStyles.subSectionHeaderStyle); - DrawFrameSettingsSubsection(0, serialized.defaultCameraFrameSettings, owner); - EditorGUILayout.Space(); - - EditorGUILayout.LabelField(Styles.frameSettingsLabel_RTProbe, CoreEditorStyles.subSectionHeaderStyle); - DrawFrameSettingsSubsection(1, serialized.defaultRealtimeReflectionFrameSettings, owner); - EditorGUILayout.Space(); - - EditorGUILayout.LabelField(Styles.frameSettingsLabel_BakedProbe, CoreEditorStyles.subSectionHeaderStyle); - DrawFrameSettingsSubsection(2, serialized.defaultBakedOrCustomReflectionFrameSettings, owner); - EditorGUILayout.Space(); - } - } - - static private bool[] m_ShowFrameSettings_Rendering = { false, false, false }; - static private bool[] m_ShowFrameSettings_Lighting = { false, false, false }; - static private bool[] m_ShowFrameSettings_AsyncCompute = { false, false, false }; - static private bool[] m_ShowFrameSettings_LightLoopDebug = { false, false, false }; - - static void DrawFrameSettingsSubsection(int index, SerializedFrameSettings serialized, Editor owner) - { - var oldWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = Styles.labelWidth; - - CoreEditorUtils.DrawSplitter(); - m_ShowFrameSettings_Rendering[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.renderingSettingsHeaderContent, m_ShowFrameSettings_Rendering[index]); - if (m_ShowFrameSettings_Rendering[index]) - { - using (new EditorGUI.IndentLevelScope()) - { - FrameSettingsUI.Drawer_SectionRenderingSettings(serialized, owner, withOverride: false); - } - } - - CoreEditorUtils.DrawSplitter(); - m_ShowFrameSettings_Lighting[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.lightSettingsHeaderContent, m_ShowFrameSettings_Lighting[index]); - if (m_ShowFrameSettings_Lighting[index]) - { - using (new EditorGUI.IndentLevelScope()) - { - FrameSettingsUI.Drawer_SectionLightingSettings(serialized, owner, withOverride: false); - } - } - - CoreEditorUtils.DrawSplitter(); - m_ShowFrameSettings_AsyncCompute[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.asyncComputeSettingsHeaderContent, m_ShowFrameSettings_AsyncCompute[index]); - if (m_ShowFrameSettings_AsyncCompute[index]) - { - using (new EditorGUI.IndentLevelScope()) - { - FrameSettingsUI.Drawer_SectionAsyncComputeSettings(serialized, owner, withOverride: false); - } - } - - CoreEditorUtils.DrawSplitter(); - m_ShowFrameSettings_LightLoopDebug[index] = CoreEditorUtils.DrawHeaderFoldout(Styles.lightLoopSettingsHeaderContent, m_ShowFrameSettings_LightLoopDebug[index]); - if (m_ShowFrameSettings_LightLoopDebug[index]) - { - using (new EditorGUI.IndentLevelScope()) - { - FrameSettingsUI.Drawer_SectionLightLoopSettings(serialized, owner, withOverride: false); - } - } - CoreEditorUtils.DrawSplitter(); - EditorGUIUtility.labelWidth = oldWidth; - } - - #endregion // Frame Settings - - #region Custom Post Processes - - static readonly CED.IDrawer CustomPostProcessesSection = CED.Group( - CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.customPostProcessOrderLabel, Documentation.GetPageLink(DocumentationUrls.k_CustomPostProcesses))), - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CED.Group(DrawCustomPostProcess) - ); - static void DrawCustomPostProcess(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - using (new EditorGUILayout.HorizontalScope()) - { - GUILayout.Space(5); - serialized.uiBeforeTransparentCustomPostProcesses.DoLayoutList(); - } - GUILayout.Space(2); - using (new EditorGUILayout.HorizontalScope()) - { - GUILayout.Space(5); - serialized.uiBeforeTAACustomPostProcesses.DoLayoutList(); - } - GUILayout.Space(2); - using (new EditorGUILayout.HorizontalScope()) - { - GUILayout.Space(5); - serialized.uiBeforePostProcessCustomPostProcesses.DoLayoutList(); - } - GUILayout.Space(2); - using (new EditorGUILayout.HorizontalScope()) - { - GUILayout.Space(5); - serialized.uiAfterPostProcessCustomPostProcesses.DoLayoutList(); - } - } - - #endregion // Custom Post Processes - - #region Diffusion Profile Settings List - - static readonly CED.IDrawer DiffusionProfileSettingsSection = CED.Group( - CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.diffusionProfileSettingsLabel, Documentation.GetPageLink(DocumentationUrls.k_DiffusionProfiles))), - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CED.Group(DrawDiffusionProfileSettings) - ); - static void DrawDiffusionProfileSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - using (new EditorGUILayout.HorizontalScope()) - { - GUILayout.Space(5); - serialized.m_DiffusionProfileUI.OnGUI(serialized.diffusionProfileSettingsList); - } - } - - #endregion //Diffusion Profile Settings List - - #region Volume Profiles - static Editor m_CachedDefaultVolumeProfileEditor; - static Editor m_CachedLookDevVolumeProfileEditor; - static int m_CurrentVolumeProfileInstanceID; - - static readonly CED.IDrawer VolumeSection = CED.Group( - CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.volumeComponentsLabel, Documentation.GetPageLink(DocumentationUrls.k_Volumes))), - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CED.Group(DrawVolumeSection), - CED.Group((serialized, owner) => EditorGUILayout.Space()) - ); - - static void DrawVolumeSection(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - using (new EditorGUI.IndentLevelScope()) - { - var oldWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = Styles.labelWidth; - - HDRenderPipelineGlobalSettings globalSettings = serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings; - VolumeProfile asset = null; - using (new EditorGUILayout.HorizontalScope()) - { - var oldAssetValue = serialized.defaultVolumeProfile.objectReferenceValue; - EditorGUILayout.PropertyField(serialized.defaultVolumeProfile, Styles.defaultVolumeProfileLabel); - asset = serialized.defaultVolumeProfile.objectReferenceValue as VolumeProfile; - if (asset == null && oldAssetValue != null) - { - Debug.Log("Default Volume Profile Asset cannot be null. Rolling back to previous value."); - serialized.defaultVolumeProfile.objectReferenceValue = oldAssetValue; - } - - if (GUILayout.Button(Styles.newVolumeProfileLabel, GUILayout.Width(38), GUILayout.Height(18))) - { - HDAssetFactory.VolumeProfileCreator.CreateAndAssign(HDAssetFactory.VolumeProfileCreator.Kind.Default, globalSettings); - } - } - if (asset != null) - { - // The state of the profile can change without the asset reference changing so in this case we need to reset the editor. - if (m_CurrentVolumeProfileInstanceID != asset.GetInstanceID() && m_CachedDefaultVolumeProfileEditor != null) - { - m_CurrentVolumeProfileInstanceID = asset.GetInstanceID(); - m_CachedDefaultVolumeProfileEditor = null; - } - - Editor.CreateCachedEditor(asset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedDefaultVolumeProfileEditor); - bool oldEnabled = GUI.enabled; - GUI.enabled = AssetDatabase.IsOpenForEdit(asset); - m_CachedDefaultVolumeProfileEditor.OnInspectorGUI(); - GUI.enabled = oldEnabled; - } - - EditorGUILayout.Space(); - - VolumeProfile lookDevAsset = null; - using (new EditorGUILayout.HorizontalScope()) - { - var oldAssetValue = serialized.lookDevVolumeProfile.objectReferenceValue; - EditorGUILayout.PropertyField(serialized.lookDevVolumeProfile, Styles.lookDevVolumeProfileLabel); - lookDevAsset = serialized.lookDevVolumeProfile.objectReferenceValue as VolumeProfile; - if (lookDevAsset == null && oldAssetValue != null) - { - Debug.Log("LookDev Volume Profile Asset cannot be null. Rolling back to previous value."); - serialized.lookDevVolumeProfile.objectReferenceValue = oldAssetValue; - } - - if (GUILayout.Button(Styles.newVolumeProfileLabel, GUILayout.Width(38), GUILayout.Height(18))) - { - HDAssetFactory.VolumeProfileCreator.CreateAndAssign(HDAssetFactory.VolumeProfileCreator.Kind.LookDev, globalSettings); - } - } - if (lookDevAsset != null) - { - Editor.CreateCachedEditor(lookDevAsset, Type.GetType("UnityEditor.Rendering.VolumeProfileEditor"), ref m_CachedLookDevVolumeProfileEditor); - bool oldEnabled = GUI.enabled; - GUI.enabled = AssetDatabase.IsOpenForEdit(lookDevAsset); - m_CachedLookDevVolumeProfileEditor.OnInspectorGUI(); - GUI.enabled = oldEnabled; - - if (lookDevAsset.Has()) - EditorGUILayout.HelpBox("VisualEnvironment is not modifiable and will be overridden by the LookDev", MessageType.Warning); - if (lookDevAsset.Has()) - EditorGUILayout.HelpBox("HDRISky is not modifiable and will be overridden by the LookDev", MessageType.Warning); - } - EditorGUIUtility.labelWidth = oldWidth; - } - } - - #endregion // Volume Profiles - - #region Misc Settings - - static MethodInfo s_CleanupRenderPipelineMethod = typeof(RenderPipelineManager).GetMethod("CleanupRenderPipeline", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); - - static readonly CED.IDrawer MiscSection = CED.Group( - CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.generalSettingsLabel)), - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CED.Group(DrawMiscSettings), - CED.Group((serialized, owner) => EditorGUILayout.Space()) - ); - static void DrawMiscSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - var oldWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = Styles.labelWidth; - - using (new EditorGUI.IndentLevelScope()) - { - EditorGUILayout.PropertyField(serialized.shaderVariantLogLevel, Styles.shaderVariantLogLevelLabel); - EditorGUILayout.PropertyField(serialized.lensAttenuation, Styles.lensAttenuationModeContentLabel); - EditorGUILayout.PropertyField(serialized.rendererListCulling, Styles.rendererListCulling); - -#if ENABLE_NVIDIA && ENABLE_NVIDIA_MODULE - EditorGUILayout.PropertyField(serialized.useDLSSCustomProjectId, Styles.useDLSSCustomProjectIdLabel); - if (serialized.useDLSSCustomProjectId.boolValue) - EditorGUILayout.PropertyField(serialized.DLSSProjectId, Styles.DLSSProjectIdLabel); -#endif - - EditorGUI.BeginChangeCheck(); - EditorGUILayout.PropertyField(serialized.supportProbeVolumes, Styles.probeVolumeSupportContentLabel); - if (EditorGUI.EndChangeCheck()) - { - // If we are running HDRP, we need to make sure the RP is reinitialized - if (HDRenderPipeline.currentPipeline != null) - s_CleanupRenderPipelineMethod?.Invoke(null, null); - } - - EditorGUILayout.PropertyField(serialized.supportRuntimeDebugDisplay, Styles.supportRuntimeDebugDisplayContentLabel); - } - EditorGUIUtility.labelWidth = oldWidth; - } - - #endregion // Misc Settings - - #region Rendering Layer Names - - static readonly CED.IDrawer LayerNamesSection = CED.Group( - CED.Group((serialized, owner) => CoreEditorUtils.DrawSectionHeader(Styles.layerNamesLabel, contextAction: pos => OnContextClickRenderingLayerNames(pos, serialized), documentationURL: Documentation.GetPageLink(DocumentationUrls.k_LightLayers))), - CED.Group((serialized, owner) => EditorGUILayout.Space()), - CED.Group(DrawLayerNamesSettings), - CED.Group((serialized, owner) => EditorGUILayout.Space()) - ); - - static void DrawLayerNamesSettings(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - var oldWidth = EditorGUIUtility.labelWidth; - EditorGUIUtility.labelWidth = Styles.labelWidth; - - CoreEditorUtils.DrawSplitter(); - DrawLightLayerNames(serialized, owner); - CoreEditorUtils.DrawSplitter(); - DrawDecalLayerNames(serialized, owner); - CoreEditorUtils.DrawSplitter(); - EditorGUILayout.Space(); - - EditorGUIUtility.labelWidth = oldWidth; - } - - static private bool m_ShowLightLayerNames = false; - static private bool m_ShowDecalLayerNames = false; - static void DrawLightLayerNames(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - m_ShowLightLayerNames = CoreEditorUtils.DrawHeaderFoldout(Styles.lightLayersLabel, - m_ShowLightLayerNames, - documentationURL: Documentation.GetPageLink(DocumentationUrls.k_LightLayers), - contextAction: pos => OnContextClickRenderingLayerNames(pos, serialized, section: 1) - ); - if (m_ShowLightLayerNames) - { - using (new EditorGUI.IndentLevelScope()) - { - using (var changed = new EditorGUI.ChangeCheckScope()) - { - EditorGUILayout.DelayedTextField(serialized.lightLayerName0, Styles.lightLayerName0); - EditorGUILayout.DelayedTextField(serialized.lightLayerName1, Styles.lightLayerName1); - EditorGUILayout.DelayedTextField(serialized.lightLayerName2, Styles.lightLayerName2); - EditorGUILayout.DelayedTextField(serialized.lightLayerName3, Styles.lightLayerName3); - EditorGUILayout.DelayedTextField(serialized.lightLayerName4, Styles.lightLayerName4); - EditorGUILayout.DelayedTextField(serialized.lightLayerName5, Styles.lightLayerName5); - EditorGUILayout.DelayedTextField(serialized.lightLayerName6, Styles.lightLayerName6); - EditorGUILayout.DelayedTextField(serialized.lightLayerName7, Styles.lightLayerName7); - if (changed.changed) - { - serialized.serializedObject?.ApplyModifiedProperties(); - (serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings).UpdateRenderingLayerNames(); - } - } - } - } - } - - static void DrawDecalLayerNames(SerializedHDRenderPipelineGlobalSettings serialized, Editor owner) - { - m_ShowDecalLayerNames = CoreEditorUtils.DrawHeaderFoldout(Styles.decalLayersLabel, m_ShowDecalLayerNames, - documentationURL: Documentation.GetPageLink(DocumentationUrls.k_DecalLayers), - contextAction: pos => OnContextClickRenderingLayerNames(pos, serialized, section: 2)); - if (m_ShowDecalLayerNames) - { - using (new EditorGUI.IndentLevelScope()) - { - using (var changed = new EditorGUI.ChangeCheckScope()) - { - EditorGUILayout.DelayedTextField(serialized.decalLayerName0, Styles.decalLayerName0); - EditorGUILayout.DelayedTextField(serialized.decalLayerName1, Styles.decalLayerName1); - EditorGUILayout.DelayedTextField(serialized.decalLayerName2, Styles.decalLayerName2); - EditorGUILayout.DelayedTextField(serialized.decalLayerName3, Styles.decalLayerName3); - EditorGUILayout.DelayedTextField(serialized.decalLayerName4, Styles.decalLayerName4); - EditorGUILayout.DelayedTextField(serialized.decalLayerName5, Styles.decalLayerName5); - EditorGUILayout.DelayedTextField(serialized.decalLayerName6, Styles.decalLayerName6); - EditorGUILayout.DelayedTextField(serialized.decalLayerName7, Styles.decalLayerName7); - if (changed.changed) - { - serialized.serializedObject?.ApplyModifiedProperties(); - (serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings).UpdateRenderingLayerNames(); - } - } - } - } - } - - static void OnContextClickRenderingLayerNames(Vector2 position, SerializedHDRenderPipelineGlobalSettings serialized, int section = 0) - { - var menu = new GenericMenu(); - menu.AddItem(section == 0 ? CoreEditorStyles.resetAllButtonLabel : CoreEditorStyles.resetButtonLabel, false, () => - { - var globalSettings = (serialized.serializedObject.targetObject as HDRenderPipelineGlobalSettings); - globalSettings.ResetRenderingLayerNames(lightLayers: section < 2, decalLayers: section != 1); - }); - menu.DropDown(new Rect(position, Vector2.zero)); - } - - #endregion - } -} diff --git a/com.unity.visualeffectgraph/CHANGELOG.md b/com.unity.visualeffectgraph/CHANGELOG.md index 53d9855fd72..5f2ff39c3ec 100644 --- a/com.unity.visualeffectgraph/CHANGELOG.md +++ b/com.unity.visualeffectgraph/CHANGELOG.md @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Provide explicit access to spawnCount in graph - Support of direct link event to initialize context (which support several event within the same frame) - Structured Graphics Buffer support as exposed type -- Added HDRP Decal output context +- Added HDRP Decal output context. ### Changed - Allow remaking an existing link. From 65dfdd852e06fdb3628f6235286f19eee1e42484 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Wed, 7 Jul 2021 11:48:00 +0200 Subject: [PATCH 61/66] cleanup --- .../Shaders/Templates/HDRPDecal/PassForwardEmissive.template | 1 - .../Editor/VFXGraph/Shaders/VFXDecal.template | 4 ++-- .../Editor/Controls/VFXMinMaxSliderField.cs | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index fe4b1fc68e7..89adf6df310 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -36,7 +36,6 @@ Pass ${VFXEnd} -//TODO : Vertex shader of decal must perform z bias or view bias (BiasType), need to create one ${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} #define SHADERPASS SHADERPASS_VFX_DECAL_FORWARD_EMISSIVE ${VFXIncludeRP("VFXDecal.template")} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index aec4a7493d9..001df6a2388 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -133,7 +133,7 @@ if(_EnableDecalLayers) #if VFX_MASK_BLEND_BASE_COLOR_ALPHA surfaceData.mask.w = albedoMapBlend; - #elif VFX_MASK_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity + #elif VFX_MASK_BLEND_MASK_BLUE surfaceData.mask.w = maskMapBlend; #endif @@ -168,7 +168,7 @@ if(_EnableDecalLayers) surfaceData.normalWS.xyz = normalWS; #if VFX_NORMAL_BLEND_BASE_COLOR_ALPHA surfaceData.normalWS.w = albedoMapBlend; - #elif VFX_NORMAL_BLEND_MASK_BLUE // TODO : Careful, not the only two cases, e.g. when using opacity surfaceData.mask.w = maskMapBlend; + #elif VFX_NORMAL_BLEND_MASK_BLUE surfaceData.normalWS.w = maskMapBlend; #endif diff --git a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs index a8bb1680efc..beb19298d2d 100644 --- a/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs +++ b/com.unity.visualeffectgraph/Editor/Controls/VFXMinMaxSliderField.cs @@ -77,7 +77,6 @@ public VFXMinMaxSliderField() AddToClassList("sliderMinMaxField"); m_Slider = new MinMaxSlider(1, 10, 0, 100); - // m_Slider.AddToClassList("textfield"); m_Slider.RegisterValueChangedCallback(evt => ValueChanged(evt.newValue)); m_IndeterminateLabel = new Label() { From dc212d063b575d9c10ed7fd700e40a14401f9cf6 Mon Sep 17 00:00:00 2001 From: Vic-Cooper Date: Fri, 9 Jul 2021 12:02:02 +0100 Subject: [PATCH 62/66] Added doc Added Output Particle HDRP Lit Decal doc Please check Input Types are accurate. --- .../Context-OutputParticleHDRPLitDecal.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md diff --git a/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md b/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md new file mode 100644 index 00000000000..9f6b78d883e --- /dev/null +++ b/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md @@ -0,0 +1,48 @@ +Output Particle HDRP Lit Decal + +The **Output Particle HDRP Lit Decal** Context uses a decal to render a particle system. A decal is a box that the Visual Effect Graph projects a texture into. Unity renders that texture on any geometry that intersects the decal along its xy plane. This means decal particles that don’t intersect any geometry are not visible. When a decal is not visible, it still contributes to the resource intensity required to simulate and render the system. + +This Context can project a lit albedo Texture onto a surface using a Base Color map (albedo), a Normal Map, or a Mask Map. It does not support [Shader Graph](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest). To use this context, enable **Decals** in the [HDRP Asset](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/HDRP-Asset.html) and in the [HDRP Settings](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/Frame-Settings.html). + +Menu Path : **Context > Output Particle HDRP Lit Decal** + +The **Output Particle HDRP Lit Decal** Context can affect the following properties of the surface it projects onto: + +- Base Color +- Metalness +- Ambient Occlusion +- Smoothness +- Normal + +Below is a list of settings and properties specific to the Output Particle HDRP Lit Decal Context. For information about the generic output settings this Context shares with all other Contexts, see [Output Lit Settings and Properties](Context-OutputLitSettings.md). + +# Context Settings + +| **Input** | **Type** | **Description** | +| ---------------------------- | -------- | ------------------------------------------------------------ | +| **Normal Opacity Channel** | Enum | Use this drop-down to select the map that controls the opacity of the normal map opacity:• **Base Color Map Alpha**: Uses the alpha channel of the **Base Map**’s color picker to control the opacity.• **Mask Map Blue**: Uses the blue channel of the **Mask Map** to control opacity. | +| **Mask Opacity Channel** | Enum | Use this drop-down to select the source of the **Mask Map** opacity:• **Base Color Map Alpha**: Uses the alpha channel of the **Base Map**’s color picker to control the opacity of the Mask Map.• **Mask Map Blue**: Uses the blue channel of the **Mask Map** to control its opacity. | +| **Affect Base Color** | Bool | Enable this checkbox to make this decal use the **Base Color** properties. When this property is disabled the decal has no effect on the Base Color. HDRP still uses the alpha channel of the base color as an opacity for the other properties when this property is enabled or disabled. | +| **Affect Metal** | Bool | Enable the checkbox to make the decal use the metallic property of its **Mask Map**. Otherwise the decal has no metallic effect. Uses the red channel of the **Mask Map**. | +| **Affect Ambient Occlusion** | Bool | Enable this checkbox to make the decal use the ambient occlusion property of its **Mask Map**. When this property is disabled the decal has no ambient occlusion effect. This property uses the green channel of the **Mask Map**. | +| **Affect Smoothness** | Bool | Enable this checkbox to make the decal use the smoothness property of its **Mask Map**. When this property is disabled the decal has no smoothness effect. This property uses the alpha channel of the **Mask Map**. | +| **Decal Layer** | Enum | The layer that specifies which Materials Unity projects the decal onto. Unity displays the decal onto any Mesh Renderers or Terrain that use a matching Decal Layer. | + + + +# Context Properties + +| **Input** | **Type** | **Description** | +| --------------------- | -------- | ------------------------------------------------------------ | +| **Fade Factor** | | Change this value to fade the decal in and out. A value of 0 makes the decal fully transparent, and a value of 1 does not change the overall opacity. | +| **Angle Fade** | Vector2 | Use the min-max slider to control the fade out range of the decal (in degrees) based on the angle between the Decal backward direction and the vertex normal of the receiving surface. This property is only available when the [Decal Layers](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.0/manual/Decal.html) feature is enabled. This value is clamped between 0 and 180 degrees. | +| **Ambient Occlusion** | Float | Use the slider to set the strength of the ambient occlusion effect of the decal. This property only has an effect when you enable the **Metal and Ambient Occlusion properties** checkbox in your [HDRP Asset](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.0/manual/HDRP-Asset.html#Decals). | + + + +# Limitations + +- This Output does not support Shader Graph. +- For this Context to work, enable Decals in the HDRP Asset and in the HDRP Settings. +- Unity does not consider the **Angle Fade** value when **Decal Layers** is disabled in the HDRP Asset and the HDRP Settings. +- Unity only considers Metalness and Ambient Occlusion if the **Rendering > Decals > Metal** **and Ambient Occlusion Properties** are enabled in the HDRP Asset. When this property is disabled, the Metalness and Ambient Occlusion are visible, but they won’t have any effect. From 7ebdec2472e681a4298aa1987fc045e03199c14a Mon Sep 17 00:00:00 2001 From: Vic-Cooper Date: Fri, 9 Jul 2021 14:19:55 +0100 Subject: [PATCH 63/66] Doc fixes --- .../Documentation~/Context-OutputParticleHDRPLitDecal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md b/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md index 9f6b78d883e..f093ea784f3 100644 --- a/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md +++ b/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md @@ -1,8 +1,8 @@ -Output Particle HDRP Lit Decal +# Output Particle HDRP Lit Decal The **Output Particle HDRP Lit Decal** Context uses a decal to render a particle system. A decal is a box that the Visual Effect Graph projects a texture into. Unity renders that texture on any geometry that intersects the decal along its xy plane. This means decal particles that don’t intersect any geometry are not visible. When a decal is not visible, it still contributes to the resource intensity required to simulate and render the system. -This Context can project a lit albedo Texture onto a surface using a Base Color map (albedo), a Normal Map, or a Mask Map. It does not support [Shader Graph](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest). To use this context, enable **Decals** in the [HDRP Asset](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/HDRP-Asset.html) and in the [HDRP Settings](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/Frame-Settings.html). +This Context can project its properties onto a surface using a Base Color map (albedo), a Normal Map, or a Mask Map. It does not support [Shader Graph](https://docs.unity3d.com/Packages/com.unity.shadergraph@latest). To use this context, enable **Decals** in the [HDRP Asset](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/HDRP-Asset.html) and in the [HDRP Settings](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/Frame-Settings.html). Menu Path : **Context > Output Particle HDRP Lit Decal** From ba22c1b189de33004afce40ee01a29af8d197be8 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 9 Jul 2021 16:12:55 +0200 Subject: [PATCH 64/66] Clean outdated comments --- .../Shaders/Templates/HDRPDecal/PassForwardEmissive.template | 4 ---- .../Editor/VFXGraph/Shaders/VFXDecal.template | 2 -- 2 files changed, 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template index 89adf6df310..40e850c5aec 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/HDRPDecal/PassForwardEmissive.template @@ -41,10 +41,6 @@ ${VFXInclude("Shaders/ParticleHexahedron/Pass.template")} ${VFXIncludeRP("VFXDecal.template")} - - -//EndTODO - #pragma fragment frag void frag(ps_input i, out float4 outEmissive : SV_Target0) { diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template index 001df6a2388..7cc3abe681e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/VFXDecal.template @@ -1,5 +1,3 @@ - -//TODO : Check for unnecessary includes / and for necessary ones #define VFXComputePixelOutputToDBuffer(i,outDBuffer) \ { \ DecalSurfaceData surfaceData; \ From a4e68b834e5b9b8b0372d91be452a78c676867b4 Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Fri, 9 Jul 2021 16:13:22 +0200 Subject: [PATCH 65/66] Docs: set Fade Factor type --- .../Documentation~/Context-OutputParticleHDRPLitDecal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md b/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md index f093ea784f3..396b682c63b 100644 --- a/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md +++ b/com.unity.visualeffectgraph/Documentation~/Context-OutputParticleHDRPLitDecal.md @@ -34,7 +34,7 @@ Below is a list of settings and properties specific to the Output Particle HDRP | **Input** | **Type** | **Description** | | --------------------- | -------- | ------------------------------------------------------------ | -| **Fade Factor** | | Change this value to fade the decal in and out. A value of 0 makes the decal fully transparent, and a value of 1 does not change the overall opacity. | +| **Fade Factor** | Float | Change this value to fade the decal in and out. A value of 0 makes the decal fully transparent, and a value of 1 does not change the overall opacity. | | **Angle Fade** | Vector2 | Use the min-max slider to control the fade out range of the decal (in degrees) based on the angle between the Decal backward direction and the vertex normal of the receiving surface. This property is only available when the [Decal Layers](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.0/manual/Decal.html) feature is enabled. This value is clamped between 0 and 180 degrees. | | **Ambient Occlusion** | Float | Use the slider to set the strength of the ambient occlusion effect of the decal. This property only has an effect when you enable the **Metal and Ambient Occlusion properties** checkbox in your [HDRP Asset](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.0/manual/HDRP-Asset.html#Decals). | From 0660fdeb24c496efcf647906b56329fab99fa58a Mon Sep 17 00:00:00 2001 From: Ludovic Theobald Date: Mon, 12 Jul 2021 18:01:38 +0200 Subject: [PATCH 66/66] UI review fix --- .../GraphView/Views/Properties/Vector2PropertyRM.cs | 9 ++++++--- .../Editor/Types/VFXPropertyAttribute.cs | 6 ++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs index ad4a3c01539..4b07c410f1d 100644 --- a/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs +++ b/com.unity.visualeffectgraph/Editor/GraphView/Views/Properties/Vector2PropertyRM.cs @@ -5,6 +5,9 @@ namespace UnityEditor.VFX.UI { + /// + /// Vector2 properties can represent a Min-Max range. This custom PropertyRM allows to display it as a MinMaxSlider + /// class Vector2PropertyRM : SimpleUIPropertyRM { VFXVector2Field m_VectorField; @@ -38,9 +41,6 @@ public override INotifyValueChanged CreateField() { Vector2 range = m_Provider.attributes.FindRange(); result = CreateSliderField(out m_Slider); - m_Slider.onValueDragFinished = ValueDragFinished; - m_Slider.onValueDragStarted = ValueDragStarted; - m_Slider.RegisterCallback(OnFocusLost); m_Slider.range = range; } else @@ -111,6 +111,9 @@ protected INotifyValueChanged CreateSliderField(out VFXMinMaxSliderFiel { var field = new VFXLabeledField(m_Label); slider = field.control; + slider.onValueDragFinished = ValueDragFinished; + slider.onValueDragStarted = ValueDragStarted; + slider.RegisterCallback(OnFocusLost); return field; } diff --git a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs index 9b9d748017f..b15885000e7 100644 --- a/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs +++ b/com.unity.visualeffectgraph/Editor/Types/VFXPropertyAttribute.cs @@ -174,14 +174,12 @@ public VFXExpression ApplyToExpressionGraph(VFXExpression exp) { exp = VFXOperatorUtility.Normalize(exp); } - else if (attribute is EnumAttribute) + else if (attribute is EnumAttribute enumAttribute) { - var enumAttribute = (EnumAttribute)attribute; exp = new VFXExpressionMin(exp, VFXValue.Constant((uint)enumAttribute.values.Length - 1)); } - else if (attribute is MinMaxAttribute) + else if (attribute is MinMaxAttribute minMaxAttribute) { - var minMaxAttribute = (MinMaxAttribute)attribute; exp = VFXOperatorUtility.Clamp(exp, VFXValue.Constant(minMaxAttribute.min), VFXValue.Constant(minMaxAttribute.max)); } else