Skip to content

Merge Hd/bugfix #4830

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 43 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 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
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
5 changes: 5 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the double sided option moving when toggling it in the material UI (case 1328877).
- Fixed incorrect RTHandle scale in DoF when TAA is enabled.
- Fixed an incompatibility between MSAA and Volumetric Clouds.
- Fixed volumetric fog in planar reflections.
- Fixed error with motion blur and small render targets.
- Fixed issue with on-demand directional shadow maps looking broken when a reflection probe is updated at the same time.
- Fixed cropping issue with the compositor camera bridge (case 1340549).

### Changed
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard
Expand Down Expand Up @@ -324,6 +328,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Display an info box and disable MSAA asset entry when ray tracing is enabled.
- Changed light reset to preserve type.
- Ignore hybrid duplicated reflection probes during light baking.
- Updated the recursive rendering documentation (case 1338639).

## [11.0.0] - 2020-10-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This feature is a replacement pipeline for rendering Meshes in the High Definiti

The smoothness of a Material does not affect the way a ray reflects or refracts, which makes this rendering mode useful for rendering multi-layered transparent GameObjects.

HDRP might display the sky color instead of a GameObject that has ray tracing applied. This happens when the GameObject is further away from the Camera than the Max Ray Length value set in the volume component. To make the GameObject appear correctly, increase the value of the Max Ray Length property.

![](Images/RayTracingRecursiveRendering1.png)

**Car gear shift rendered with recursive ray tracing**
Expand Down Expand Up @@ -37,5 +39,5 @@ Since recursive rendering uses an independent render pass, HDRP cannot render an
| -------------- | ------------------------------------------------------------ |
| **LayerMask** | Defines the layers that HDRP processes this ray-traced effect for. |
| **Max Depth** | Controls the maximum number of times a ray can reflect or refract before it stops and returns the final color. Increasing this value increases execution time exponentially. |
| **Ray Length** | Controls the length of the rays that HDRP uses for ray tracing. If a ray doesn't find an intersection, then the ray returns the color of the sky. |
| **Max Ray Length** | Controls the length of the rays that HDRP uses for ray tracing. If a ray doesn't find an intersection, then the ray returns the color of the sky. |
| **Min Smoothness** | Defines the threshold at which reflection rays are not cast if the smoothness value of the target surface is inferior to the one defined by the parameter. |
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ While you are in the Unity Editor, HDRP updates shadow maps whenever you modify
- SetShadowResolutionOverride()
- SetShadowUpdateMode() or shadowUpdateMode. In this case, HDRP only refreshes the cached shadow maps if the mode changes between Every Frame and not Every Frame).


Be aware that anything that is view-dependent is likely to create problems with cached shadow maps because HDRP does not automatically update them as the main view moves. A non-obvious example of this is tessellation. Because tessellation factor is view-dependent, the geometry that the main camera sees might mismatch the geometry that HDRP rendered into the cached shadow map. If this visibly occurs, trigger a request for HDRP to update the Light's shadow map. To do this, make sure the Light's **Update Mode** is set to **On Demand** and call `RequestShadowMapRendering`.
Another non obvious scenario is when multiple views are available, the light will be updated only for a single view therefore causing the other views to have incorrect results. To avoid a common scenario in which the described artifact will occur, HDRP will not mark a shadow request as completed when performed from reflection probes with view dependent shadows and waiting until a non-reflection camera triggers a shadow update.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public bool shaderPropertiesAreDirty

ShaderVariablesGlobal m_ShaderVariablesGlobalCB = new ShaderVariablesGlobal();

int m_RecorderTempRT = Shader.PropertyToID("TempRecorder");

static private CompositionManager s_CompositorInstance;

// Built-in Color.black has an alpha of 1, so defien here a fully transparent black
Expand Down Expand Up @@ -824,14 +826,14 @@ void CustomRender(ScriptableRenderContext context, HDCamera camera)
if (recorderCaptureActions != null)
{
m_ShaderVariablesGlobalCB._ViewProjMatrix = m_ViewProjMatrixFlipped;
cmd.SetInvertCulling(true);
ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesGlobalCB, HDShaderIDs._ShaderVariablesGlobal);
cmd.Blit(null, BuiltinRenderTextureType.CameraTarget, m_Material, m_Material.FindPass("ForwardOnly"));
var format = m_InputLayers[0].GetRenderTarget().format;
cmd.GetTemporaryRT(m_RecorderTempRT, camera.camera.pixelWidth, camera.camera.pixelHeight, 0, FilterMode.Point, format);
cmd.Blit(null, m_RecorderTempRT, m_Material, m_Material.FindPass("ForwardOnly"));
for (recorderCaptureActions.Reset(); recorderCaptureActions.MoveNext();)
{
recorderCaptureActions.Current(BuiltinRenderTextureType.CameraTarget, cmd);
recorderCaptureActions.Current(m_RecorderTempRT, cmd);
}
cmd.SetInvertCulling(false);
}

