Skip to content

Merge Hd/bugfix #5222

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

Merged
merged 90 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
5945333
[HDRP] Fix AxF debug output in certain configurations (#4641)
pmavridis May 26, 2021
64a6c13
Fix SSR accumulation white flash (#4648)
FrancescoC-unity May 26, 2021
f49b710
Display Info Box when MSAA + ray tracing is onr (#4627)
FrancescoC-unity May 26, 2021
05cc16a
Fix distortion when resizing the window in player builds with the Gra…
pmavridis May 28, 2021
2325e3f
Add support for the camera bridge in the graphics compositor (#4599)
pmavridis May 28, 2021
c09379f
Merge branch 'master' into hd/bugfix
sebastienlagarde May 28, 2021
b5962c9
Fix Jittered Project Matrix Infinite Far Clip Plane (#4638)
johnpars May 29, 2021
77b6b7f
Fixed a memory leak related to not disposing of the RTAS at the end H…
anisunity May 29, 2021
bf941a9
Fix custom pass utils Blur + Copy overdraw. (#4623)
alelievr May 29, 2021
806dfbe
Fix draw procedural invalid pass idx 1 on first template load (#4632)
FrancescoC-unity May 29, 2021
88779ea
Changed light reset to preserve type (#4624)
adrien-de-tocqueville May 29, 2021
30fffd5
Revert "Add support for the camera bridge in the graphics compositor …
sebastienlagarde May 29, 2021
aabbb4b
AxF carpaint: Fix a compilation issue on Vulkan until the cpp HLSLcc …
slunity May 29, 2021
dfdb311
Revert "Revert "Add support for the camera bridge in the graphics com…
sebastienlagarde May 29, 2021
891fda0
revert: Fix distortion when resizing the window in player builds with…
sebastienlagarde May 29, 2021
7b17e06
Merge branch 'master' into hd/bugfix
sebastienlagarde May 29, 2021
32df1bf
Merge branch 'master' into hd/bugfix
sebastienlagarde May 29, 2021
8fd1108
Fixed the ray traced sub subsurface scattering debug mode not display…
anisunity May 29, 2021
0032b9c
Fix for discrepancies in saturation and intensity between screen spac…
FrancescoC-unity May 29, 2021
41716f0
Fix a Divide-by-Zero Warning for some Anisotropic Models (Fabric, Lit…
johnpars May 29, 2021
333c800
[HDRP] Fix VfX lit particle AOV output color space (#4646)
pmavridis May 29, 2021
809316c
[HDRP][Path Tracing] Fixed transparent unlit (#4605)
eturquin May 31, 2021
7b1ad29
Merge branch 'master' into hd/bugfix
sebastienlagarde May 31, 2021
08a578d
Fix distortion with MSAA (#4711)
sebastienlagarde May 31, 2021
3c418c0
Fix contact shadow debug views (#4720)
FrancescoC-unity May 31, 2021
352f65d
Update Decal-Projector.md (#4695)
adrien-de-tocqueville May 31, 2021
acc5073
[HDRP] Fixed nullref when deleting the texture asset assigned in a lo…
alelievr May 31, 2021
fd54a00
Merge branch 'master' into hd/bugfix
sebastienlagarde May 31, 2021
1672dc6
Fix decal layer enum (#4753)
sebastienlagarde Jun 2, 2021
c40c5c5
Fix typo
sebastienlagarde Jun 3, 2021
b443d6e
Fixed reflection probes being injected into the ray tracing light clu…
anisunity Jun 7, 2021
bc1d498
Ignore hybrid duplicated reflection probes during light baking (#4663)
adrien-de-tocqueville Jun 7, 2021
99bc6fd
Fix double sided option moving when toggling it in the material UI (#…
alelievr Jun 7, 2021
4a184af
Merge branch 'master' into hd/bugfix
sebastienlagarde Jun 7, 2021
d2368ba
Fix formatting
sebastienlagarde Jun 7, 2021
e5521be
Merge branch 'master' into hd/bugfix
sebastienlagarde Jun 7, 2021
97a953e
Fix volumetric fog in planar reflections (#4736)
FrancescoC-unity Jun 7, 2021
419850b
Fix motion blur compute dispatch size (#4737)
adrien-de-tocqueville Jun 7, 2021
fc7efde
- Updated the recursive rendering documentation (case 1338639). (#4759)
anisunity Jun 7, 2021
ca93d88
Fix issue with OnDemand directional shadow map being corrupted when r…
FrancescoC-unity Jun 7, 2021
c674c41
Fix cropping issue with the compositor camera bridge (#4802)
pmavridis Jun 7, 2021
e47a172
Fix for unused resources in depth of field (#4796)
Adrian1066 Jun 8, 2021
131d1cd
Merge branch 'master' into hd/bugfix
sebastienlagarde Jun 8, 2021
666d37f
Merge branch 'master' into hd/bugfix
sebastienlagarde Jun 9, 2021
61518ea
Removing the word Radii from exposure settings (#4854)
FrancescoC-unity Jun 9, 2021
85ebbc2
[HDRP][Path Tracing] Support for shadow mattes (#4745)
eturquin Jun 10, 2021
ad127f5
Revert "[HDRP][Path Tracing] Support for shadow mattes (#4745)"
sebastienlagarde Jun 10, 2021
2c08712
Fixed the transparent cutoff not working properly in semi-transparent…
anisunity Jun 10, 2021
83ddbed
Use non jittered projection in outline pass (#4836)
adrien-de-tocqueville Jun 10, 2021
2d9d391
[HDRP][Path Tracing] Sky settings now properly taken into account whe…
eturquin Jun 10, 2021
30cbb05
Fix Resolution Issues for Physically Based Depth of Field (#4848)
johnpars Jun 14, 2021
5c6b711
Fixed bug introduced by sky-for-recorder support. (#4906)
eturquin Jun 14, 2021
3cb7354
[Fogbugz 1341576] Memory leaks when the player is paused, and the use…
kecho Jun 15, 2021
1ee6c2d
Merge branch 'master' into hd/bugfix
sebastienlagarde Jun 16, 2021
7615d7b
[HDRP] Fixed shadergraph double save (#4916)
alelievr Jun 16, 2021
be0e48e
Merge master
sebastienlagarde Jun 16, 2021
30135ea
Write 0 instead of micro sized motion vectors + fix extremely fast ve…
FrancescoC-unity Jun 16, 2021
df51161
[HDRP] Fix material upgrader (#4821)
alelievr Jun 16, 2021
2bc152b
[HDRP] Fix custom pass volume not executed in scene view (#4860)
alelievr Jun 16, 2021
bac78c1
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
JulienIgnace-Unity Jun 17, 2021
b0442c6
Fix reflection probe tootltip (#4890)
adrien-de-tocqueville Jun 17, 2021
51af23d
Updated the Physically Based Sky documentation for baked lights (#4891)
adrien-de-tocqueville Jun 17, 2021
7f5b564
Fixed remapping of depth pyramid debug (#4893)
JulienIgnace-Unity Jun 17, 2021
24b3ea9
Fix wobble-like (or tearing-like) SSAO issues when temporal reproject…
FrancescoC-unity Jun 17, 2021
3f2772b
Fix Asymmetric Projection Matrices and Fog / Pathtracing (#4926)
johnpars Jun 17, 2021
4d1c13c
Merge branch 'master' into hd/bugfix
sebastienlagarde Jun 17, 2021
0bc3a8b
Merge master
sebastienlagarde Jun 18, 2021
0833363
Revert: Fix wobble-like (or tearing-like) SSAO issues when temporal r…
sebastienlagarde Jun 18, 2021
b307e87
Merge branch 'master' into hd/bugfix
sebastienlagarde Jun 18, 2021
2f4a545
Fix GBuffer depth debug mode (#5054)
adrien-de-tocqueville Jul 6, 2021
1772558
Fixed Volume Gizmo size when rescaling parent GameObject (#4915)
adrien-de-tocqueville Jul 8, 2021
d88d1eb
Fix Vertex Color Mode documentation (#4976)
adrien-de-tocqueville Jul 8, 2021
6692daf
Merge master
sebastienlagarde Jul 8, 2021
8ef3637
Fix wobble-like (or tearing-like) SSAO issues when temporal reproject…
FrancescoC-unity Jul 8, 2021
5dd669e
Fix formatting in NestedOverrideCameraRendering
sebastienlagarde Jul 8, 2021
a299cb8
[HDRP] Fix white flash with SSR when resetting camera history (#5089)
pmavridis Jul 9, 2021
8c39e99
[Fobguz # 1348357] VFX Particle templates missing stencil flags (#5080)
kecho Jul 9, 2021
c5dd9c6
Merge branch 'master' into hd/bugfix
sebastienlagarde Jul 12, 2021
df294f7
Fix object disappearing from lookdev (#5063)
alelievr Jul 13, 2021
ce1f22a
merge master
sebastienlagarde Jul 13, 2021
ae9e7a6
[HDRP] Fix render object after taa jittering (#5088)
alelievr Jul 13, 2021
883197e
Fix GC alloc in hd/bugfix branch (#5134)
alelievr Jul 13, 2021
eeb2ce5
Fix refraction tile artifacts near reflection probe edges (#4727)
FrancescoC-unity Jul 13, 2021
feb034c
Fix camera rotation uncontrollable with low framerate (#5076)
alelievr Jul 20, 2021
f4b940e
Clearing out render targets and randmo write targets on pipeline dest…
kecho Jul 20, 2021
455ebc2
Fixed a null ref exception when adding a new environment to the libra…
JulienIgnace-Unity Jul 22, 2021
f20b3d8
FogBugz#1348462 - Wait for accessing the HDProjectSettings instance a…
alex-vazquez Jul 22, 2021
8722fe0
Fix nullref in volume system after deleting a volume object (#5161)
alelievr Jul 26, 2021
21fdf2e
merge master
sebastienlagarde Jul 26, 2021
bc579c7
[HDRP] Fix APV UI loosing focus when changing a param (#5219)
alelievr Jul 26, 2021
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 @@ -139,7 +139,8 @@ static void Drawer_VolumeContent(SerializedProbeVolume serialized, Editor owner)
EditorGUI.BeginChangeCheck();
if ((serialized.serializedObject.targetObject as ProbeVolume).mightNeedRebaking)
{
EditorGUILayout.HelpBox("The probe volume has changed since last baking or the data was never baked.\nPlease bake lighting in the lighting panel to update the lighting data.", MessageType.Warning, wide: true);
var helpBoxRect = GUILayoutUtility.GetRect(new GUIContent(Styles.s_ProbeVolumeChangedMessage, EditorGUIUtility.IconContent("Warning@2x").image), EditorStyles.helpBox);
EditorGUI.HelpBox(helpBoxRect, Styles.s_ProbeVolumeChangedMessage, MessageType.Warning);
}

EditorGUILayout.PropertyField(serialized.globalVolume, Styles.s_GlobalVolume);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal static class Styles
internal static readonly GUIContent s_MinMaxSubdivSlider = new GUIContent("Subdivision Controller", "Control how much the probe baking system will subdivide in this volume.\nBoth min and max values are used to compute the allowed subdivision levels inside this volume. e.g. a Min subdivision of 2 will ensure that there is at least 2 levels of subdivision everywhere in the volume.");
internal static readonly GUIContent s_ObjectLayerMask = new GUIContent("Object Layer Mask", "Control which layers will be used to select the meshes for the probe placement algorithm.");
internal static readonly GUIContent s_GeometryDistanceOffset = new GUIContent("Geometry Distance Offset", "Affects the minimum distance at which the subdivision system will place probes near the geometry.");
internal static readonly string s_ProbeVolumeChangedMessage = "The probe volume has changed since last baking or the data was never baked.\nPlease bake lighting in the lighting panel to update the lighting data.";

internal static readonly Color k_GizmoColorBase = new Color32(137, 222, 144, 255);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ void RefreshLibraryDisplay()
m_EnvironmentListToolbar.style.visibility = Visibility.Visible;
m_NoEnvironmentList.style.display = DisplayStyle.None;
}
m_EnvironmentList.RefreshItems();
}
}

Expand Down
19 changes: 18 additions & 1 deletion com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using UnityEngine.Rendering.LookDev;
using UnityEditorInternal;
using UnityEngine;
using System.Linq;

namespace UnityEditor.Rendering.LookDev
{
Expand Down Expand Up @@ -32,6 +33,11 @@ internal static Context currentContext
{
if (s_CurrentContext == null || s_CurrentContext.Equals(null))
{
// In case the context is still alive somewhere but the static reference has been lost, we can find the object back with this
s_CurrentContext = TryFindCurrentContext();
if (s_CurrentContext != null)
return s_CurrentContext;

s_CurrentContext = LoadConfigInternal();
if (s_CurrentContext == null)
s_CurrentContext = defaultContext;
Expand All @@ -43,11 +49,22 @@ internal static Context currentContext
private set => s_CurrentContext = value;
}

static Context TryFindCurrentContext()
{
Context context = s_CurrentContext;

if (context != null)
return context;

return Resources.FindObjectsOfTypeAll<Context>().FirstOrDefault();
}

static Context defaultContext
{
get
{
var context = UnityEngine.ScriptableObject.CreateInstance<Context>();
context.hideFlags = HideFlags.HideAndDontSave;
context.Init();
return context;
}
Expand Down Expand Up @@ -132,7 +149,7 @@ internal static void Initialize(DisplayWindow window)

// Lookdev Initialize can be called when the window is re-created by the editor layout system.
// In that case, the current context won't be null and there might be objects to reload from the temp ID
ConfigureLookDev(reloadWithTemporaryID: s_CurrentContext != null);
ConfigureLookDev(reloadWithTemporaryID: TryFindCurrentContext() != null);
}

[Callbacks.DidReloadScripts]
Expand Down
14 changes: 7 additions & 7 deletions com.unity.render-pipelines.core/Runtime/Camera/FreeCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ namespace UnityEngine.Rendering
[CoreRPHelpURLAttribute("Free-Camera")]
public class FreeCamera : MonoBehaviour
{
const float k_MouseSensitivityMultiplier = 0.01f;

/// <summary>
/// Rotation speed when using a controller.
/// </summary>
public float m_LookSpeedController = 120f;
/// <summary>
/// Rotation speed when using the mouse.
/// </summary>
public float m_LookSpeedMouse = 10.0f;
public float m_LookSpeedMouse = 4.0f;
/// <summary>
/// Movement speed.
/// </summary>
Expand Down Expand Up @@ -51,7 +53,6 @@ public class FreeCamera : MonoBehaviour
InputAction lookAction;
InputAction moveAction;
InputAction speedAction;
InputAction fireAction;
InputAction yMoveAction;
#endif

Expand Down Expand Up @@ -94,7 +95,6 @@ void RegisterInputs()
moveAction.Enable();
lookAction.Enable();
speedAction.Enable();
fireAction.Enable();
yMoveAction.Enable();
#endif

Expand Down Expand Up @@ -129,8 +129,8 @@ void UpdateInputs()

#if USE_INPUT_SYSTEM
var lookDelta = lookAction.ReadValue<Vector2>();
inputRotateAxisX = lookDelta.x * m_LookSpeedMouse * Time.deltaTime;
inputRotateAxisY = lookDelta.y * m_LookSpeedMouse * Time.deltaTime;
inputRotateAxisX = lookDelta.x * m_LookSpeedMouse * k_MouseSensitivityMultiplier;
inputRotateAxisY = lookDelta.y * m_LookSpeedMouse * k_MouseSensitivityMultiplier;

leftShift = Keyboard.current.leftShiftKey.isPressed;
fire1 = Mouse.current?.leftButton?.isPressed == true || Gamepad.current?.xButton?.isPressed == true;
Expand All @@ -148,8 +148,8 @@ void UpdateInputs()
inputRotateAxisX = Input.GetAxis(kMouseX) * m_LookSpeedMouse;
inputRotateAxisY = Input.GetAxis(kMouseY) * m_LookSpeedMouse;
}
inputRotateAxisX += (Input.GetAxis(kRightStickX) * m_LookSpeedController * Time.deltaTime);
inputRotateAxisY += (Input.GetAxis(kRightStickY) * m_LookSpeedController * Time.deltaTime);
inputRotateAxisX += (Input.GetAxis(kRightStickX) * m_LookSpeedController * k_MouseSensitivityMultiplier);
inputRotateAxisY += (Input.GetAxis(kRightStickY) * m_LookSpeedController * k_MouseSensitivityMultiplier);

leftShift = Input.GetKey(KeyCode.LeftShift);
fire1 = Input.GetAxis("Fire1") > 0.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ public void Update(VolumeStack stack, Transform trigger, LayerMask layerMask)
// Traverse all volumes
foreach (var volume in volumes)
{
if (volume == null)
continue;

#if UNITY_EDITOR
// Skip volumes that aren't in the scene currently displayed in the scene view
if (!IsVolumeRenderedByCamera(volume, camera))
Expand Down Expand Up @@ -417,6 +420,7 @@ public void Update(VolumeStack stack, Transform trigger, LayerMask layerMask)
public Volume[] GetVolumes(LayerMask layerMask)
{
var volumes = GrabVolumes(layerMask);
volumes.RemoveAll(v => v == null);
return volumes.ToArray();
}

Expand Down
8 changes: 8 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed an issue with reflection probe normalization via APV when no probes are in scene.
- Fixed Volumetric Clouds not updated when using RenderTexture as input for cloud maps.
- Fixed custom post process name not displayed correctly in GPU markers.
- Fixed objects disappearing from Lookdev window when entering playmode (case 1309368).
- Fixed rendering of objects just after the TAA pass (before post process injection point).
- Fixed tiled artifacts in refraction at borders between two reflection probes.
- Fixed the FreeCamera and SimpleCameraController mouse rotation unusable at low framerate (case 1340344).
- Fixed warning "Releasing render texture that is set to be RenderTexture.active!" on pipeline disposal / hdrp live editing.
- Fixed a null ref exception when adding a new environment to the Look Dev library.
- Fixed a nullref in volume system after deleting a volume object (case 1348374).
- Fixed the APV UI loosing focus when the helpbox about baking appears in the probe volume.

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ static HDWizard()

static void WizardBehaviourDelayed()
{
if (!HDProjectSettings.wizardIsStartPopup)
throw new Exception(
$"HDProjectSettings.wizardIsStartPopup must be true");

if (frameToWait > 0)
{
--frameToWait;
Expand All @@ -265,6 +261,10 @@ static void WizardBehaviourDelayed()
// No need to update this method, unsubscribe from the application update
EditorApplication.update -= WizardBehaviourDelayed;

// If the wizard does not need to be shown at start up, do nothing.
if (!HDProjectSettings.wizardIsStartPopup)
return;

//Application.isPlaying cannot be called in constructor. Do it here
if (Application.isPlaying)
return;
Expand Down Expand Up @@ -307,10 +307,6 @@ static void CheckPersistencyPopupAlreadyOpened()
[Callbacks.DidReloadScripts]
static void WizardBehaviour()
{
// If the wizard does not need to be shown at start up, do nothing.
if (!HDProjectSettings.wizardIsStartPopup)
return;

//We need to wait at least one frame or the popup will not show up
frameToWait = 10;
EditorApplication.update += WizardBehaviourDelayed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,21 +349,46 @@ void LightLoop( float3 V, PositionInputs posInput, PreLightData preLightData, BS
}
#endif

EnvLightData envLightData;
if (envLightCount > 0)
{
envLightData = FetchEnvLight(envLightStart, 0);
}
else
{
envLightData = InitSkyEnvLightData(0);
}
#if HAS_REFRACTION

// For refraction to be stable, we should reuse the same refraction probe for the whole object.
// Otherwise as if the object span different tiles it could produce a different refraction probe picking and thus have visual artifacts.
// For this we need to find the tile that is at the center of the object that is being rendered.
// And then select the first refraction probe of this list.
if ((featureFlags & LIGHTFEATUREFLAGS_SSREFRACTION) && (_EnableSSRefraction > 0))
{
// grab current object position and retrieve in which tile it belongs too
float4x4 modelMat = GetObjectToWorldMatrix();
float3 objPos = modelMat._m03_m13_m23;
float4 posClip = TransformWorldToHClip(objPos);
posClip.xyz = posClip.xyz / posClip.w;

uint2 tileObj = (saturate(posClip.xy * 0.5f + 0.5f) * _ScreenSize.xy) / GetTileSize();

uint envLightStart, envLightCount;

// Fetch first env light to provide the scene proxy for screen space refraction computation
PositionInputs localInput;
ZERO_INITIALIZE(PositionInputs, localInput);
localInput.tileCoord = tileObj.xy;
localInput.linearDepth = posClip.w;

GetCountAndStart(localInput, LIGHTCATEGORY_ENV, envLightStart, envLightCount);

EnvLightData envLightData;
if (envLightCount > 0)
{
envLightData = FetchEnvLight(FetchIndex(envLightStart, 0));
}
else // If no refraction probe, use sky
{
envLightData = InitSkyEnvLightData(0);
}

IndirectLighting lighting = EvaluateBSDF_ScreenspaceRefraction(context, V, posInput, preLightData, bsdfData, envLightData, refractionHierarchyWeight);
AccumulateIndirectLighting(lighting, aggregateLighting);
}
#endif


#if defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph,
if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing)
{
source = DoTemporalAntialiasing(renderGraph, hdCamera, depthBuffer, motionVectors, depthBufferMipChain, source, postDoF: false, "TAA Destination");
RestoreNonjitteredMatrices(renderGraph, hdCamera);
}
else if (hdCamera.antialiasing == HDAdditionalCameraData.AntialiasingMode.SubpixelMorphologicalAntiAliasing)
{
Expand Down Expand Up @@ -539,6 +540,34 @@ TextureHandle RenderPostProcess(RenderGraph renderGraph,
return dest;
}

class RestoreNonJitteredPassData
{
public ShaderVariablesGlobal globalCB;
public HDCamera hdCamera;
}

void RestoreNonjitteredMatrices(RenderGraph renderGraph, HDCamera hdCamera)
{
using (var builder = renderGraph.AddRenderPass<RestoreNonJitteredPassData>("Restore Non-Jittered Camera Matrices", out var passData))
{
passData.hdCamera = hdCamera;
passData.globalCB = m_ShaderVariablesGlobalCB;

builder.SetRenderFunc((RestoreNonJitteredPassData data, RenderGraphContext ctx) =>
{
// Note about AfterPostProcess and TAA:
// When TAA is enabled rendering is jittered and then resolved during the post processing pass.
// It means that any rendering done after post processing need to disable jittering. This is what we do with hdCamera.UpdateViewConstants(false);
// The issue is that the only available depth buffer is jittered so pixels would wobble around depth tested edges.
// In order to avoid that we decide that objects rendered after Post processes while TAA is active will not benefit from the depth buffer so we disable it.
data.hdCamera.UpdateAllViewConstants(false);
data.hdCamera.UpdateShaderVariablesGlobalCB(ref data.globalCB);

ConstantBuffer.PushGlobal(ctx.cmd, data.globalCB, HDShaderIDs._ShaderVariablesGlobal);
});
}
}

#region AfterPostProcess
class AfterPostProcessPassData
{
Expand Down Expand Up @@ -577,14 +606,6 @@ TextureHandle RenderAfterPostProcessObjects(RenderGraph renderGraph, HDCamera hd
builder.SetRenderFunc(
(AfterPostProcessPassData data, RenderGraphContext ctx) =>
{
// Note about AfterPostProcess and TAA:
// When TAA is enabled rendering is jittered and then resolved during the post processing pass.
// It means that any rendering done after post processing need to disable jittering. This is what we do with hdCamera.UpdateViewConstants(false);
// The issue is that the only available depth buffer is jittered so pixels would wobble around depth tested edges.
// In order to avoid that we decide that objects rendered after Post processes while TAA is active will not benefit from the depth buffer so we disable it.
data.hdCamera.UpdateAllViewConstants(false);
data.hdCamera.UpdateShaderVariablesGlobalCB(ref data.globalCB);

UpdateOffscreenRenderingConstants(ref data.globalCB, true, 1.0f);
ConstantBuffer.PushGlobal(ctx.cmd, data.globalCB, HDShaderIDs._ShaderVariablesGlobal);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@ void InitializeRenderStateBlocks()
/// <param name="disposing">Is disposing.</param>
protected override void Dispose(bool disposing)
{
Graphics.ClearRandomWriteTargets();
Graphics.SetRenderTarget(null);
DisposeProbeCameraPool();

UnsetRenderingFeatures();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

public class LookWithMouse : MonoBehaviour
{
const float k_MouseSensitivityMultiplier = 0.01f;

public float mouseSensitivity = 100f;

public Transform playerBody;
Expand Down Expand Up @@ -39,11 +41,11 @@ void Update()
mouseY += value.y;
}

mouseX *= mouseSensitivity * Time.deltaTime;
mouseY *= mouseSensitivity * Time.deltaTime;
mouseX *= mouseSensitivity * k_MouseSensitivityMultiplier;
mouseY *= mouseSensitivity * k_MouseSensitivityMultiplier;
#else
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * k_MouseSensitivityMultiplier;
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * k_MouseSensitivityMultiplier;
#endif

xRotation -= mouseY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public void UpdateTransform(Transform t)
}
}

const float k_MouseSensitivityMultiplier = 0.01f;

CameraState m_TargetCameraState = new CameraState();
CameraState m_InterpolatingCameraState = new CameraState();

Expand Down Expand Up @@ -165,8 +167,6 @@ Vector3 GetInputTranslationDirection()

void Update()
{
// Exit Sample

if (IsEscapePressed())
{
Application.Quit();
Expand All @@ -191,7 +191,7 @@ void Update()
// Rotation
if (IsCameraRotationAllowed())
{
var mouseMovement = GetInputLookRotation() * Time.deltaTime * mouseSensitivity;
var mouseMovement = GetInputLookRotation() * k_MouseSensitivityMultiplier * mouseSensitivity;
if (invertY)
mouseMovement.y = -mouseMovement.y;

Expand Down Expand Up @@ -243,7 +243,7 @@ Vector2 GetInputLookRotation()
delta *= 0.1f; // Account for sensitivity setting on old Mouse X and Y axes.
return delta;
#else
return new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y") * (invertY ? 1 : -1));
return new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
#endif
}

Expand Down
Loading