Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ These settings appear when you select the Fog’s material in the Asset window.
| **Fog Volume options** | | |
| | **Single Scattering Albedo** | Control the color of each fog particle. The fog’s density doesn’t affect this color. |
| | **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. |
| | **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. |
| | **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. |
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Pass
#endif
#if _RENDER_PASS_ENABLED
#define GBUFFER3 0
FRAMEBUFFER_INPUT_X_FLOAT(GBUFFER3);
#define GBUFFER4 1
FRAMEBUFFER_INPUT_X_HALF(GBUFFER3);
FRAMEBUFFER_INPUT_X_HALF(GBUFFER4);
#endif
// Includes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,21 @@ void Frag(PackedVaryings packedInput,
#endif

#if defined(DECAL_RECONSTRUCT_NORMAL)
#if defined(_DECAL_NORMAL_BLEND_HIGH)
#if defined(_RENDER_PASS_ENABLED)
half3 normalWS = half3(ReconstructNormalDerivative(input.positionCS.xy, LOAD_FRAMEBUFFER_X_INPUT(GBUFFER3, positionCS.xy).x));
#elif defined(_DECAL_NORMAL_BLEND_HIGH)
half3 normalWS = half3(ReconstructNormalTap9(positionCS.xy));
#elif defined(_DECAL_NORMAL_BLEND_MEDIUM)
half3 normalWS = half3(ReconstructNormalTap5(positionCS.xy));
#else
half3 normalWS = half3(ReconstructNormalDerivative(input.positionCS.xy));
#endif
#elif defined(DECAL_LOAD_NORMAL)
half3 normalWS = half3(LoadSceneNormals(positionCS.xy));
#if defined(_RENDER_PASS_ENABLED)
half3 normalWS = normalize(LOAD_FRAMEBUFFER_X_INPUT(GBUFFER2, positionCS.xy).rgb);
#else
half3 normalWS = normalize(LoadSceneNormals(positionCS.xy).rgb);
#endif
#endif

float2 positionSS = FoveatedRemapNonUniformToLinearCS(input.positionCS.xy) * _ScreenSize.zw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

#if _RENDER_PASS_ENABLED
#define GBUFFER3 0
FRAMEBUFFER_INPUT_X_FLOAT(GBUFFER3);
#define GBUFFER4 1
FRAMEBUFFER_INPUT_X_HALF(GBUFFER3);
FRAMEBUFFER_INPUT_X_HALF(GBUFFER4);
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ float GetRawDepth(float2 uv)
// https://github.com/keijiro/DepthInverseProjection
// constructs view space ray at the far clip plane from the screen uv
// then multiplies that ray by the linear 01 depth
float3 ViewSpacePosAtScreenUV(float2 uv, float deviceDepth)
{
float3 viewSpaceRay = mul(_NormalReconstructionMatrix[unity_eyeIndex], float4(uv * 2.0 - 1.0, 1.0, 1.0) * _ProjectionParams.z).xyz;
return viewSpaceRay * Linear01Depth(deviceDepth, _ZBufferParams);
}

float3 ViewSpacePosAtPixelPosition(float2 positionSS, float deviceDepth)
{
float2 uv = positionSS * _ScreenSize.zw;
return ViewSpacePosAtScreenUV(uv, deviceDepth);
}

half3 ReconstructNormalDerivative(float2 positionSS, float deviceDepth)
{
float3 viewSpacePos = ViewSpacePosAtPixelPosition(positionSS, deviceDepth);
float3 hDeriv = ddy(viewSpacePos);
float3 vDeriv = ddx(viewSpacePos);
return half3(SafeNormalize(cross(hDeriv, vDeriv)));
}

float3 ViewSpacePosAtScreenUV(float2 uv)
{
float3 viewSpaceRay = mul(_NormalReconstructionMatrix[unity_eyeIndex], float4(uv * 2.0 - 1.0, 1.0, 1.0) * _ProjectionParams.z).xyz;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Target Settings are specific to each Target, and can vary between assets dependi

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.

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).
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).

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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ void OnSubGraphDoubleClick(MouseDownEvent evt)

var path = AssetDatabase.GUIDToAssetPath(subgraphNode.subGraphGuid);
ShaderGraphImporterEditor.ShowGraphEditWindow(path);

// Stop the double click event from starting a drag action on the node
evt.StopImmediatePropagation();
}
}

Expand Down