Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal/master #7521

Merged
merged 39 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b0b760e
[YAMATO][HDRP] Divided HDRP playmode test run time by two.
JulienIgnace-Unity Jun 15, 2022
e55505a
New iteration on the water system.
anisunity Jun 15, 2022
b9601b7
[RND-175][URP-964] SSAO Improvements
ellioman Jun 15, 2022
db55fe7
MTT-1785 Marked player settings BuildTargetGroup API as obsolete
cdmazom Jun 15, 2022
62cc093
[URP] Render Graph hotfixes (v2)
jonuuukas Jun 15, 2022
955a832
[URP][2D] Fix vertex color for Sprite Shapes in default URP shaders a…
kennytann Jun 22, 2022
883dd15
[HDRP] Updates to Diffusion profiles handling
adrien-de-tocqueville Jun 22, 2022
61df766
[URP][2D] Fix bug where render target is incorrect when post process …
kennytann Jun 22, 2022
0b1571d
Rendering Layers
lukaschod Jun 22, 2022
a5d317d
Deprecated DrawX commands on the SRPContext + Updated URP&HDRP (v2)
debaetsd Jun 22, 2022
f529672
Changed ACES luminance fit to allow pure whites
sebastienlagarde Jun 22, 2022
e76b183
URP Automatic Alpha-To-Coverage Regression Fixes
gmitrano-unity Jun 22, 2022
46f4136
[URP] Depth Priming + DepthNormalsPass + MSAA fix
manuele-bonanno Jun 22, 2022
6c4197e
Significant improvements to TAA ghosting, added control for jitter sc…
FrancescoC-unity Jun 22, 2022
3b27c69
[Fogbugz 1375978, 1413534] Fixed pb dof artifacts
pmavridis Jun 22, 2022
5e9057a
[VFX] Update Cube Mesh Test
PaulDemeulenaere Jun 22, 2022
e454c59
[Fogbugz # 1423890] Virtual Texturing feedback support feedback for t…
kecho Jun 22, 2022
180c3cf
Fix incorrect use of half for lighting attenuation.
eh-unity Jun 28, 2022
7529e50
[URP] Fixing broken Foundation tests on iPhone
ellioman Jun 28, 2022
f3de423
Add debug view for Motion Vector Intensities
FrancescoC-unity Jun 28, 2022
e26054d
[HDRP] Fix compile error on certain platforms that load the denoising…
pmavridis Jun 28, 2022
fdfd800
[URP] MSAA Swapbuffer fix for Post-processing (v2)
jonuuukas Jun 28, 2022
c38dda0
[23.1][URP][2D] Fix Light2D upgrading issue with m_AlphaBlendOnOverla…
kennytann Jun 28, 2022
82c5374
Fix explicit precision texture declaration macros to emit Texture2D<h…
joravainen Jun 28, 2022
ddf46a2
[URP] Moving the Render Graph toggle from Global Settings to the URP …
manuele-bonanno Jun 28, 2022
24102a0
Public Api doc improvements for URP, 2D URP and Core
ellioman Jun 28, 2022
3a97459
Add Apple Silicon reference images for URP test projects
theopnv Jun 28, 2022
aee83ab
[HDRP] bunch of bug fixes for HDRP (version 5)
sebastienlagarde Jun 28, 2022
1f501a7
Bump graphics packages to 15.0.0
theopnv Jun 28, 2022
76a5e5a
Fix HDRP Yamato issues
sebastienlagarde Jun 28, 2022
d8e5463
[HDRP] quality Review HDRP doc by doc team - 2 - bis
sebastienlagarde Jun 28, 2022
f26d188
[URP] PostPro project: Adding a #if check for XRSettings conditional …
ellioman Jun 28, 2022
7ba7cdf
[VFX] Fix MotionVector with TargetOffset
PaulDemeulenaere Jun 28, 2022
8eb03c2
[URP][RenderGraph] Added URP postfx passes to URP Render Graph (v5)
thomas-zeng Jun 28, 2022
c5ab2fd
[RPW] Tooltips improvement
kirill-titov-u Jun 28, 2022
0e80090
Add .buginfo files to URP folders
pbbastian Jun 28, 2022
043969f
[HDRP] Always use diffusion profiles in previews
adrien-de-tocqueville Jun 28, 2022
9ae0537
[RPW] Allow shader from HDRP and URP correctly fallback to error shader
kirill-titov-u Jun 28, 2022
ba30079
A error is thrown when creating an Output Particle Lit Decal
julienamsellem Jun 28, 2022
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
Prev Previous commit
Next Next commit
Add debug view for Motion Vector Intensities
Add a debug view to be able to visualize motion vectors intensities. The standard debug view is a bit hard to read w.r.t intensities. 

https://fogbugz.unity3d.com/f/cases/1430303/

![2022-05-24_14-25-31](https://media.github.cds.internal.unity3d.com/user/582/files/c788eb2f-144c-400c-8f9a-aa296c7b1e45)
  • Loading branch information
FrancescoC-unity committed Jun 28, 2022
commit f3de423768af491f19725e1e3b871c8e0f9c80dd
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public enum FullScreenDebugMode
MinRenderingFullScreenDebug,
/// <summary>Display Motion Vectors.</summary>
MotionVectors,
/// <summary>Display Motion Vectors Intensity.</summary>
MotionVectorsIntensity,
/// <summary>Display NaNs.</summary>
NanTracker,
/// <summary>Display Log of the color buffer.</summary>
Expand Down Expand Up @@ -317,6 +319,10 @@ public partial class DebugData

/// <summary>Minimum length a motion vector needs to be to be displayed in the debug display. Unit is pixels.</summary>
public float minMotionVectorLength = 0.0f;
/// <summary>The scale to apply to motion vector lengths (in Normalized Device Coordinates) to be applied before display.</summary>
public float motionVecVisualizationScale = 40.0f;
/// <summary>Whether to visualize motion vector intensity as heat map or greyscale (if off).</summary>
public bool motionVecIntensityHeat = false;


// TODO: The only reason this exist is because of Material/Engine debug enums
Expand Down Expand Up @@ -1832,12 +1838,22 @@ void RegisterRenderingDebug()
{
widgetList.Add(new DebugUI.Container
{
isHiddenCallback = () => data.fullScreenDebugMode != FullScreenDebugMode.MotionVectors,
isHiddenCallback = () => (data.fullScreenDebugMode != FullScreenDebugMode.MotionVectors || data.fullScreenDebugMode != FullScreenDebugMode.MotionVectorsIntensity),
children =
{
new DebugUI.FloatField {displayName = "Min Motion Vector Length (in pixels)", getter = () => data.minMotionVectorLength, setter = value => data.minMotionVectorLength = value, min = () => 0}
}
});
widgetList.Add(new DebugUI.Container
{
isHiddenCallback = () => (data.fullScreenDebugMode != FullScreenDebugMode.MotionVectorsIntensity),
children =
{
new DebugUI.FloatField {displayName = "Motion Vector Scale", getter = () => data.motionVecVisualizationScale, setter = value => data.motionVecVisualizationScale = value, min = () => 0},
new DebugUI.BoolField {displayName = "Visualize as Heat map", getter = () => data.motionVecIntensityHeat, setter = value => data.motionVecIntensityHeat = value }
}
});

}

widgetList.AddRange(new DebugUI.Widget[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,21 @@
#define FULLSCREENDEBUGMODE_MAX_LIGHTING_FULL_SCREEN_DEBUG (21)
#define FULLSCREENDEBUGMODE_MIN_RENDERING_FULL_SCREEN_DEBUG (22)
#define FULLSCREENDEBUGMODE_MOTION_VECTORS (23)
#define FULLSCREENDEBUGMODE_NAN_TRACKER (24)
#define FULLSCREENDEBUGMODE_COLOR_LOG (25)
#define FULLSCREENDEBUGMODE_DEPTH_OF_FIELD_COC (26)
#define FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW (27)
#define FULLSCREENDEBUGMODE_QUAD_OVERDRAW (28)
#define FULLSCREENDEBUGMODE_VERTEX_DENSITY (29)
#define FULLSCREENDEBUGMODE_REQUESTED_VIRTUAL_TEXTURE_TILES (30)
#define FULLSCREENDEBUGMODE_LENS_FLARE_DATA_DRIVEN (31)
#define FULLSCREENDEBUGMODE_MAX_RENDERING_FULL_SCREEN_DEBUG (32)
#define FULLSCREENDEBUGMODE_MIN_MATERIAL_FULL_SCREEN_DEBUG (33)
#define FULLSCREENDEBUGMODE_VALIDATE_DIFFUSE_COLOR (34)
#define FULLSCREENDEBUGMODE_VALIDATE_SPECULAR_COLOR (35)
#define FULLSCREENDEBUGMODE_MAX_MATERIAL_FULL_SCREEN_DEBUG (36)
#define FULLSCREENDEBUGMODE_WORLD_SPACE_POSITION (37)
#define FULLSCREENDEBUGMODE_MOTION_VECTORS_INTENSITY (24)
#define FULLSCREENDEBUGMODE_NAN_TRACKER (25)
#define FULLSCREENDEBUGMODE_COLOR_LOG (26)
#define FULLSCREENDEBUGMODE_DEPTH_OF_FIELD_COC (27)
#define FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW (28)
#define FULLSCREENDEBUGMODE_QUAD_OVERDRAW (29)
#define FULLSCREENDEBUGMODE_VERTEX_DENSITY (30)
#define FULLSCREENDEBUGMODE_REQUESTED_VIRTUAL_TEXTURE_TILES (31)
#define FULLSCREENDEBUGMODE_LENS_FLARE_DATA_DRIVEN (32)
#define FULLSCREENDEBUGMODE_MAX_RENDERING_FULL_SCREEN_DEBUG (33)
#define FULLSCREENDEBUGMODE_MIN_MATERIAL_FULL_SCREEN_DEBUG (34)
#define FULLSCREENDEBUGMODE_VALIDATE_DIFFUSE_COLOR (35)
#define FULLSCREENDEBUGMODE_VALIDATE_SPECULAR_COLOR (36)
#define FULLSCREENDEBUGMODE_MAX_MATERIAL_FULL_SCREEN_DEBUG (37)
#define FULLSCREENDEBUGMODE_WORLD_SPACE_POSITION (38)

// Generated from UnityEngine.Rendering.HighDefinition.ShaderVariablesDebugDisplay
// PackingRules = Exact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ Shader "Hidden/HDRP/DebugFullScreen"
uint _DebugContactShadowLightIndex;
int _DebugDepthPyramidMip;
float _MinMotionVector;
float4 _MotionVecIntensityParams;
CBUFFER_END

#define _MotionVecIntensityScale _MotionVecIntensityParams.x
#define _MotionVecHeatMode _MotionVecIntensityParams.y

TEXTURE2D_X(_DebugFullScreenTexture);

struct Attributes
Expand Down Expand Up @@ -148,11 +152,16 @@ Shader "Hidden/HDRP/DebugFullScreen"
{
float2 motionVectorNDC;
DecodeMotionVector(SAMPLE_TEXTURE2D_X(_DebugFullScreenTexture, s_point_clamp_sampler, coords), motionVectorNDC);

return motionVectorNDC;
}
// end motion vector utilties

float3 ToHeat(float value)
{
float3 r = value * 2.1f - float3(1.8f, 1.14f, 0.3f);
return 1.0f - r * r;
}

float4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
Expand Down Expand Up @@ -223,6 +232,17 @@ Shader "Hidden/HDRP/DebugFullScreen"
{
return SAMPLE_TEXTURE2D_X(_DebugFullScreenTexture, s_point_clamp_sampler, input.texcoord);
}
if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_MOTION_VECTORS_INTENSITY)
{
float2 mv = SampleMotionVectors(input.texcoord);
float mvLen = length(mv) * _MotionVecIntensityScale;

if (_MotionVecHeatMode)
return float4(ToHeat(saturate(mvLen)), 1);

return float4(mvLen.xxx, 1);

}
if (_FullScreenDebugMode == FULLSCREENDEBUGMODE_MOTION_VECTORS)
{
float2 mv = SampleMotionVectors(input.texcoord);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ TextureHandle ResolveFullScreenDebug(RenderGraph renderGraph, TextureHandle inpu
mpb.SetFloat(HDShaderIDs._QuadOverdrawMaxQuadCost, (float)data.debugDisplaySettings.data.maxQuadCost);
mpb.SetFloat(HDShaderIDs._VertexDensityMaxPixelCost, (float)data.debugDisplaySettings.data.maxVertexDensity);
mpb.SetFloat(HDShaderIDs._MinMotionVector, data.debugDisplaySettings.data.minMotionVectorLength);
mpb.SetVector(HDShaderIDs._MotionVecIntensityParams, new Vector4(data.debugDisplaySettings.data.motionVecVisualizationScale, data.debugDisplaySettings.data.motionVecIntensityHeat ? 1 : 0, 0, 0));

if (fullscreenBuffer != null)
ctx.cmd.SetRandomWriteTarget(1, fullscreenBuffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ void RecordRenderGraph(RenderRequest renderRequest,

// We push the motion vector debug texture here as transparent object can overwrite the motion vector texture content.
if (m_Asset.currentPlatformRenderPipelineSettings.supportMotionVectors)
{
PushFullScreenDebugTexture(m_RenderGraph, prepassOutput.resolvedMotionVectorsBuffer, FullScreenDebugMode.MotionVectors, fullScreenDebugFormat);
PushFullScreenDebugTexture(m_RenderGraph, prepassOutput.resolvedMotionVectorsBuffer, FullScreenDebugMode.MotionVectorsIntensity, fullScreenDebugFormat);
}

// Transparent objects may write to the depth and motion vectors buffers.
if (aovRequest.isValid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ static class HDShaderIDs
public static readonly int _QuadOverdrawMaxQuadCost = Shader.PropertyToID("_QuadOverdrawMaxQuadCost");
public static readonly int _VertexDensityMaxPixelCost = Shader.PropertyToID("_VertexDensityMaxPixelCost");
public static readonly int _MinMotionVector = Shader.PropertyToID("_MinMotionVector");
public static readonly int _MotionVecIntensityParams = Shader.PropertyToID("_MotionVecIntensityParams");
public static readonly int _CustomDepthTexture = Shader.PropertyToID("_CustomDepthTexture");
public static readonly int _CustomColorTexture = Shader.PropertyToID("_CustomColorTexture");
public static readonly int _CustomPassInjectionPoint = Shader.PropertyToID("_CustomPassInjectionPoint");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
Expand All @@ -119,7 +119,7 @@ NavMeshSettings:
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
Expand Down Expand Up @@ -178,7 +178,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 2
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
Expand Down Expand Up @@ -233,7 +233,7 @@ PrefabInstance:
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: m_Version
value: 8
value: 9
objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
Expand Down Expand Up @@ -276,7 +276,9 @@ PrefabInstance:
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
--- !u!1 &1167715396
GameObject:
Expand Down Expand Up @@ -358,7 +360,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
settingType: 2
gBuffer: 0
fullScreenDebugMode: 28
fullScreenDebugMode: 29
lightlayers: 1
lightingFullScreenDebugMode: 0
lightingFullScreenDebugRTASView: 0
Expand Down Expand Up @@ -429,19 +431,20 @@ MonoScript:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
serializedVersion: 5
m_Script:
serializedVersion: 7
m_DefaultReferences: {}
m_Icon: {fileID: 0}
m_Type: 2
m_ExecutionOrder: 0
m_ClassName: SceneObjectIDMapSceneAsset
m_Namespace: UnityEngine.Rendering.HighDefinition
m_AssemblyName:
--- !u!1001 &3665263686398338102
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 2
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3665263687029777982, guid: 556fe575b9949c54ca6acb7e9703f987,
Expand Down Expand Up @@ -505,5 +508,7 @@ PrefabInstance:
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 556fe575b9949c54ca6acb7e9703f987, type: 3}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
Expand All @@ -119,7 +119,7 @@ NavMeshSettings:
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
Expand Down Expand Up @@ -178,7 +178,7 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 2
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
Expand Down Expand Up @@ -233,7 +233,7 @@ PrefabInstance:
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: m_Version
value: 8
value: 9
objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
Expand Down Expand Up @@ -276,7 +276,9 @@ PrefabInstance:
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
--- !u!1 &1167715396
GameObject:
Expand Down Expand Up @@ -358,7 +360,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
settingType: 2
gBuffer: 0
fullScreenDebugMode: 29
fullScreenDebugMode: 30
lightlayers: 1
lightingFullScreenDebugMode: 0
lightingFullScreenDebugRTASView: 0
Expand Down Expand Up @@ -429,19 +431,20 @@ MonoScript:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
serializedVersion: 5
m_Script:
serializedVersion: 7
m_DefaultReferences: {}
m_Icon: {fileID: 0}
m_Type: 2
m_ExecutionOrder: 0
m_ClassName: SceneObjectIDMapSceneAsset
m_Namespace: UnityEngine.Rendering.HighDefinition
m_AssemblyName:
--- !u!1001 &1842346692
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 2
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3665263687029777982, guid: 556fe575b9949c54ca6acb7e9703f987,
Expand Down Expand Up @@ -505,5 +508,7 @@ PrefabInstance:
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 556fe575b9949c54ca6acb7e9703f987, type: 3}