Skip to content

Commit 31e89cf

Browse files
authored
Merge pull request #8256 from Unity-Technologies/internal/6000.0/staging
Mirror Internal/6000.0/staging
2 parents 267d38d + 9658c40 commit 31e89cf

File tree

7 files changed

+35
-6
lines changed

7 files changed

+35
-6
lines changed

Packages/com.unity.render-pipelines.high-definition/Documentation~/fog-volume-master-stack-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ These settings appear when you select the Fog’s material in the Asset window.
6868
| **Fog Volume options** | | |
6969
| | **Single Scattering Albedo** | Control the color of each fog particle. The fog’s density doesn’t affect this color. |
7070
| | **Fog Distance** | Control how far you can see through the fog in meters. This controls how far the light passes through fog to affect how opaque it appears. A value of 0 makes the fog appear opaque. |
71-
| | **Blend mode** | Determine how this fog shader blends with existing fog in the scene. This property overwrites the Blend mode you set in the Surface Options:<br />&#8226; **Overwrite:** Replaces existing fog in the volume area with this fog shader.Presented **content strategy** initiatives to leads in key team meetings.&#8226;**Additive:** Adds the color and density of this fog shader to other fog in the scene. This is the default value.<br /> **Multiply:** Multiplies the color and density of this fog shader with other fog in the scene. You can use this to create effects relative to a specific fog density.<br />&#8226; **Min:** Determines the minimum density value of this fog shader and the scene fog inside its bounding box. For example, a value of 0 appears to remove fog in a certain area.<br />&#8226; **Max:** Determines the maximum density value of this fog shader and the scene fog inside its bounding box. |
71+
| | **Blend mode** | Determine how this fog shader blends with existing fog in the scene. This property overwrites the Blend mode you set in the Surface Options:<br />&#8226; **Overwrite:** Replaces existing fog in the volume area with this fog shader.<br/>&#8226;**Additive:** Adds the color and density of this fog shader to other fog in the scene. This is the default value.<br /> **Multiply:** Multiplies the color and density of this fog shader with other fog in the scene. You can use this to create effects relative to a specific fog density.<br />&#8226; **Min:** Determines the minimum density value of this fog shader and the scene fog inside its bounding box. For example, a value of 0 appears to remove fog in a certain area.<br />&#8226; **Max:** Determines the maximum density value of this fog shader and the scene fog inside its bounding box. |