// When we render directly to game view, we render the image flipped up-side-down, like other HDRP cameras
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,8 @@ internal int UpdateShadowRequest(HDCamera hdCamera, HDShadowManager manager, HDS

manager.UpdateShadowRequest(shadowRequestIndex, shadowRequest, updateType);

if (needToUpdateCachedContent)
if (needToUpdateCachedContent && (lightType != HDLightType.Directional ||
hdCamera.camera.cameraType != CameraType.Reflection))
{
// Handshake with the cached shadow manager to notify about the rendering.
// Technically the rendering has not happened yet, but it is scheduled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ GenerateMaxZParameters PrepareGenerateMaxZParameters(HDCamera hdCamera, HDUtils.
{
var parameters = new GenerateMaxZParameters();
parameters.generateMaxZCS = defaultResources.shaders.maxZCS;
parameters.generateMaxZCS.shaderKeywords = null;
bool planarReflection = hdCamera.camera.cameraType == CameraType.Reflection && hdCamera.parentCamera != null;
CoreUtils.SetKeyword(parameters.generateMaxZCS, "PLANAR_OBLIQUE_DEPTH", planarReflection);

parameters.maxZKernel = parameters.generateMaxZCS.FindKernel("ComputeMaxZ");
parameters.maxZDownsampleKernel = parameters.generateMaxZCS.FindKernel("ComputeFinalMask");
parameters.dilateMaxZKernel = parameters.generateMaxZCS.FindKernel("DilateMask");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ void KMain(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupThreadId : S
{
uint threadIdx = groupThreadId.y * TILE_SIZE + groupThreadId.x;

#if NEAR
gs_cacheNear[threadIdx] = _InputNearCoCTexture[COORD_TEXTURE2D_X(min(dispatchThreadId, Size))].x;
#endif

#if FAR
gs_cacheFar[threadIdx] = _InputFarCoCTexture[COORD_TEXTURE2D_X(min(dispatchThreadId, Size))].x;
#endif

GroupMemoryBarrierWithGroupSync();

Expand All @@ -47,8 +52,13 @@ void KMain(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupThreadId : S
{
if (threadIdx < s)
{
#if NEAR
gs_cacheNear[threadIdx] = max(gs_cacheNear[threadIdx], gs_cacheNear[threadIdx + s]);
#endif

#if FAR
gs_cacheFar[threadIdx] = max(gs_cacheFar[threadIdx], gs_cacheFar[threadIdx + s]);
#endif
}

GroupMemoryBarrierWithGroupSync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2960,8 +2960,8 @@ void PrepareMotionBlurPassData(RenderGraph renderGraph, in RenderGraphBuilder bu
tileSize = 16;
}

int tileTexWidth = Mathf.CeilToInt(postProcessViewportSize.x / tileSize);
int tileTexHeight = Mathf.CeilToInt(postProcessViewportSize.y / tileSize);
int tileTexWidth = Mathf.CeilToInt(postProcessViewportSize.x / (float)tileSize);
int tileTexHeight = Mathf.CeilToInt(postProcessViewportSize.y / (float)tileSize);
data.tileTargetSize = new Vector4(tileTexWidth, tileTexHeight, 1.0f / tileTexWidth, 1.0f / tileTexHeight);

float screenMagnitude = (new Vector2(postProcessViewportSize.x, postProcessViewportSize.y).magnitude);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma kernel ComputeFinalMask FINAL_MASK=1
#pragma kernel DilateMask DILATE_MASK=1

#pragma multi_compile _ PLANAR_OBLIQUE_DEPTH

// In some cases we might want to avoid stopping integrating volumetric even if > max distance if the gradient is very big.
// Realistically, with the dilation step this was never seen as necessary.
Expand Down Expand Up @@ -48,14 +49,20 @@ groupshared float gs_maxDepth[GROUP_SIZE * GROUP_SIZE];

RW_TEXTURE2D_X(float, _OutputTexture);


float GetDepthToDownsample(uint2 pixCoord)
{
float deviceDepth = LoadCameraDepth(pixCoord);
float outputDepth = 0;

if (deviceDepth == UNITY_RAW_FAR_CLIP_VALUE)
outputDepth = 1e10f;
else
#ifdef PLANAR_OBLIQUE_DEPTH
outputDepth = ComputeViewSpacePosition(float2(pixCoord) * _ScreenSize.zw, deviceDepth, UNITY_MATRIX_I_P).z;
#else
outputDepth = LinearEyeDepth(LoadCameraDepth(pixCoord), _ZBufferParams);
#endif

return outputDepth;
}
Expand Down