Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
462dcd8
[Port] [2021.3] [6000.3][UUM-111256] Fix Blurry and Stretched Light T…
svc-reach-platform-support Aug 20, 2025
9fae088
[Port] [2021.3] DOCG-7358 Fixes and improvements to Scene Depth Node …
svc-reach-platform-support Aug 20, 2025
d39142f
[Port] [2021.3] DOCG-7299 Improvements to Simple Noise node docs
markg-unity Aug 20, 2025
789c45a
[Port] [2021.3] DOCG-7355 Remap node docs improvements
svc-reach-platform-support Aug 21, 2025
b6824c6
[Port] [2021.3] Minor shader graph docs fixes
svc-reach-platform-support Aug 23, 2025
50e8713
[Port] [2021.3] DOCG-7329 Improve UV Node docs
svc-reach-platform-support Aug 23, 2025
0a7e5aa
[Port] [2021.3] DOCG-7278 Improve Position node docs
markg-unity Aug 23, 2025
7e03ae5
[Port] [2021.3] DOCG-7073 Custom interpolator node docs improvements
svc-reach-platform-support Aug 23, 2025
d1a75ba
[Port] [2021.3] DOCG-7358 Scene Color Node docs improvements
svc-reach-platform-support Aug 23, 2025
a9766f8
[Port] [2021.3] DOCG-7283 Improve Replace Color node docs
svc-reach-platform-support Aug 23, 2025
7701b74
[Port] [2021.3] DOCG-7309 Branch node docs improvements
svc-reach-platform-support Aug 23, 2025
87c2bc2
[Port] [2021.3] DOCG-7342 Improvements to Dither node docs
svc-reach-platform-support Aug 23, 2025
b0d80b5
[Port] [2021.3] DOCG-7438 Improve Emission node docs
svc-reach-platform-support Aug 23, 2025
f9df615
[Port] [2021.3] DOCG-7288 port descript fix
svc-reach-platform-support Aug 28, 2025
ba3d60c
[Port] [2021.3] DOCG-7195 Update volumetric fog with light layers note
markg-unity Aug 28, 2025
6e94b2d
[UUM-113462] Disable unstable tests
AngelaDematte Aug 28, 2025
af05a2d
[Port] [2021.3] DOCG-7369 Improve Object node docs
markg-unity Aug 28, 2025
82d4775
[Port] [2021.3] [UUM-99709] Material Converter should enable AlphaCli…
svc-reach-platform-support Sep 3, 2025
6d30325
[Port] [2021.3] DOCG-7365 Shader Graph feedback improvements
svc-reach-platform-support Sep 3, 2025
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 @@ -71,6 +71,7 @@ class KeywordFloatRename
public float setVal, unsetVal;
}
List<KeywordFloatRename> m_KeywordFloatRename = new List<KeywordFloatRename>();
Dictionary<string, (string, System.Func<float, bool>)> m_ConditionalFloatRename;

/// <summary>
/// Type of property to rename.
Expand Down Expand Up @@ -219,6 +220,20 @@ public virtual void Convert(Material srcMaterial, Material dstMaterial)

dstMaterial.SetFloat(t.property, srcMaterial.IsKeywordEnabled(t.keyword) ? t.setVal : t.unsetVal);
}

// Handle conditional float renaming
if (m_ConditionalFloatRename != null)
{
foreach (var (oldName, (newName, condition)) in m_ConditionalFloatRename)
{
if (srcMaterial.HasProperty(oldName) &&
condition(srcMaterial.GetFloat(oldName)) &&
dstMaterial.HasProperty(newName))
{
dstMaterial.SetFloat(newName, 1.0f);
}
}
}
}

/// <summary>
Expand Down Expand Up @@ -315,6 +330,17 @@ public void RenameKeywordToFloat(string oldName, string newName, float setVal, f
m_KeywordFloatRename.Add(new KeywordFloatRename { keyword = oldName, property = newName, setVal = setVal, unsetVal = unsetVal });
}

/// <summary>
/// Rename a float property conditionally based on its value
/// </summary>
/// <param name="oldName">Old property name</param>
/// <param name="newName">New property name</param>
/// <param name="condition">Condition function that takes the float value and returns true if renaming should occur</param>
protected void RenameFloat(string oldName, string newName, System.Func<float, bool> condition)
{
(m_ConditionalFloatRename ??= new Dictionary<string, (string, System.Func<float, bool>)>())[oldName] = (newName, condition);
}

