Skip to content

Commit

Permalink
[HDRP] Merge Hd/bugfix (#5999)
Browse files Browse the repository at this point in the history
* [HDRP] Fix AxF debug output in certain configurations (#4641)

* Fix AxF debug output in certain configurations.

* Update comment

* Fix SSR accumulation white flash (#4648)

* Fix white flash

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Display Info Box when MSAA + ray tracing is onr (#4627)

* Show info box when ray tracing is enabled.

* Changelog

* Move below MSAA

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix distortion when resizing the window in player builds with the Graphics Compositor enabled (#4593)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Add support for the camera bridge in the graphics compositor (#4599)

* Fix Jittered Project Matrix Infinite Far Clip Plane  (#4638)

* Reconstruct jittered projection matrix far plane (for Infinite )

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fixed a memory leak related to not disposing of the RTAS at the end HDRP's lifecycle. (#4688)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix custom pass utils Blur + Copy overdraw. (#4623)

* Fix overdraw in custom pass utils blur function

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix draw procedural invalid pass idx 1 on first template load (#4632)

* Fix

* changelog

* Force sync compilation for TAA

Co-authored-by: CifaCia <f.cifariellociardi@gmail.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Changed light reset to preserve type (#4624)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Revert "Add support for the camera bridge in the graphics compositor (#4599)"

This reverts commit 2325e3f.

* AxF carpaint: Fix a compilation issue on Vulkan until the cpp HLSLcc side is updated. (case 1335737, related to 1314040) (#4691)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Revert "Revert "Add support for the camera bridge in the graphics compositor (#4599)""

This reverts commit 30fffd5.

* revert: Fix distortion when resizing the window in player builds with the Graphi

* Fixed the ray traced sub subsurface scattering debug mode not displaying only the RTSSS Data (case 1332904). (#4626)

* Fixed the ray traced sub subsurface scattering debug mode not displaying only the RTSSS Data (case 1332904).

* Add test scene

Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com>
Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>

* Fix for discrepancies in saturation and intensity between screen space refraction and probe refraction (#4653)

* Delete the second transmittance mul

* Changelog

Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com>

* Fix a Divide-by-Zero Warning for some Anisotropic Models (Fabric, Lit) (#4636)

* Initialize the shading normal to a non-zero value for anisotropy

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix VfX lit particle AOV output color space (#4646)

* Fix VfX lit particle aov output color space

* Update comment

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP][Path Tracing] Fixed transparent unlit (#4605)

* Fixed issue with transparent unlit.

* Updated changelog.

* Reverted accidental change to default mtl.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix distortion with MSAA (#4711)

* Fix contact shadow debug views (#4720)

* Fix

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Update Decal-Projector.md (#4695)

* [HDRP] Fixed nullref when deleting the texture asset assigned in a local volumetric fog volume (#4728)

* Fixed nullref when deleting the 3D mask of a density volume (case 1339330)

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix decal layer enum (#4753)

* Fix typo

* Fixed reflection probes being injected into the ray tracing light cluster even if not baked (case 1329083). (#4640)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Ignore hybrid duplicated reflection probes during light baking (#4663)

* Ignore hybrid duplicated reflection probes during light baking

* test path instead of scene

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix double sided option moving when toggling it in the material UI (#4725)

* Fix double sided option moving when toggling it in the material UI (case 1328877)

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix formatting

* Fix volumetric fog in planar reflections (#4736)

* Fix planar reflection

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix motion blur compute dispatch size (#4737)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* - Updated the recursive rendering documentation (case 1338639). (#4759)

* - Updated the recursive rendering documentation (case 1338639).

* review fixes

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix issue with OnDemand directional shadow map being corrupted when reflection probe are updated same frame (#4812)

* Don't mark as rendered for reflection probes as we want the cached version to be from main view

* Do the thing just for directional

* Doc update

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix cropping issue with the compositor camera bridge (#4802)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix for unused resources in depth of field (#4796)

* Removing the word Radii from exposure settings (#4854)

* Rename in UX

* Update docs

* [HDRP][Path Tracing] Support for shadow mattes (#4745)

* Shadow matte support.

* Updated changelog.

* Only take occluders into account, closer match to raster mode.

* Added test scene.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Revert "[HDRP][Path Tracing] Support for shadow mattes (#4745)"

This reverts commit 85ebbc2.

* Fixed the transparent cutoff not working properly in semi-transparent  and color shadows (case 1340234). (#4756)

* Fixed the transparent cutoff not working properly in semi-transparent and color shadows (case 1340234).

* Update test ref image

Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Use non jittered projection in outline pass (#4836)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP][Path Tracing] Sky settings now properly taken into account when using recorder (#4856)

* Make sure sky settings are correctly set when recording.

* Updated changelog.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix Resolution Issues for Physically Based Depth of Field (#4848)

* Add the necesarry texture coordinate clamping for RTHandle for color pyramid sampling

* Add some resolution independence, fitted for 1920x1080

* Changelog

* Switch back to point sampling from trilinear, with commentary

* Update test reference images

* Small correction to the point sampling, always sample mip 0.

* Re-update the test images, for mip 0 color sampling

* Use a simpler UV scaling/clamping since we are now point sampling.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fixed bug introduced by sky-for-recorder support. (#4906)

* [Fogbugz 1341576] Memory leaks when the player is paused, and the user changes pipeline… (#4845)

* Memory leaks when the player is paused, and the user changes pipeline settings

* changelog

* [HDRP] Fixed shadergraph double save (#4916)

* Don't need to save twice shadergraph the first time we create a graph

* Updated changelog

* Write 0 instead of micro sized motion vectors + fix extremely fast velocities (#4820)

* Kill micromovements.

* Do same for camera

* Debug view update

* Changelog

* Remove unnecessary comment

* Fix excessive velocity end up marked as no velocity

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix material upgrader (#4821)

* Fix HDRP material upgrade failing when there is a texture inside the builtin resources assigned in the material

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix custom pass volume not executed in scene view (#4860)

* Fix custom pass volume not executed in scene view because of the volume culling mask

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix reflection probe tootltip (#4890)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Updated the Physically Based Sky documentation for baked lights (#4891)

* Updated the Physically Based Sky documentation for baked lights

* Rewrite

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fixed remapping of depth pyramid debug (#4893)

* Fixed remapping of depth pyramid debug

* Removed debug pragma

* Update changelog

* Updated tooltip

* Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection is enabled. (#4895)

* Fix AO perceived wobble

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix Asymmetric Projection Matrices and Fog / Pathtracing (#4926)

* Check for asymmetric projections and choose the generic path if so.

* Fix asymmetric projections for the pathtracer ray generation.

* Changelog

* Simplify the matrix multiplication for computing the generic matrix.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Revert: Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection…

* Fix GBuffer depth debug mode (#5054)

* Fixed Volume Gizmo size when rescaling parent GameObject (#4915)

* Fix Vertex Color Mode documentation (#4976)

* Fix wobble-like (or tearing-like) SSAO issues when temporal reprojection is enabled.  (#4986)

* Fix AO perceived wobble

* changelog

* Update screenshots

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix formatting in NestedOverrideCameraRendering

* [HDRP] Fix white flash with SSR when resetting camera history (#5089)

* Fix white flash with SSR when resetting camera history

* Move branch login inside GetPreviousExposureTexture

* Fix for fixed exposure

* [Fobguz # 1348357] VFX Particle templates missing stencil flags (#5080)

* Adding missing macro for stencil flags in particle forward shaders. This will let flags like TAA Reject be useful

* Changelog

* Fix object disappearing from lookdev (#5063)

* Fixed objects disappearing from Lookdev window when entering playmode (case 1309368).

* Updated changelog

* Added hideflags in Lookdev context

* [HDRP] Fix render object after taa jittering (#5088)

* Add a pass after TAA to restore non jittered matrices

* updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix GC alloc in hd/bugfix branch (#5134)

* Fixed GC alloc on hd/bugfix branch

* Fix GC alloc again

* Fix refraction tile artifacts near reflection probe edges (#4727)

* Pick the right probe at object center instead of tile granularity.

* changelog

* Missing commit

* Move stuff in lightloop and out of prelightData

* Update LightLoop.hlsl

* Formatting

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix camera rotation uncontrollable with low framerate (#5076)

* Fix camera rotation uncontrollable with low framerate.

* updated changelog

* Clearing out render targets and randmo write targets on pipeline destruction (#5176)

Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fixed a null ref exception when adding a new environment to the library. (#5131)

* Fixed a null ref exception when adding a new environment to the library.

* Update changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* FogBugz#1348462 - Wait for accessing the HDProjectSettings instance as it was before. (#5141)

* Fix nullref in volume system after deleting a volume object (#5161)

* Fix nullref in volume system after deleting a volume object (case 1348374)

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix APV UI loosing focus when changing a param (#5219)

* Fixed the APV UI losing focus when the helpbox about baking appears in the probe volume.

* Small changes (#5220)

* Fix update order in Graphics Compositor causing jumpy camera updates (#5235)

* Prevent material from having infinite intensity (#5132)

* Prevent material from having infinite intensity

* Fix switching from ldr to hdr emissive

* Fix input field precision

* Round the max value

* Make two variables

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Adding limitations of decal emissive positive contribution to the documentation (#5237)

* Add emissive positive contribution limitation to the doc

* changelog

* Update CHANGELOG.md

* Update Decal-Projector.md

* Update Decal-Shader.md

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix issue with path tracing when switching between non-persistent cameras (#5246)

* Fix issue with path traceing accumulation when switching between cameras.

* Check if camera history is persistent

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* removed undesired files

* Fix log base (#5260)

* [HDRP] Fixed mask value stored by the LayerMaskParameter class (#5250)

* Fixed value stored by the layer mask parameter class.

* Updated changelog.

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP][DXR] Make vertex color default to 1.0 instead of 0.0 (#5268)

* When raytracing, make vertex color default to white if not present.

* Updated Changelog.

* Added comment.

* Fix issue with 0-sized dispatch with extremely low resolutions (#5272)

* Ceil to int instead.

* changelog

* [HDRP] Fix incorrect light list indexing when TAA is enabled (#5287)

* Fix incorrect light list indexing when TAA is enabled

* Better handle XR

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix incorrect additiona velocity for alembic (#5304)

* Fixed LUT initialization in Wireframe mode (#5156)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] [LightExplorer] Fix missing refreshwhen editing property with a running paused editor. (#5321)

* Update HDLightExplorerExtension.cs

* Update CHANGELOG.md

* Changed Ambient Mode to Dynamic by default (#5350)

* Visual Environment component ambient mode now defaults to Dynamic.

* Update changelog

* Updated test scene with correct ambient mode after the change

* Missing files

* Last scene fix

* Hd/fix framesettings ordering (#5323)

* Fix strange entry in the FrameSettings and add comments for better readability

* Update CHANGELOG.md

Co-authored-by: JulienIgnace-Unity <julien@unity3d.com>

* Bugfix 1357311: Fixed old ray tracing material conversion (#5364)

* - fixed crash in material conversion where material used old raytracing render queue (3900)

* - changelog update

# Conflicts:
#	com.unity.render-pipelines.high-definition/CHANGELOG.md

* Bugfix 1358480: Fixed missing tooltip for "Tessellation Mode" (#5365)

* - fixed missing "Tessellation Mode" tooltip

* - update changelog

* - updated "Tessellation Mode" tooltip

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix HD template (particularly visible in path tracing) (#5319)

* Made the 3 light bulbs non shadow-casting.

* Revert "Made the 3 light bulbs non shadow-casting."

This reverts commit f32ba7d.

* Changed bulb prefab (shadow caster off).

* Revert: Changed Ambient Mode to Dynamic by default #5350

* Fixed a null ref exception when no opaque objects are rendered. (#5463)

* Fixed a null ref exception when no opaque objects are rendered.

* Update changelog

* Fix slope scale depth bias when depth offset is ON (#5466)

* Fix slope scale bias being broken when depth offset was enabled

* changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Fix spot shadow sampling when using custom spot angle (#5439)

* Fixed shadow sampling artifact when using the spot light shadow option 'custom spot angle'

* Updated changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix darkening in SSR fade  (#5472)

* Fix

* Changelog

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* [HDRP] Improve path traced subsurface scattering for transmissive surfaces (#5485)

* Improve subsurface scatering for transmissive surfaces

* Add changelog + fix throughput multiplication

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fix missing context menu for 'Post Anti-Aliasing' in Camera (1357283) (#5497)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Force allocate texture if no fallback is available (#5130)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Update path tracer screenshots

* Update 2314_Shadow_CustonAngle.png

* Fix range compression factor clamping (#5892)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fixed tooltip not showing on labels in ShaderGraphs (#5877)

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Proper format for copy history (#5796)

* Fix shadow mask fade and optimize it at same time  (#5911)

* Fix shadow mask fade and optimize.

* changelog

* Fix wrong format for contact shadows and shadow atlas default textures  (#5912)

* Fix contact shadows not being bound in debug and good default shadow

* changelog

* Rename

* Handle more edge cases where shadows are not drawn to atlas (disabled scene view lighting)

Co-authored-by: John Parsaie <johnpa@unity3d.com>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

* Fixed an issue where probe being forced realtime would cause perf to degrade greatly when manipulating them in editor. (#5901)

* Mark anchor override as not supported for probes (#5939)

* Revert: Fix shadow mask fade and optimize it at same time #5911

Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com>
Co-authored-by: FrancescoC-unity <43168857+FrancescoC-unity@users.noreply.github.com>
Co-authored-by: John Parsaie <johnpa@unity3d.com>
Co-authored-by: anisunity <42026998+anisunity@users.noreply.github.com>
Co-authored-by: Antoine Lelievre <antoinel@unity3d.com>
Co-authored-by: CifaCia <f.cifariellociardi@gmail.com>
Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com>
Co-authored-by: slunity <37302815+slunity@users.noreply.github.com>
Co-authored-by: Remi Chapelain <remi.chapelain@unity3d.com>
Co-authored-by: Emmanuel Turquin <emmanuel@turquin.org>
Co-authored-by: Adrian1066 <44636759+Adrian1066@users.noreply.github.com>
Co-authored-by: Kleber Garcia <kleber.garcia@unity3d.com>
Co-authored-by: Julien Ignace <julien@unity3d.com>
Co-authored-by: alex-vazquez <76204843+alex-vazquez@users.noreply.github.com>
Co-authored-by: Rémi Chapelain <57442369+remi-chapelain@users.noreply.github.com>
Co-authored-by: Remi Slysz <40034005+RSlysz@users.noreply.github.com>
Co-authored-by: Jarkko Lempiäinen <79095390+JarkkoUnity@users.noreply.github.com>
  • Loading branch information
18 people authored Oct 15, 2021
1 parent 0d3567b commit 6e68b35
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class RenderGraphDefaultResources
// We need to keep around a RTHandle version of default regular 2D textures since RenderGraph API is all RTHandle.
RTHandle m_BlackTexture2D;
RTHandle m_WhiteTexture2D;
RTHandle m_ShadowTexture2D;

/// <summary>Default black 2D texture.</summary>
public TextureHandle blackTexture { get; private set; }
Expand All @@ -31,23 +32,28 @@ public class RenderGraphDefaultResources
public TextureHandle blackTexture3DXR { get; private set; }
/// <summary>Default white XR 2D texture.</summary>
public TextureHandle whiteTextureXR { get; private set; }
/// <summary>Default 1x1 shadow texture.</summary>
public TextureHandle defaultShadowTexture { get; private set; }

internal RenderGraphDefaultResources()
{
m_BlackTexture2D = RTHandles.Alloc(Texture2D.blackTexture);
m_WhiteTexture2D = RTHandles.Alloc(Texture2D.whiteTexture);
m_ShadowTexture2D = RTHandles.Alloc(1, 1, depthBufferBits: DepthBits.Depth32, isShadowMap: true);
}

internal void Cleanup()
{
m_BlackTexture2D.Release();
m_WhiteTexture2D.Release();
m_ShadowTexture2D.Release();
}

internal void InitializeForRendering(RenderGraph renderGraph)
{
blackTexture = renderGraph.ImportTexture(m_BlackTexture2D);
whiteTexture = renderGraph.ImportTexture(m_WhiteTexture2D);
defaultShadowTexture = renderGraph.ImportTexture(m_ShadowTexture2D);

clearTextureXR = renderGraph.ImportTexture(TextureXR.GetClearTexture());
magentaTextureXR = renderGraph.ImportTexture(TextureXR.GetMagentaTexture());
Expand Down
4 changes: 4 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed depth pyramid being incorrect when having multiple cameras (scene view and gameview) and when hardware DRS was activated.
- Fixed the cloudlayer not using depth buffer.
- Fixed crossfade not working on the HD ST8 ShaderGraph [case 1369586](https://fogbugz.unity3d.com/f/cases/1369586/)
- Fixed range compression factor being clamped. (case 1365707)
- Fixed tooltip not showing on labels in ShaderGraphs (1358483).
- Fix API warnings in Matcap mode on Metal.
- Fix D3D validation layer errors w.r.t shadow textures when an atlas is not used.

## [13.0.0] - 2021-09-01

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ The tables that follow provide an overview of the Features that the High Definit
| **Realtime** | Yes | yes |
| **Baked** | Yes | Yes |
| ***Sampling*** | | |
| **Anchor Override** | Yes | Not supported |
| **Simple** | Yes | See [Reflection Hierarchy](Reflection-in-HDRP.md). |
| **Blend Probes** | Yes | See [Reflection Hierarchy](Reflection-in-HDRP.md). |
| **Blend Probes and Skybox** | Yes | See [Reflection Hierarchy](Reflection-in-HDRP.md). |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ internal override void Update()

internal override void Apply()
{
// Force the mode to real time so its influence is properly culled by the camera.
legacyMode.intValue = 1;

serializedLegacyObject.ApplyModifiedProperties();
base.Apply();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ protected void AddProperty<Data>(GUIContent displayName, Func<Data> getter, Acti

switch (getter())
{
case bool b: elem = new Toggle { value = b, tooltip = displayName.tooltip } as BaseField<Data>; break;
case int i: elem = new IntegerField { value = i, tooltip = displayName.tooltip, isDelayed = true } as BaseField<Data>; break;
case float f: elem = new FloatField { value = f, tooltip = displayName.tooltip, isDelayed = true } as BaseField<Data>; break;
case Enum e: elemEnum = new EnumField(e) { value = e, tooltip = displayName.tooltip }; break;
case bool b: elem = new Toggle { value = b } as BaseField<Data>; break;
case int i: elem = new IntegerField { value = i, isDelayed = true } as BaseField<Data>; break;
case float f: elem = new FloatField { value = f, isDelayed = true } as BaseField<Data>; break;
case Enum e: elemEnum = new EnumField(e) { value = e }; break;
default: throw new Exception($"Can't create UI field for type {getter().GetType()}, please add it if it's relevant. If you can't consider using TargetPropertyGUIContext.AddProperty instead.");
}

if (elem != null)
{
context.AddProperty<Data>(displayName.text, indentLevel, elem, (evt) =>
context.AddProperty<Data>(displayName.text, displayName.tooltip, indentLevel, elem, (evt) =>
{
if (Equals(getter(), evt.newValue))
return;
Expand All @@ -66,7 +66,7 @@ protected void AddProperty<Data>(GUIContent displayName, Func<Data> getter, Acti
}
else
{
context.AddProperty<Enum>(displayName.text, indentLevel, elemEnum, (evt) =>
context.AddProperty<Enum>(displayName.text, displayName.tooltip, indentLevel, elemEnum, (evt) =>
{
if (Equals(getter(), evt.newValue))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,18 @@ float4 SampleEnv(LightLoopContext lightLoopContext, int index, float3 texCoord,
color.rgb = SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvCubemapTextures, s_trilinear_clamp_sampler, texCoord, _EnvSliceSize * index + sliceIdx, lod).rgb;
}

// Planar and Reflection Probes aren't pre-expose, so best to clamp to max16 here in case of inf
color.rgb = ClampToFloat16Max(color.rgb);

color.rgb *= rangeCompressionFactorCompensation;
}
else // SINGLE_PASS_SAMPLE_SKY
{
color.rgb = SampleSkyTexture(texCoord, lod, sliceIdx).rgb;
// Sky isn't pre-expose, so best to clamp to max16 here in case of inf
color.rgb = ClampToFloat16Max(color.rgb);
}

// Planar, Reflection Probes and Sky aren't pre-expose, so best to clamp to max16 here in case of inf
color.rgb = ClampToFloat16Max(color.rgb);

return color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#pragma kernel GTAODenoise_CopyHistory

RW_TEXTURE2D_X(uint, _OutputTexture);
RW_TEXTURE2D_X(float4, _OutputTexture);
TEXTURE2D_X(_InputTexture);

[numthreads(8, 8, 1)]
void GTAODenoise_CopyHistory(uint3 dispatchThreadId : SV_DispatchThreadID)
{
UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z);
_OutputTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)] = _InputTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)].x;
_OutputTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)] = _InputTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)];
}
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ internal TextureHandle RenderShadows(RenderGraph renderGraph, CullingResults cul
{
if (m_ShadowRequests.Count == 0)
{
return renderGraph.defaultResources.blackTexture;
return renderGraph.defaultResources.defaultShadowTexture;
}

TextureHandle atlas = RenderShadowMaps(renderGraph, cullResults, globalCB, frameSettings, shadowPassName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ static void BindAtlasTexture(RenderGraphContext ctx, TextureHandle texture, int
if (texture.IsValid())
ctx.cmd.SetGlobalTexture(shaderId, texture);
else
ctx.cmd.SetGlobalTexture(shaderId, ctx.defaultResources.blackTexture);
ctx.cmd.SetGlobalTexture(shaderId, ctx.defaultResources.defaultShadowTexture);
}

void BindShadowGlobalResources(RenderGraph renderGraph, in ShadowResult shadowResult)
Expand All @@ -970,6 +970,23 @@ void BindShadowGlobalResources(RenderGraph renderGraph, in ShadowResult shadowRe
}
}

internal static void BindDefaultShadowGlobalResources(RenderGraph renderGraph)
{
using (var builder = renderGraph.AddRenderPass<BindShadowGlobalResourcesPassData>("BindDefaultShadowGlobalResources", out var passData))
{
builder.AllowPassCulling(false);
builder.SetRenderFunc(
(BindShadowGlobalResourcesPassData data, RenderGraphContext ctx) =>
{
BindAtlasTexture(ctx, ctx.defaultResources.defaultShadowTexture, HDShaderIDs._ShadowmapAtlas);
BindAtlasTexture(ctx, ctx.defaultResources.defaultShadowTexture, HDShaderIDs._ShadowmapCascadeAtlas);
BindAtlasTexture(ctx, ctx.defaultResources.defaultShadowTexture, HDShaderIDs._ShadowmapAreaAtlas);
BindAtlasTexture(ctx, ctx.defaultResources.defaultShadowTexture, HDShaderIDs._CachedShadowmapAtlas);
BindAtlasTexture(ctx, ctx.defaultResources.defaultShadowTexture, HDShaderIDs._CachedAreaLightShadowmapAtlas);
});
}
}

void BlitCachedShadows(RenderGraph renderGraph)
{
m_Atlas.BlitCachedIntoAtlas(renderGraph, cachedShadowManager.punctualShadowAtlas, m_BlitShadowMaterial, "Blit Punctual Mixed Cached Shadows", HDProfileId.BlitPunctualMixedCachedShadowMaps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,8 @@ TextureHandle RenderDebugViewMaterial(RenderGraph renderGraph, CullingResults cu
HDUtils.BlitColorAndDepth(context.cmd, data.clearColorTexture, data.clearDepthTexture, new Vector4(1, 1, 0, 0), 0, !data.clearDepth);
}

BindDefaultTexturesLightingBuffers(context.defaultResources, context.cmd);

BindDBufferGlobalData(data.dbuffer, context);
DrawOpaqueRendererList(context, data.frameSettings, data.opaqueRendererList);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ static void BindGlobalLightingBuffers(in LightingBuffers buffers, CommandBuffer
cmd.SetGlobalTexture(HDShaderIDs._ScreenSpaceShadowsTexture, buffers.screenspaceShadowBuffer);
}

static void BindDefaultTexturesLightingBuffers(RenderGraphDefaultResources defaultResources, CommandBuffer cmd)
{
cmd.SetGlobalTexture(HDShaderIDs._AmbientOcclusionTexture, defaultResources.blackTextureXR);
cmd.SetGlobalTexture(HDShaderIDs._SsrLightingTexture, defaultResources.blackTextureXR);
cmd.SetGlobalTexture(HDShaderIDs._IndirectDiffuseTexture, defaultResources.blackTextureXR);
cmd.SetGlobalTexture(HDShaderIDs._ContactShadowTexture, defaultResources.blackUIntTextureXR);
cmd.SetGlobalTexture(HDShaderIDs._ScreenSpaceShadowsTexture, defaultResources.blackTextureXR);
}

class BuildGPULightListPassData
{
// Common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ void RecordRenderGraph(RenderRequest renderRequest,
// For alpha output in AOVs or debug views, in case we have a shadow matte material, we need to render the shadow maps
if (m_CurrentDebugDisplaySettings.data.materialDebugSettings.debugViewMaterialCommonValue == Attributes.MaterialSharedProperty.Alpha)
RenderShadows(m_RenderGraph, hdCamera, cullingResults, ref shadowResult);
else
HDShadowManager.BindDefaultShadowGlobalResources(m_RenderGraph);

// Stop Single Pass is after post process.
StartXRSinglePass(m_RenderGraph, hdCamera);
Expand Down

0 comments on commit 6e68b35

Please sign in to comment.