Packages/com.unity.render-pipelines.universal/Editor/Decal/DecalPass.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Pass
6464
#endif
6565
#if _RENDER_PASS_ENABLED
6666
#define GBUFFER3 0
67+
FRAMEBUFFER_INPUT_X_FLOAT(GBUFFER3);
6768
#define GBUFFER4 1
68-
FRAMEBUFFER_INPUT_X_HALF(GBUFFER3);
6969
FRAMEBUFFER_INPUT_X_HALF(GBUFFER4);
7070
#endif
7171
// Includes

Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPassDecal.hlsl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,21 @@ void Frag(PackedVaryings packedInput,
240240
#endif
241241

242242
#if defined(DECAL_RECONSTRUCT_NORMAL)
243-
#if defined(_DECAL_NORMAL_BLEND_HIGH)
243+
#if defined(_RENDER_PASS_ENABLED)
244+
half3 normalWS = half3(ReconstructNormalDerivative(input.positionCS.xy, LOAD_FRAMEBUFFER_X_INPUT(GBUFFER3, positionCS.xy).x));
245+
#elif defined(_DECAL_NORMAL_BLEND_HIGH)
244246
half3 normalWS = half3(ReconstructNormalTap9(positionCS.xy));
245247
#elif defined(_DECAL_NORMAL_BLEND_MEDIUM)
246248
half3 normalWS = half3(ReconstructNormalTap5(positionCS.xy));
247249
#else
248250
half3 normalWS = half3(ReconstructNormalDerivative(input.positionCS.xy));
249251
#endif
250252
#elif defined(DECAL_LOAD_NORMAL)
251-
half3 normalWS = half3(LoadSceneNormals(positionCS.xy));
253+
#if defined(_RENDER_PASS_ENABLED)
254+
half3 normalWS = normalize(LOAD_FRAMEBUFFER_X_INPUT(GBUFFER2, positionCS.xy).rgb);
255+
#else
256+
half3 normalWS = normalize(LoadSceneNormals(positionCS.xy).rgb);
257+
#endif
252258
#endif
253259

254260
float2 positionSS = FoveatedRemapNonUniformToLinearCS(input.positionCS.xy) * _ScreenSize.zw;

Packages/com.unity.render-pipelines.universal/Editor/VFXGraph/Shaders/Templates/URPDecal/PassGBuffer.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444

4545
#if _RENDER_PASS_ENABLED
4646
#define GBUFFER3 0
47+
FRAMEBUFFER_INPUT_X_FLOAT(GBUFFER3);
4748
#define GBUFFER4 1
48-
FRAMEBUFFER_INPUT_X_HALF(GBUFFER3);
4949
FRAMEBUFFER_INPUT_X_HALF(GBUFFER4);
5050
#endif
5151

Packages/com.unity.render-pipelines.universal/ShaderLibrary/NormalReconstruction.hlsl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ float GetRawDepth(float2 uv)
2020
// https://github.com/keijiro/DepthInverseProjection
2121
// constructs view space ray at the far clip plane from the screen uv
2222
// then multiplies that ray by the linear 01 depth
23+
float3 ViewSpacePosAtScreenUV(float2 uv, float deviceDepth)
24+
{
25+
float3 viewSpaceRay = mul(_NormalReconstructionMatrix[unity_eyeIndex], float4(uv * 2.0 - 1.0, 1.0, 1.0) * _ProjectionParams.z).xyz;
26+
return viewSpaceRay * Linear01Depth(deviceDepth, _ZBufferParams);
27+
}
28+
29+
float3 ViewSpacePosAtPixelPosition(float2 positionSS, float deviceDepth)
30+
{
31+
float2 uv = positionSS * _ScreenSize.zw;
32+
return ViewSpacePosAtScreenUV(uv, deviceDepth);
33+
}
34+
35+
half3 ReconstructNormalDerivative(float2 positionSS, float deviceDepth)
36+
{
37+
float3 viewSpacePos = ViewSpacePosAtPixelPosition(positionSS, deviceDepth);
38+
float3 hDeriv = ddy(viewSpacePos);
39+
float3 vDeriv = ddx(viewSpacePos);
40+
return half3(SafeNormalize(cross(hDeriv, vDeriv)));
41+
}
42+
2343
float3 ViewSpacePosAtScreenUV(float2 uv)
2444
{
2545
float3 viewSpaceRay = mul(_NormalReconstructionMatrix[unity_eyeIndex], float4(uv * 2.0 - 1.0, 1.0, 1.0) * _ProjectionParams.z).xyz;

Packages/com.unity.shadergraph/Documentation~/Graph-Target.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Target Settings are specific to each Target, and can vary between assets dependi
1010

1111
Typically, each Target you select generates a valid subshader from the graph. For example, a Shader Graph asset with both URP and HDRP Targets will generate two subshaders. When you use a graph that targets multiple render pipelines, you must reimport the Shader Graph asset if you change the active render pipeline. This updates the Material Inspector for any Materials that use your graph.
1212

13-
Shader Graph supports three targets: the [Universal Render Pipeline](https://docs.unity3d.com/Manual/urp/urp-introduction.html), the [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.0/manual/index.html), and the [Built-In Render Pipeline](https://docs.unity3d.com/2020.3/Documentation/Manual/render-pipelines).
13+
Shader Graph supports three targets: the [Universal Render Pipeline](https://docs.unity3d.com/Manual/urp/urp-introduction.html), the [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/), and the [Built-In Render Pipeline](https://docs.unity3d.com/Documentation/Manual/built-in-render-pipeline.html).
1414

1515
Not all blocks are compatible with all targets. If a block in your graph becomes inactive when you choose a target, that block is not compatible with that target.
1616

Packages/com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ void OnSubGraphDoubleClick(MouseDownEvent evt)
334334

335335
var path = AssetDatabase.GUIDToAssetPath(subgraphNode.subGraphGuid);
336336
ShaderGraphImporterEditor.ShowGraphEditWindow(path);
337+
338+
// Stop the double click event from starting a drag action on the node
339+
evt.StopImmediatePropagation();
337340
}
338341
}
339342

0 commit comments

Comments
 (0)