static MaterialUpgrader GetUpgrader(List<MaterialUpgrader> upgraders, Material material)
{
if (material == null || material.shader == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ HDRP implements an exponential fog, where density varies exponentially with dist
Instead of using a constant color, fog can use the background sky as a source for color. In this case, HDRP samples the color from different mipmaps of the cubemap generated from the current sky settings. The chosen mip varies linearly between the lowest resolution and the highest resolution mipmaps, depending on the distance from the Camera and the values in the fog component’s **Mip Fog** properties. You can also choose to limit the resolution of the highest mip that HDRP uses. Doing this adds a volumetric effect to the fog and is less resource intensive to use than actual volumetric fog.

Optionally, you can enable volumetric fog for GameObjects close to the camera. It realistically simulates the interaction of lights with fog, which allows for physically plausible rendering of glow and crepuscular rays, which are beams of light that stream through gaps in objects like clouds and trees from a central point.

**Note:** Volumetric fog doesn't support [light rendering layers](Light-Layers).

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ public StandardUpgrader(string oldShaderName)
}

RenameFloat("_Mode", "_Surface");
RenameFloat("_Mode", "_AlphaClip", renderingMode => renderingMode == 1.0f);
RenameTexture("_MainTex", "_BaseMap");
RenameColor("_Color", "_BaseColor");
RenameFloat("_GlossyReflections", "_EnvironmentReflections");
Expand Down
16 changes: 8 additions & 8 deletions Packages/com.unity.shadergraph/Documentation~/Branch-Node.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Branch Node
# Branch node

## Description
The Branch node adds a dynamic branch to the shader, which outputs a different value depending on whether the input is true or false.

Provides a dynamic branch to the shader. If input **Predicate** is true, this node returns input **True**, otherwise it returns input **False**. The **Branch Node** evaluates the **Predicate** per vertex or per pixel depending on shader stage. Both sides of the branch are evaluated in the shader, and the branch not used is discarded.
Both sides of the branch are evaluated in the shader, and the output from the unused path is discarded.

## Ports

| Name | Direction | Type | Binding | Description |
| **Name** | **Direction** | **Type** | **Binding** | **Description** |
|:----------|:----------|:---------------|:--------|:------------|
| Predicate | Input | Boolean | None | Determines which input to return. |
| True | Input | Dynamic Vector | None | Returned if **Predicate** is true. |
| False | Input | Dynamic Vector | None | Returned if **Predicate** is false. |
| Out | Output | Dynamic Vector | None | Output value |
| **Predicate** | Input | Boolean | None | The input to test the value of. If you input a float, all values are evaluated as `true` except `0`. |
| **True** | Input | Dynamic Vector | None | The value to output as **Out** if **Predicate** is true. |
| **False** | Input | Dynamic Vector | None | The value to output as **Out** if **Predicate** is false. |
| **Out** | Output | Dynamic Vector | None | Outputs either **True** or **False**. |

## Generated Code Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ This node applies a deformation to a normalized IrisUV coordinate to simulate th

| name | **Direction** | type | description |
| -------------------------- | ------------- | ------- | ------------------------------------------------------------ |
| **IrisUV** | Input | Vector2 | Position of the fragment to shade in object space. |
| **Pupil Radius** | Input | float | Direction of the incident ray in object space. Either from the camera in rasterization or from the previous bounce in ray tracing. |
| **Maximal Pupil Aperture** | Input | float | The normal of the eye surface in object space. |
| **Minimal Pupil Aperture** | Input | float | The index of refraction of the eye (**1.333** by default). |
| **Pupil Apertur** | Input | float | Distance between the end of the cornea and the iris plane. For the default model, this value should be **0.02** |
| **IrisUV** | Output | Vector2 | Position of the refracted point on the iris plane in object space. |
| **Iris UV** | Input | Vector2 | Normalized UV coordinates that can be used to sample either a texture or procedurally generate an Iris Texture. |
| **Pupil Radius** | Input | float | Radius of the pupil in the iris texture as a percentage. |
| **Pupil Aperture** | Input | float | Set the current diameter of the pupil opening. |
| **Maximal Pupil Aperture** | Input | float | Define the largest size the pupil opening can reach. |
| **Minimal Pupil Aperture** | Input | float | Define the smallest size the pupil opening can reach. |
Loading