diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template new file mode 100644 index 00000000000..e86c721a0ea --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template @@ -0,0 +1,17 @@ +Pass +{ + Tags { "LightMode"="DepthForwardOnly" } + + ZWrite On + Blend Off + + HLSLPROGRAM + #define VFX_PASSDEPTH VFX_PASSDEPTH_ACTUAL + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_DECAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + ${VFXIncludeRP("Templates/Mesh/PassDepthOrMV.template")} + + + ENDHLSL +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template.meta new file mode 100644 index 00000000000..7c8bde8ebf1 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/Mesh/PassDepthForwardOnly.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 251722a6d90822e4db4f5cc082ae48c8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template new file mode 100644 index 00000000000..7f02f127278 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template @@ -0,0 +1,15 @@ +Pass +{ + Tags { "LightMode"="DepthForwardOnly" } + + ZWrite On + Blend Off + + HLSLPROGRAM + #define VFX_PASSDEPTH VFX_PASSDEPTH_ACTUAL + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepthOrMV.template")} + + ENDHLSL +} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template.meta b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template.meta new file mode 100644 index 00000000000..4ddf46f2937 --- /dev/null +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassDepthForwardOnly.template.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 782f19a04d88d9f4aaf1c889cea63180 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template index 3cc4082b655..0c8a6c431df 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitMesh.template @@ -4,7 +4,8 @@ Tags{ "RenderPipeline" = "HDRenderPipeline" } ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXIncludeRP("Templates/Mesh/PassSelection.template")} - ${VFXIncludeRP("Templates/Mesh/PassDepth.template"),IS_OPAQUE_PARTICLE} + ${VFXIncludeRP("Templates/Mesh/PassDepth.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} + ${VFXIncludeRP("Templates/Mesh/PassDepthForwardOnly.template"),HDRP_MATERIAL_TYPE_SIMPLELIT} ${VFXIncludeRP("Templates/Mesh/PassVelocity.template"),USE_MOTION_VECTORS_PASS} ${VFXIncludeRP("Templates/Mesh/PassGBuffer.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} ${VFXIncludeRP("Templates/Mesh/PassForward.template")} diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template index c1ec8d659e0..c565abd909e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/VFXParticleLitPlanarPrimitive.template @@ -6,7 +6,8 @@ ${VFXInclude("Shaders/VFXParticleHeader.template")} ${VFXIncludeRP("Templates/PlanarPrimitive/PassSelection.template")} - ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepth.template"),IS_OPAQUE_PARTICLE} + ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepth.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} + ${VFXIncludeRP("Templates/PlanarPrimitive/PassDepthForwardOnly.template"),HDRP_MATERIAL_TYPE_SIMPLELIT} ${VFXIncludeRP("Templates/PlanarPrimitive/PassVelocity.template"),USE_MOTION_VECTORS_PASS} ${VFXIncludeRP("Templates/PlanarPrimitive/PassGBuffer.template"),IS_OPAQUE_NOT_SIMPLE_LIT_PARTICLE} ${VFXIncludeRP("Templates/PlanarPrimitive/PassForward.template")} diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl index 0748c7e8119..aa9cfcdbade 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/SimpleLit.hlsl @@ -235,6 +235,14 @@ PreLightData GetPreLightData(float3 V, PositionInputs posInput, inout BSDFData b return preLightData; } +NormalData ConvertSurfaceDataToNormalData(SurfaceData surfaceData) +{ + NormalData normalData; + normalData.normalWS = surfaceData.normalWS; + normalData.perceptualRoughness = PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness); + return normalData; +} + #ifdef HAS_LIGHTLOOP bool IsNonZeroBSDF(float3 V, float3 L, PreLightData preLightData, BSDFData bsdfData)