Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
70073df
[Port] [6000.4] [UUM-138256] Added shader variant stripping for point…
CalChiu Apr 29, 2026
e992e59
[Port] [6000.4] docg-8419: Fix Flipbook Player property visibility de…
Apr 30, 2026
a5c518c
[Port] [6000.4] [UUM-134522][UUM-136056][URP 2D][6000.6] Fix 2d shado…
Apr 30, 2026
bbccecc
[Port] [6000.4] [UUM-140770][URP 2D][6000.6] Fix Inspector Preview wi…
Apr 30, 2026
9182020
[6000.4] Render Pipeline Converter - Scan/ Convert buttons min height…
alex-vazquez-unity3d May 4, 2026
540daf1
[Port] [6000.4] Fix GPU crash with shadergraph AdditionalLightsBasic …
May 4, 2026
2f35225
[Backport-6000.4] Update Terrain Samples (Fix UUM-140721)
RemyUnity May 6, 2026
6e8de57
Shader Graph : Apply API Updates
FredMoreau May 6, 2026
67670c5
[Port] [6000.4] Fixed Main Preview not being updated properly in UITK…
alexandret-unity May 6, 2026
5ce1ee4
[Port] [6000.4] URP Renderer - When adding/removing scriptable render…
May 6, 2026
9cb3f47
[Port] [6000.4] [UUM-109492] Fixed UberPostProcess pass viewport scal…
CalChiu May 8, 2026
d6f778b
[Port] [6000.4] [VFX] Avoid serializing the "model" Object in VFXEdit…
May 8, 2026
e18c414
[6000.4 Backport] [HDRP][XR] Update ClearBuffer2D to support XR views
May 8, 2026
cd2a50a
[Port] [6000.4] docg-8030: Replace edge with wire
May 8, 2026
092c010
[Port] [6000.4] Added navigation to Shader Graph preferences ref page…
May 8, 2026
ca84d20
[Port] [6000.4] [UUM-137272] Change file access strategy in Shader Gr…
april-roszkowski May 11, 2026
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 @@ -88,4 +88,5 @@
.converter-button {
flex-shrink: 0;
min-width: 100px; /* adjust to your layout */
min-height: 20px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
namespace UnityEditor.Rendering.HighDefinition
{
[Serializable]
class PluginMaterialVersions : SerializedDictionary<GUID, int, string, int>
class PluginMaterialVersions : SerializedDictionary<UnityEngine.GUID, int, string, int>
{
public override string SerializeKey(GUID key) => key.ToString();
public override string SerializeKey(UnityEngine.GUID key) => key.ToString();
public override int SerializeValue(int val) => val;
public override GUID DeserializeKey(string key)
public override UnityEngine.GUID DeserializeKey(string key)
{
if (!string.IsNullOrEmpty(key) && GUID.TryParse(key, out GUID guid))
if (!string.IsNullOrEmpty(key) && UnityEngine.GUID.TryParse(key, out UnityEngine.GUID guid))
return guid;
else
return new GUID();
return new UnityEngine.GUID();
}

public override int DeserializeValue(int val) => val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ sealed partial class EyeSubTarget : LightingSubTarget, ILegacyTarget, IRequiresD
{
public EyeSubTarget() => displayName = "Eye";

static readonly GUID kSubTargetSourceCodeGuid = new GUID("864e4e09d6293cf4d98457f740bb3301"); // EyeSubTarget.cs
static readonly UnityEngine.GUID kSubTargetSourceCodeGuid = new UnityEngine.GUID("864e4e09d6293cf4d98457f740bb3301"); // EyeSubTarget.cs

static string[] passTemplateMaterialDirectories = new string[]
{
$"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/Eye/ShaderGraph/"
};

protected override string[] templateMaterialDirectories => passTemplateMaterialDirectories;
protected override GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override UnityEngine.GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override ShaderID shaderID => ShaderID.SG_Eye;
protected override string subShaderInclude => "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Eye/Eye.hlsl";
protected override FieldDescriptor subShaderField => new FieldDescriptor(kSubShader, "Eye SubShader", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ sealed partial class FabricSubTarget : LightingSubTarget, ILegacyTarget, IRequir
{
public FabricSubTarget() => displayName = "Fabric";

static readonly GUID kSubTargetSourceCodeGuid = new GUID("74f1a4749bab90d429ac01d094be0aeb"); // FabricSubTarget.cs
static readonly UnityEngine.GUID kSubTargetSourceCodeGuid = new UnityEngine.GUID("74f1a4749bab90d429ac01d094be0aeb"); // FabricSubTarget.cs

static string[] passTemplateMaterialDirectories = new string[]
{
$"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/Fabric/ShaderGraph/"
};

protected override string[] templateMaterialDirectories => passTemplateMaterialDirectories;
protected override GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override UnityEngine.GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override ShaderID shaderID => ShaderID.SG_Fabric;
protected override string subShaderInclude => "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Fabric/Fabric.hlsl";
protected override string raytracingInclude => CoreIncludes.kFabricRaytracing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ sealed partial class HairSubTarget : LightingSubTarget, ILegacyTarget, IRequires
{
public HairSubTarget() => displayName = "Hair";

static readonly GUID kSubTargetSourceCodeGuid = new GUID("7e681cc79dd8e6c46ba1e8412d519e26"); // HairSubTarget.cs
static readonly UnityEngine.GUID kSubTargetSourceCodeGuid = new UnityEngine.GUID("7e681cc79dd8e6c46ba1e8412d519e26"); // HairSubTarget.cs

static string[] passTemplateMaterialDirectories = new string[]
{
$"{HDUtils.GetHDRenderPipelinePath()}Editor/Material/Hair/ShaderGraph/"
};

protected override string[] templateMaterialDirectories => passTemplateMaterialDirectories;
protected override GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override UnityEngine.GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override ShaderID shaderID => ShaderID.SG_Hair;
protected override string subShaderInclude => CoreIncludes.kHair;
protected override string raytracingInclude => CoreIncludes.kHairRaytracing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class HDSixWaySubTarget : SurfaceSubTarget, IRequiresData<HDSixWayData>
{
public HDSixWaySubTarget() => displayName = "Six-way Smoke Lit";

static readonly GUID kSubTargetSourceCodeGuid = new GUID("b20b7afb3a1f43afafc0ac6ea3f2cb26"); // HDSixWaySubTarget.cs
static readonly UnityEngine.GUID kSubTargetSourceCodeGuid = new UnityEngine.GUID("b20b7afb3a1f43afafc0ac6ea3f2cb26"); // HDSixWaySubTarget.cs

static string[] passTemplateMaterialDirectories = new string[]
{
Expand All @@ -27,7 +27,7 @@ class HDSixWaySubTarget : SurfaceSubTarget, IRequiresData<HDSixWayData>
protected override FieldDescriptor subShaderField => new FieldDescriptor(kSubShader, "Six-way Lit Subshader", "");
protected override string subShaderInclude => CoreIncludes.kSixWayLit;
protected override ShaderID shaderID => ShaderID.SG_SixWay;
protected override GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override UnityEngine.GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;

protected override bool supportLighting => true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sealed partial class HDUnlitSubTarget : SurfaceSubTarget, IRequiresData<HDUnlitD
{
public HDUnlitSubTarget() => displayName = "Unlit";

static readonly GUID kSubTargetSourceCodeGuid = new GUID("4516595d40fa52047a77940183dc8e74"); // HDUnlitSubTarget.cs
static readonly UnityEngine.GUID kSubTargetSourceCodeGuid = new UnityEngine.GUID("4516595d40fa52047a77940183dc8e74"); // HDUnlitSubTarget.cs

static string[] passTemplateMaterialDirectories = new string[]
{
Expand All @@ -22,7 +22,7 @@ sealed partial class HDUnlitSubTarget : SurfaceSubTarget, IRequiresData<HDUnlitD
protected override string[] templateMaterialDirectories => passTemplateMaterialDirectories;
protected override ShaderID shaderID => ShaderID.SG_Unlit;
protected override string renderType => HDRenderTypeTags.HDUnlitShader.ToString();
protected override GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override UnityEngine.GUID subTargetAssetGuid => kSubTargetSourceCodeGuid;
protected override string customInspector => "Rendering.HighDefinition.HDUnlitGUI";
internal override MaterialResetter setupMaterialKeywordsAndPassFunc => ShaderGraphAPI.ValidateUnlitMaterial;
protected override FieldDescriptor subShaderField => new FieldDescriptor(kSubShader, "Unlit SubShader", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ RW_TEXTURE2D_X(float4, _Buffer2D);
[numthreads(8, 8, 1)]
void ClearBuffer2DMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadID.z);

if (any(dispatchThreadID.xy >= (uint2)_BufferSize.xy))
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ private void ClearEditorsList()
private void ForceSave()
{
EditorUtility.SetDirty(target);
AssetDatabase.SaveAssetIfDirty(target);
AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ enum ShaderFeatures : long
StencilLODCrossFade = (1L << 50),
DeferredPlus = (1L << 51),
ReflectionProbeAtlas = (1L << 52),
PointSamplingUpsampling = (1L << 53),
#if SURFACE_CACHE
SurfaceCache = (1L << 53),
SurfaceCache = (1L << 54),
#endif
All = ~0
}
Expand Down Expand Up @@ -589,6 +590,9 @@ internal static ShaderFeatures GetSupportedShaderFeaturesFromAsset(
if(urpAsset.allowPostProcessAlphaOutput)
urpAssetShaderFeatures |= ShaderFeatures.AlphaOutput;

if (urpAsset.upscalingFilter == UpscalingFilterSelection.Point)
urpAssetShaderFeatures |= ShaderFeatures.PointSamplingUpsampling;

// Check each renderer & renderer feature
urpAssetShaderFeatures = GetSupportedShaderFeaturesFromRenderers(
ref urpAsset,
Expand Down Expand Up @@ -1139,6 +1143,9 @@ ref List<ScreenSpaceAmbientOcclusionSettings> ssaoRendererFeatures
spd.stripSSAOSampleCountHigh &= ssaoSettings.Samples != ScreenSpaceAmbientOcclusionSettings.AOSampleOption.High;
}

// Upscaling
spd.stripPointSamplingUpsampling = !IsFeatureEnabled(shaderFeatures, ShaderFeatures.PointSamplingUpsampling);

return spd;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public bool PassHasKeyword(LocalKeyword keyword)
Shader m_StencilDeferred = Shader.Find("Hidden/Universal Render Pipeline/StencilDeferred");
Shader m_ClusterDeferred = Shader.Find("Hidden/Universal Render Pipeline/ClusterDeferred");
Shader m_UberPostShader = Shader.Find("Hidden/Universal Render Pipeline/UberPost");
Shader m_FinalPostShader = Shader.Find("Hidden/Universal Render Pipeline/FinalPost");
Shader m_HDROutputBlitShader = Shader.Find("Hidden/Universal/BlitHDROverlay");
Shader m_DataDrivenLensFlareShader = Shader.Find("Hidden/Universal Render Pipeline/LensFlareDataDriven");
Shader m_ScreenSpaceLensFlareShader = Shader.Find("Hidden/Universal Render Pipeline/LensFlareScreenSpace");
Expand Down Expand Up @@ -196,6 +197,7 @@ public bool PassHasKeyword(LocalKeyword keyword)
LocalKeyword m_Instancing;
LocalKeyword m_DotsInstancing;
LocalKeyword m_ProceduralInstancing;
LocalKeyword m_PointSampling;

private LocalKeyword TryGetLocalKeyword(Shader shader, string name)
{
Expand Down Expand Up @@ -267,6 +269,7 @@ private void InitializeLocalShaderKeywords([DisallowNull] Shader shader)
m_FilmGrain = TryGetLocalKeyword(shader, ShaderKeywordStrings.FilmGrain);
m_SHPerVertex = TryGetLocalKeyword(shader, ShaderKeywordStrings.EVALUATE_SH_VERTEX);
m_SHMixed = TryGetLocalKeyword(shader, ShaderKeywordStrings.EVALUATE_SH_MIXED);
m_PointSampling = TryGetLocalKeyword(shader, ShaderKeywordStrings.PointSampling);

m_Instancing = TryGetLocalKeyword(shader, "INSTANCING_ON");
m_DotsInstancing = TryGetLocalKeyword(shader, "DOTS_INSTANCING_ON");
Expand Down Expand Up @@ -819,6 +822,14 @@ internal bool StripUnusedFeatures_CrossFadeLod(ref IShaderScriptableStrippingDat
return !strippingData.IsShaderFeatureEnabled(ShaderFeatures.LODCrossFade);
}

internal bool StripUnusedFeatures_PointSamplingUpsampling(ref IShaderScriptableStrippingData strippingData, ref ShaderStripTool<ShaderFeatures> stripTool)
{
if (strippingData.shader != m_UberPostShader && strippingData.shader != m_FinalPostShader)
return false;

return stripTool.StripMultiCompile(m_PointSampling, ShaderFeatures.PointSamplingUpsampling);
}

internal bool StripUnusedFeatures(ref IShaderScriptableStrippingData strippingData)
{
if (StripUnusedFeatures_DebugDisplay(ref strippingData))
Expand Down Expand Up @@ -929,6 +940,9 @@ internal bool StripUnusedFeatures(ref IShaderScriptableStrippingData strippingDa
if (StripUnusedFeatures_XRMotionVector(ref strippingData))
return true;

if (StripUnusedFeatures_PointSamplingUpsampling(ref strippingData, ref stripTool))
return true;

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ internal class Universal2DRenderingData : ContextItem

internal int batchCount;

internal bool isLightingActive;

public override void Reset()
{
renderingData = null;
layerBatches = null;
batchCount = 0;
isLightingActive = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public LightStats GetLightStatsByLayer(int layerID, ref LayerBatch layer)
returnStats.totalNormalMapUsage++;
if (light.volumeIntensity > 0 && light.volumetricEnabled)
returnStats.totalVolumetricUsage++;
if (light.volumeIntensity > 0 && light.volumetricEnabled && RendererLighting.CanCastShadows(light, layerID))
if (RendererLighting.CanCastVolumetricShadows(light, layer.endLayerValue))
returnStats.totalVolumetricShadowUsage++;

returnStats.blendStylesUsed |= (uint)(1 << light.blendStyleIndex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ internal static bool CanCastShadows(Light2D light, int layerToRender)
return light.shadowsEnabled && light.shadowIntensity > 0 && light.IsLitLayer(layerToRender);
}

internal static bool CanCastVolumetricShadows(Light2D light, int endLayerValue)
{
return light.volumeIntensity > 0 && light.volumetricEnabled && light.renderVolumetricShadows && light.GetTopMostLitLayer() == endLayerValue;
}

internal static void SetLightShaderGlobals(IRasterCommandBuffer cmd, Light2DBlendStyle[] lightBlendStyles, int[] blendStyleIndices)
{
for (var i = 0; i < blendStyleIndices.Length; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ private static void Execute(RasterCommandBuffer cmd, PassData passData, LayerBat
layerBatch.endLayerValue != light.GetTopMostLitLayer()))
continue;

var useShadows = passData.layerBatch.lightStats.useShadows && layerBatch.shadowIndices.Contains(j);
var useShadows = (!passData.isVolumetric && passData.layerBatch.lightStats.useShadows) || (passData.isVolumetric && passData.layerBatch.lightStats.useVolumetricShadowLights);
useShadows &= layerBatch.shadowIndices.Contains(j);
var lightMaterial = passData.rendererData.GetLightMaterial(light, passData.isVolumetric, useShadows);
var lightMesh = light.lightMesh;

Expand Down Expand Up @@ -173,15 +174,11 @@ internal void Render(RenderGraph graph, ContextContainer frameData, int batchInd
{
Universal2DResourceData universal2DResourceData = frameData.Get<Universal2DResourceData>();
UniversalCameraData cameraData = frameData.Get<UniversalCameraData>();
var layerBatch = frameData.Get<Universal2DRenderingData>().layerBatches[batchIndex];

DebugHandler debugHandler = GetActiveDebugHandler(cameraData);
var isLightingActive = debugHandler?.IsLightingActive ?? true;
Universal2DRenderingData rendering2DData = frameData.Get<Universal2DRenderingData>();
var layerBatch = rendering2DData.layerBatches[batchIndex];

#if UNITY_EDITOR
if (cameraData.isSceneViewCamera && UnityEditor.SceneView.currentDrawingSceneView != null)
isLightingActive &= UnityEditor.SceneView.currentDrawingSceneView.sceneLighting;
#endif
// Check for lighting in scene/prefab/preview camera
var isLightingActive = rendering2DData.isLightingActive;

if (!layerBatch.lightStats.useLights ||
isVolumetric && !layerBatch.lightStats.useVolumetricLights ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,12 @@ public void Render(RenderGraph graph, ContextContainer frameData, int batchIndex
UniversalLightData lightData = frameData.Get<UniversalLightData>();
Universal2DResourceData universal2DResourceData = frameData.Get<Universal2DResourceData>();
CommonResourceData commonResourceData = frameData.Get<CommonResourceData>();
Renderer2DData rendererData = frameData.Get<Universal2DRenderingData>().renderingData;
var layerBatch = frameData.Get<Universal2DRenderingData>().layerBatches[batchIndex];

DebugHandler debugHandler = GetActiveDebugHandler(cameraData);
var isLightingActive = debugHandler?.IsLightingActive ?? true;
Universal2DRenderingData rendering2DData = frameData.Get<Universal2DRenderingData>();
Renderer2DData rendererData = rendering2DData.renderingData;
var layerBatch = rendering2DData.layerBatches[batchIndex];

#if UNITY_EDITOR
// Early out for prefabs
if (cameraData.isSceneViewCamera && UnityEditor.SceneView.currentDrawingSceneView != null)
isLightingActive = UnityEditor.SceneView.currentDrawingSceneView.sceneLighting;
#endif
// Check for lighting in scene/prefab/preview camera
var isLightingActive = rendering2DData.isLightingActive;

// Preset global light textures for first batch
if (batchIndex == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ internal class PassData
internal Renderer2DData rendererData;
internal TextureHandle[] shadowTextures;
internal TextureHandle shadowDepth;
internal bool isVolumetric;
}

public void Render(RenderGraph graph, ContextContainer frameData, int batchIndex, bool isVolumetric = false)
Expand All @@ -52,6 +53,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, int batchIndex

using (var builder = graph.AddUnsafePass<PassData>(passName, out var passData, LayerDebug.GetProfilingSampler(passName, profilingSampler)))
{
passData.isVolumetric = isVolumetric;
passData.layerBatch = layerBatch;
passData.rendererData = rendererData;
passData.shadowTextures = universal2DResourceData.shadowTextures[batchIndex];
Expand All @@ -72,6 +74,9 @@ public void Render(RenderGraph graph, ContextContainer frameData, int batchIndex
var index = data.layerBatch.shadowIndices[i];
var light = data.layerBatch.lights[index];

if (data.isVolumetric && !RendererLighting.CanCastVolumetricShadows(light, data.layerBatch.endLayerValue))
continue;

// Shadow Pass
ExecuteShadowPass(cmd, data, light, i);
}
Expand Down
Loading
Loading