Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
91cced6
Auto initialize lighting toggle.
pema99 Sep 19, 2024
e5ff769
Update UPM to 8.9.0
z3le Sep 19, 2024
cc4739e
[VFX] Tooltips are missing
julienamsellem Sep 19, 2024
80dfc99
Enable Clearing RG Globals By Default
gmitrano-unity Sep 19, 2024
f65eaea
UUM-29958 Wrong Blit Texture Source when using SetGlobalKeyword
RoseHirigoyen Sep 20, 2024
a811713
[VFX][Fix] Refresh of in-graph profiling info
ludovic-theobald Sep 20, 2024
4098025
[UUM-77895] Fix memory leaks
SamuelSiltanenUnity Sep 20, 2024
86cc90b
HDRP: Fix light range getting overriden on multi-select
Sep 20, 2024
ff5e51d
Update HDRP to using the new TextureDesc field format instead of colo…
UnityAljosha Sep 20, 2024
3f38e72
[SRP] Scene Template Lifting
remi-chapelain Sep 20, 2024
2492ba1
When calculating spotlight screen tile ranges for forward plus, cull …
Paulm-Unity Sep 20, 2024
3b4b7ab
[VFX][Fix] Add debug display code in unlit shader passes
ludovic-theobald Sep 21, 2024
665d06f
Graphics/SRP/RPF - [UUM-68284] - Fix URP RG camera stacking when rend…
axoloto Sep 21, 2024
1a50dfa
[6000][UUM-82513] Fix lights flickering on iOS due to precision
kennytann Sep 21, 2024
810a279
Fix distortion shadergraph regression
alelievr Sep 23, 2024
89f4f2e
[Unity 6][URP] Fixing an issue with Shadow pancaking code and improvi…
ellioman Sep 23, 2024
e7f2093
[ShaderGraph] Remove exception from shader graph asset importer
Sep 23, 2024
ca3e368
Fixed potential memory leak when cleaning up `ProbeReferenceVolume`
jrs-unity Sep 23, 2024
2c037b8
Fix seams across cell boundaries in APV
laylaarab Sep 23, 2024
12a5caa
[HDRP] Fix for DOF artifact when resolution changes by DRS
Sep 24, 2024
2327224
Fixed UUM-75818
bencloward Sep 25, 2024
7e9dd9e
[HDRP] Fix gameview focus issue
remi-chapelain Sep 25, 2024
895e99a
Update URP sample codes to use RenderGraph helper functions
cinight Sep 25, 2024
b844297
[WebGPU] URP Lighting and Post Processing Tests on Yamato
christing12 Sep 25, 2024
ee3453b
[UUM-81533] Fixed use of potentially uninitialized variable warning i…
mseonkim-unity Sep 25, 2024
c468b68
Small documentation fixes September 2024
markg-unity Sep 25, 2024
08da788
Enabled foveated rendering for UberPost pass(when it is the last pass…
thomas-zeng Sep 26, 2024
46a9b08
Add a depth buffer for offscreen UI pass
alelievr Sep 26, 2024
d651070
Fix misc shader warnings
remi-chapelain Sep 26, 2024
e1589f3
Post-migration step: remove the migrated URP docs files.
oleks-k Sep 27, 2024
bcf5a19
Expose Solid Angle culling mode in Ray Tracing Settings UI.
IonutNedelcuUnity Sep 27, 2024
17a09d5
[VFX] Better integration with HDRP Water Sample
PaulDemeulenaere Sep 27, 2024
c17e841
[VFX/Particle] DrawMeshNow artifact on M1
PaulDemeulenaere Sep 27, 2024
d15b717
Shader Warnings about GPU Driven are thrown after switching platform …
SuminCho1 Sep 27, 2024
892ec4f
Add STP Resource Stripping
gmitrano-unity Sep 27, 2024
9951bc2
[HDRP] [UUM-81586] Fixed uninitalized/unused shader warnings
mseonkim-unity Sep 27, 2024
751d678
[HDRP] remove double ensure frame settings for volumetric clouds
remi-chapelain Sep 27, 2024
2b712f6
add fourth composition option for HQ lines: before color pyramid but …
mikko-alaluusua-unity Sep 27, 2024
6cfbfeb
Revert NRP ReadOnlyStencil Flag Changes
gmitrano-unity Sep 27, 2024
d1dc056
Graphics/lighting/uum 79279
nanho-lee Sep 27, 2024
a61f7b2
update the rendergraph samples to the latest APIs and best practices
UnityAljosha Sep 27, 2024
448044d
[6000] Fix UUM-51358
kennytann Sep 27, 2024
4dcfc3e
Render Graph - Fix failing tests (using camera.Render and RenderGraph)
YohannVaastUnity Sep 28, 2024
bdf2fab
[URP] Fix lighting debug views when using APV with Shadowmask
pmavridis Sep 28, 2024
7a6bb71
Removed RGBM implementation from URP Bloom
AndrewSaraevUnity Sep 28, 2024
2196311
Disabled XR test instabilities
thomas-zeng Sep 30, 2024
2a81e2c
Add option to omit depth & movec write based on hair composite alpha
mikko-alaluusua-unity Sep 30, 2024
89e8162
Docs/graphics/docg 5742 water surface deformation buffer
ocarrere Sep 30, 2024
222bcd7
Fix several issues with cloud shadow clipping / volumetric cloud tracing
alelievr Sep 30, 2024
f77a520
Code cleanup in RTHandle allocators and small fixes
UnityAljosha Sep 30, 2024
df3adf7
Allow opening RGV but show a better message.
alex-vazquez-unity3d Sep 30, 2024
76c1ea1
Disable GPU Occlusion on Qualcomm GPUs in URP
gmitrano-unity Oct 2, 2024
bc639f0
Fix: Animated properties not updated in material UI
ApoorvaJ Oct 2, 2024
a6b3351
Fix legacy depthBufferBits usage in URP 2D and 3D renderer
UnityAljosha Oct 2, 2024
efe9c19
[URP] [Fantasy Kingdom Demo] Fix STP TAA Frame Index Mismatch
gmitrano-unity Oct 2, 2024
64c89c8
Fix NullReferenceException thrown when updating a legacy node for sec…
geunheepark-unity Oct 2, 2024
6fbc41d
Add AssetBundle/Addressable documentation for APV
markg-unity Oct 2, 2024
aae5c11
Docs/graphics/docg 5743 physically based sky custom material
ocarrere Oct 2, 2024
f2d9509
docg-5789-lens-flare-environment-occlusion
ocarrere Oct 2, 2024
fe6e57b
[HDRP] Add information for syncing multiple water surfaces in documen…
remi-chapelain Oct 3, 2024
82e159f
GFXFOUND-567 Unifiy RenderGraph Compiler with OpenGLES and OpenGL Core
RoseHirigoyen Oct 3, 2024
b273eaf
[SG] Update default heatmap values.
remi-chapelain Oct 3, 2024
95889e2
[URP Fantasy Kingdom] Remove Motion Vectors Depth Bias
Oct 7, 2024
f4531f3
[content automatically redacted] touching PlatformDependent folder
Olof-AV Oct 8, 2024
a47e579
Remove #if preprocessor wrapping the UniversalRenderPipelineRuntimeXR…
geunheepark-unity Oct 9, 2024
579d5ef
Docg 5744 local volumetric fog material sg
ocarrere Oct 9, 2024
e07fe45
Added custom render texture documentation
alelievr Oct 9, 2024
c162234
[Graphics Tools][HDRP Wizard] Multiple fixes and UI improvements.
alex-vazquez-unity3d Oct 9, 2024
0c6e1c6
[UUM-73635] Fix debug rendering error when rebaking APV with disk str…
seungwon-oh Oct 9, 2024
74ac240
Fix a bug that SG is reverted to its last saved state when entering P…
MinseokLee-Unity Oct 9, 2024
b444168
Fixed layer index out of range in LayeredLitGUI
mseonkim-unity Oct 9, 2024
62e5cff
Minor STP Documentation Fixes
Richard-Horton Oct 9, 2024
5587da7
Fix URP Camera Stacking, Renderscale, NaN and alpha related issues.
eh-unity Oct 9, 2024
8161f41
[SRP] Fixed Corrupted Sprites UUM-77168
jrs-unity Oct 10, 2024
b3eeb83
Fix upsampler settings not being shown on unsupported platforms
alelievr Oct 10, 2024
f798d6a
RenderGraph.AddBlitPass doesn't work correctly with texture array slices
Charles-H-Unity Oct 10, 2024
2666fb5
Enable the use of AllGlobals in the UIPass
raquelpeces Oct 10, 2024
48a6608
Downgrade UPM to 8.7.0
Oct 12, 2024
a7bac7f
[PS5, Metal] Fix shader errors due to Foveated Rendering
MinseokLee-Unity Oct 16, 2024
3f6ed56
Stencil-based cross-fade LOD
Oct 16, 2024
7c43aa4
Baking, then deleting baking set asset, then rebaking causes exceptio…
SuminCho1 Oct 16, 2024
144fe84
Fix for Overlay UI in RG + HDR + FXAA/FSR
antonella-sciarrillo Oct 16, 2024
74c26fe
[VFX] Fix Custom Attribute Sanitize
PaulDemeulenaere Oct 16, 2024
4cc637b
Cloud layer order - transparent depth prepass
ApoorvaJ Oct 16, 2024
59961d0
[content automatically redacted] touching PlatformDependent folder
juhomerj Oct 16, 2024
66adba2
Fix horizontal deformation with water system deformer
remi-chapelain Oct 16, 2024
6f09019
Fix broken links and formatting in Shader Graph docs (DOCATT-589 and …
PBU3D Oct 16, 2024
e054495
Update Terrain Test Project Image Refs and Version
atienn-unity Oct 16, 2024
5bdfad2
[2d] Add TexelSize as optional Init parameter
venkify Oct 16, 2024
291c205
Fix small GPUResidentDrawer bugs
vincent-breysse Oct 16, 2024
873c94f
Remove warning 'use of potentially uninitialized variable'
MinseokLee-Unity Oct 17, 2024
4cc9a9a
Set the internal execute method of custom passes to virtual
alelievr Oct 17, 2024
3eaca16
[VFX] Fix Sample Water Surface & CustomHLSL
PaulDemeulenaere Oct 17, 2024
c9d710a
HDRenderPipeline: Ensure custom post-process is disabled when post-pr…
amsXYZ Oct 17, 2024
40adebe
Fix UUM-72639
RemyUnity Oct 17, 2024
e23542b
HDRP: Ensure PROCEDURAL_INSTANCING_ON is not applied to sg compute ke…
amsXYZ Oct 17, 2024
ce03c04
Fix Lens Flare Data (SRP) documentation link UUM-84033
BenGraterUnity Oct 19, 2024
316a0fb
Remove assert in TextureDesc creation to avoid errors in Compatibilit…
UnityAljosha Oct 19, 2024
9932939
[VFX] Two Custom hlsl bug fixes
julienamsellem Oct 19, 2024
2786eff
Optimized load operation for XR final blit pass.
thomas-zeng Oct 19, 2024
43777d4
[UUM-84431] Fix Lens Flare not rendering properly in OpenGLES3
seungwon-oh Oct 21, 2024
e639fe7
[Unity 6][URP] Fixing unset CameraToWorld matrix in shadow caster pas…
ellioman Oct 21, 2024
2b2df1b
[UUM-78803] Implement Main Light Direction node on builtin
dhsavell Oct 21, 2024
6a42a15
[Unity 6.1][URP] Fixing tooltips (UUM-83534)
ellioman Oct 21, 2024
cbd97d5
[2d] Fix (Case UUM-83049) Use URP Material for Sprite for Standard UR…
venkify Oct 22, 2024
cdbbbe9
[SRPF] Fix an exception when delegate target is empty
kirill-titov-u Oct 22, 2024
c659b33
[VFX] Render last particle in particle outputs with strip data
gabrieldelacruz Oct 22, 2024
04c0d41
[Fix] Fix the GBuffer pass to write in RT4 in Render Graph mode
ludovic-theobald Oct 22, 2024
763b4a4
[UUM-84967] Make RenderGraphViewer script path lookup robust
Oct 22, 2024
7009d51
Fix APV compatability on GLES
pema99 Oct 22, 2024
55ec85b
Fix UUM-84029 Broken visual and spamming error in DepthBlit package s…
cinight Oct 23, 2024
2339c07
Add new manipulator for ShaderGraph MainPreview
seungchan-jeong Oct 23, 2024
6480a0e
Graphics: Apply dynamic_branch to Fog related keywords
karasusan Oct 23, 2024
8836fb1
[Unity 6][URP] Fixing an issue where ScreenSpaceShadows weren't worki…
ellioman Oct 23, 2024
c8024c9
[HDRP] Documentation for VFX Sample Water Surface node
remi-chapelain Oct 24, 2024
9e0d2d1
[SRP][Volume]Multiple fixes for being able to properly perform reset
RSlysz Oct 24, 2024
5c9bb5b
[VFX] Update URP test suite to use Render Graph
ludovic-theobald Oct 24, 2024
c742d0d
[HDRP] Add limitations to pathtracing documentation page
remi-chapelain Oct 24, 2024
688f79e
[6000.1][UUM-82787] Fix Rendergraph 2D shadow pass to remove low leve…
kennytann Oct 25, 2024
6c2b3ab
Fix division by 0, and sphere tile range calculation for forward plus.
Paulm-Unity Oct 25, 2024
24af3ab
Clarify URP 6 index page
markg-unity Oct 25, 2024
dced216
[UUM-78849] Add an option to include Custom Function Node source usin…
dhsavell Oct 26, 2024
55e30d4
Fix STP on GLCore Rendering Target
gmitrano-unity Oct 26, 2024
5414137
Disabling test on trunk
christian-sasseville Oct 26, 2024
8f132f4
Packages/com.unity.render-pipelines.high-definition@17.0/manual/Water…
ocarrere Oct 26, 2024
2d60034
[UUM-83764] Fix Game View flipping upside down when using HDR Debug Mode
seungwon-oh Oct 28, 2024
16a24ca
[HDRP] Add rolling wave sample scene to water sample
remi-chapelain Oct 28, 2024
6f499ef
Fix downsampled SSAO not using the correct resolution when the origin…
alelievr Oct 28, 2024
ab698f6
Remove vector truncation warning for SSAO
MinseokLee-Unity Oct 28, 2024
9a4152d
Projects with per-frame adjustments to certain parameters aren’t comp…
ocarrere Oct 29, 2024
34411b3
[HDRP] Fix shaders warning in console when building
remi-chapelain Oct 29, 2024
b4cc00e
[URP][Unity 6.1] Minor code cleanup of MainLightShadowCasterPass (UUM…
ellioman Oct 29, 2024
2413c43
[Render Graph Viewer]Minor fixes on side panels
alex-vazquez-unity3d Oct 30, 2024
a900239
Mark a shader graph dirty when 'Support VFX Graph' is toggled
MinseokLee-Unity Oct 30, 2024
d60a635
[UUM-84980] Fix wrong SSR when using a shader graph with a clear coat…
seungchan-jeong Oct 31, 2024
43973a4
[HDRP] Improve water decal workflow for older shapes (box, sphere, bo…
remi-chapelain Oct 31, 2024
ee86d1a
Minor docs fixes from feedback tickets
markg-unity Nov 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Custom Material Inspectors enable you to define how Unity displays properties in

The implementation for custom Material Inspectors differs between URP and HDRP. For example, for compatibility purposes, every custom Material Inspector in HDRP must inherit from `HDShaderGUI` which does not exist in URP. For information on how to create custom Material Inspectors for the respective render pipelines, see:

- **HDRP**: [HDRP custom Material Inspectors](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/hdrp-custom-material-inspector.html).
- **HDRP**: [HDRP custom Material Inspectors](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?subfolder=/manual/custom-material-inspectors.html).
- **URP**: [Unity Custom Shader GUI](https://docs.unity3d.com/Manual/SL-CustomShaderGUI.html).

## Assigning a custom Material Inspector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MyRenderPipeline : RenderPipeline

void InitializeRenderGraph()
{
m_RenderGraph = new RenderGraph(MyRenderGraph);
m_RenderGraph = new RenderGraph("MyRenderGraph");
}

void CleanupRenderGraph()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public HierarchicalSphere(Color baseColor, HierarchicalSphere parent = null)
/// <param name="filled">If true, also draw the surface of the hull's sphere</param>
public void DrawHull(bool filled)
{
if (Event.current.type != EventType.Repaint)
return;

Color wireframeColor = m_HandleColor;
wireframeColor.a = 0.8f;
using (new Handles.DrawingScope(m_WireframeColor, Matrix4x4.TRS((Vector3)Handles.matrix.GetColumn(3) + center, Quaternion.identity, Vector3.one)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ public HeaderFoldout() : base()
m_HelpButton.SetEnabled(!string.IsNullOrEmpty(m_DocumentationURL));
line.Add(m_HelpButton);

m_ContextMenuButton = new Button(Background.FromTexture2D(CoreEditorStyles.paneOptionsIcon), () => ShowMenu());
m_ContextMenuButton =
new Button(Background.FromTexture2D(CoreEditorStyles.paneOptionsIcon), () => ShowMenu())
{
style =
{
paddingRight = 2
}
};

m_ContextMenuButton.SetEnabled(m_ContextMenuGenerator != null);
line.Add(m_ContextMenuButton);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,12 +1233,16 @@ static void FixSeams(NativeArray<int> positionRemap, NativeArray<Vector3> positi
// The idea is to find first them and do a kind of dilation to smooth the values on the boundary
// the dilation process consits in doing a trilinear sample of the higher subdivision brick and override the lower subdiv with that
// We have to mark the probes on the boundary as valid otherwise leak reduction at runtime will interfere with this method
// This isn't perfect and also doesn't work on cell boundary, but could easily be fix if it's an issue



// Use an indirection structure to ensure mem usage stays reasonable
VoxelToBrickCache cache = new VoxelToBrickCache();

// Create a map from cell position to index for fast lookup across cells
var cellPositionToIndex = new Dictionary<Vector3Int, int>();
for (int i = 0; i < m_BakingBatch.cells.Count; i++)
cellPositionToIndex[m_BakingBatch.cells[i].position] = i;

for (int c = 0; c < m_BakingBatch.cells.Count; c++)
{
var cell = m_BakingBatch.cells[c];
Expand All @@ -1265,7 +1269,32 @@ static void FixSeams(NativeArray<int> positionRemap, NativeArray<Vector3> positi
Vector3Int voxel = Vector3Int.FloorToInt((pos - sampleOffset) / minBrickSize);
int hashCode = m_BakingBatch.GetBrickPositionHash(voxel);
if (!voxelToBrick.TryGetValue(hashCode, out var brick))
continue;
{
// If the brick was not found in the current cell, find it in the neighbouring cells
Vector3Int GetCellPositionFromVoxel(Vector3Int voxelToLookup, int cellSizeInBricks)
{
return new Vector3Int(
FloorDivide(voxelToLookup.x, cellSizeInBricks),
FloorDivide(voxelToLookup.y, cellSizeInBricks),
FloorDivide(voxelToLookup.z, cellSizeInBricks)
);
int FloorDivide(int a, int b) => a >= 0 ? a / b : (a - b + 1) / b;
}

// Find the position of the neighbouring cell that would contain the voxel
bool foundInOtherCell = false;
var cellToLookupPos = GetCellPositionFromVoxel(voxel, m_ProfileInfo.cellSizeInBricks);
if(cellPositionToIndex.TryGetValue(cellToLookupPos, out var cellIndex))
{
var currentCell = m_BakingBatch.cells[cellIndex];
var voxelToBrickNeighbouringCell = cache.GetMap(currentCell);
if (voxelToBrickNeighbouringCell.TryGetValue(hashCode, out brick))
foundInOtherCell = true;
}

if(!foundInOtherCell)
continue;
}

if (brick.subdivisionLevel > maxSubdiv)
largestBrick = brick;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ void UseTemporaryBakingSet(string sceneGUID, ProbeVolumeBakingSet set = null)
{
set = ScriptableObject.CreateInstance<ProbeVolumeBakingSet>();
set.SetDefaults();

ProbeReferenceVolume.instance.AddPendingSceneRemoval(sceneGUID);
}

EditorUtility.SetDirty(set);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void JumpFlooding(uint3 id : SV_DispatchThreadID)
o.x += (o.x < 0) ? _Size.x : 0;
o.y += (o.y < 0) ? _Size.x : 0;
o.z += (o.z < 0) ? _Size.x : 0;
float4 n1 = _Output[o];
float4 n1 = _Input[o];

// Discard invalid samples
if (n1.w < 0.5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static Rect GetRect(MaterialProperty prop)
public static void IntShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label, System.Func<int, int> transform = null)
{
MaterialEditor.BeginProperty(prop);
editor.BeginAnimatedCheck(prop);

EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = prop.hasMixedValue;
Expand All @@ -92,6 +93,7 @@ public static void IntShaderProperty(this MaterialEditor editor, MaterialPropert
prop.floatValue = newValue;
}

editor.EndAnimatedCheck();
MaterialEditor.EndProperty();
}

Expand All @@ -118,6 +120,7 @@ public static void IntSliderShaderProperty(this MaterialEditor editor, MaterialP
public static void IntSliderShaderProperty(this MaterialEditor editor, MaterialProperty prop, int min, int max, GUIContent label)
{
MaterialEditor.BeginProperty(prop);
editor.BeginAnimatedCheck(prop);

EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = prop.hasMixedValue;
Expand All @@ -129,6 +132,7 @@ public static void IntSliderShaderProperty(this MaterialEditor editor, MaterialP
prop.floatValue = newValue;
}

editor.EndAnimatedCheck();
MaterialEditor.EndProperty();
}

Expand All @@ -142,6 +146,7 @@ public static void IntSliderShaderProperty(this MaterialEditor editor, MaterialP
public static void MinFloatShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label, float min)
{
MaterialEditor.BeginProperty(prop);
editor.BeginAnimatedCheck(prop);

EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = prop.hasMixedValue;
Expand All @@ -151,6 +156,7 @@ public static void MinFloatShaderProperty(this MaterialEditor editor, MaterialPr
if (EditorGUI.EndChangeCheck())
prop.floatValue = newValue;

editor.EndAnimatedCheck();
MaterialEditor.EndProperty();
}

Expand All @@ -163,6 +169,7 @@ public static void MinFloatShaderProperty(this MaterialEditor editor, MaterialPr
public static void Vector3ShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label)
{
MaterialEditor.BeginProperty(prop);
editor.BeginAnimatedCheck(prop);

EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = prop.hasMixedValue;
Expand All @@ -171,6 +178,7 @@ public static void Vector3ShaderProperty(this MaterialEditor editor, MaterialPro
if (EditorGUI.EndChangeCheck())
prop.vectorValue = vector;

editor.EndAnimatedCheck();
MaterialEditor.EndProperty();
}

Expand All @@ -185,6 +193,7 @@ public static void Vector3ShaderProperty(this MaterialEditor editor, MaterialPro
public static int PopupShaderProperty(this MaterialEditor editor, MaterialProperty prop, GUIContent label, string[] displayedOptions)
{
MaterialEditor.BeginProperty(prop);
editor.BeginAnimatedCheck(prop);

int val = (int)prop.floatValue;

Expand All @@ -198,6 +207,7 @@ public static int PopupShaderProperty(this MaterialEditor editor, MaterialProper
prop.floatValue = val = newValue;
}

editor.EndAnimatedCheck();
MaterialEditor.EndProperty();

return val;
Expand All @@ -215,6 +225,7 @@ public static int PopupShaderProperty(this MaterialEditor editor, MaterialProper
public static int IntPopupShaderProperty(this MaterialEditor editor, MaterialProperty prop, string label, string[] displayedOptions, int[] optionValues)
{
MaterialEditor.BeginProperty(prop);
editor.BeginAnimatedCheck(prop);

int val = (int)prop.floatValue;

Expand All @@ -228,6 +239,7 @@ public static int IntPopupShaderProperty(this MaterialEditor editor, MaterialPro
prop.floatValue = val = newValue;
}

editor.EndAnimatedCheck();
MaterialEditor.EndProperty();

return val;
Expand All @@ -246,6 +258,8 @@ public static void MinMaxShaderProperty(this MaterialEditor editor, MaterialProp
{
MaterialEditor.BeginProperty(min);
MaterialEditor.BeginProperty(max);
editor.BeginAnimatedCheck(min);
editor.BeginAnimatedCheck(max);

float minValue = min.floatValue;
float maxValue = max.floatValue;
Expand All @@ -257,6 +271,8 @@ public static void MinMaxShaderProperty(this MaterialEditor editor, MaterialProp
max.floatValue = maxValue;
}

editor.EndAnimatedCheck();
editor.EndAnimatedCheck();
MaterialEditor.EndProperty();
MaterialEditor.EndProperty();
}
Expand All @@ -272,6 +288,7 @@ public static void MinMaxShaderProperty(this MaterialEditor editor, MaterialProp
public static void MinMaxShaderProperty(this MaterialEditor editor, MaterialProperty remapProp, float minLimit, float maxLimit, GUIContent label)
{
MaterialEditor.BeginProperty(remapProp);
editor.BeginAnimatedCheck(remapProp);

Vector2 remap = remapProp.vectorValue;

Expand All @@ -280,6 +297,7 @@ public static void MinMaxShaderProperty(this MaterialEditor editor, MaterialProp
if (EditorGUI.EndChangeCheck())
remapProp.vectorValue = remap;

editor.EndAnimatedCheck();
MaterialEditor.EndProperty();
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using UnityEngine;
using System;
using UnityEngine.Rendering;
using System.Text;

namespace UnityEditor.Rendering
{
Expand Down Expand Up @@ -64,7 +65,6 @@ public string NewShaderPath
List<string> m_TexturesToRemove = new List<string>();
Dictionary<string, Texture> m_TexturesToSet = new Dictionary<string, Texture>();


class KeywordFloatRename
{
public string keyword;
Expand Down Expand Up @@ -357,6 +357,72 @@ static bool ShouldUpgradeShader(Material material, HashSet<string> shaderNamesTo
return !shaderNamesToIgnore.Contains(material.shader.name);
}

/// <summary>
/// Check if the materials in the list are variants of upgradable materials, and logs a infomative message to the user..
/// </summary>
/// <param name="materialGUIDs">Array of materials GUIDs.</param>
/// <param name="upgraders">List or available upgraders.</param>
static void LogMaterialVariantMessage(string[] materialGUIDs, List<MaterialUpgrader> upgraders)
{
List<Material> materials = new List<Material>();
foreach (var guid in materialGUIDs)
materials.Add(AssetDatabase.LoadAssetAtPath<Material>(AssetDatabase.GUIDToAssetPath(guid)));

LogMaterialVariantMessage(materials, upgraders);
}

/// <summary>
/// Check if the materials in the list are variants of upgradable materials, and logs a infomative message to the user..
/// </summary>
/// <param name="objects">Array of objects.</param>
/// <param name="upgraders">List or available upgraders.</param>
static void LogMaterialVariantMessage(UnityEngine.Object[] objects, List<MaterialUpgrader> upgraders)
{
Material mat;
List<Material> materials = new List<Material>();
for (int i = 0; i<objects.Length; i++)
{
mat = objects[i] as Material;
if (mat != null)
materials.Add(mat);
}

LogMaterialVariantMessage(materials, upgraders);
}

/// <summary>
/// Check if the materials in the list are variants of upgradable materials, and logs a infomative message to the user..
/// </summary>
/// <param name="materials">List of materials.</param>
/// <param name="upgraders">List or available upgraders.</param>
static void LogMaterialVariantMessage(List<Material> materials, List<MaterialUpgrader> upgraders)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Can not upgrade Material Variants, the following assets were skipped:");
bool needsLogging = false;

Material rootMaterial;

foreach (Material material in materials)
{
if (material.isVariant)
{
rootMaterial = material;
while (rootMaterial.isVariant)
rootMaterial = rootMaterial.parent;

if (GetUpgrader(upgraders, rootMaterial) != null)
{
needsLogging = true;
sb.AppendLine($"- <a href=\"{AssetDatabase.GetAssetPath(material)}\" >{material.name}</a>, variant of {material.parent.name} with shader {rootMaterial.shader.name}.");
}
}
}

if (needsLogging)
Debug.Log(sb.ToString(), null);
}


private static bool IsNotAutomaticallyUpgradable(List<MaterialUpgrader> upgraders, Material material)
{
Expand Down Expand Up @@ -407,6 +473,8 @@ public static void UpgradeProjectFolder(List<MaterialUpgrader> upgraders, HashSe
var materialAssets = AssetDatabase.FindAssets($"t:{nameof(Material)} glob:\"**/*.mat\"");
int materialIndex = 0;

LogMaterialVariantMessage(materialAssets, upgraders);

foreach (var guid in materialAssets)
{
Material material = AssetDatabase.LoadAssetAtPath<Material>(AssetDatabase.GUIDToAssetPath(guid));
Expand All @@ -417,6 +485,9 @@ public static void UpgradeProjectFolder(List<MaterialUpgrader> upgraders, HashSe
if (!ShouldUpgradeShader(material, shaderNamesToIgnore))
continue;

if (material.isVariant)
continue;

Upgrade(material, upgraders, flags);

}
Expand Down Expand Up @@ -524,10 +595,13 @@ public static void UpgradeSelection(List<MaterialUpgrader> upgraders, HashSet<st
}

List<Material> selectedMaterials = new List<Material>(selection.Length);

LogMaterialVariantMessage(selection, upgraders);

for (int i = 0; i < selection.Length; ++i)
{
Material mat = selection[i] as Material;
if (mat != null)
if (mat != null && !mat.isVariant)
selectedMaterials.Add(mat);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void OnEnable()

if (m_PreviewTexture == null)
{
m_PreviewTexture = RTHandles.Alloc(Styles.thumbnailSizeWidth, Styles.thumbnailSizeHeight, colorFormat: UnityEngine.Experimental.Rendering.GraphicsFormat.R8G8B8A8_SRGB);
m_PreviewTexture = RTHandles.Alloc(Styles.thumbnailSizeWidth, Styles.thumbnailSizeHeight, UnityEngine.Experimental.Rendering.GraphicsFormat.R8G8B8A8_SRGB);
}
if (m_PreviewTextureCache == null)
{
Expand Down
Loading
Loading