Skip to content

Commit 2a4aa3f

Browse files
sebastienlagardeanisunityFrancescoC-unityskhiatRSlysz
authored
Merge 8.x.x/hd/staging (#153)
* [8.x.x Backport]Fixed the MaxLightCount being display when the light volume debug menu is on ColorAndEdge. (#6210) * Fixed the MaxLightCount being display when the light volume debug menu is on ColorAndEdge. * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * [8.x.x Backport] Update documentation to mention more explicitely the lack of support of vertex animation (#6204) * Update documentation to mention more explicitely the lack of support of vertex animation * Update Ray-Tracing-Getting-Started.md Co-authored-by: sebastienlagarde <[email protected]> * [8.x.x Backport] Make subsection in decal debug menu to specify "affect transparents" (#6202) * Make subsection in decal debug menu * changelog * Support cookie on light backing for Disc Area Light #6138 * Hdrp /lookdev/fix crash on adding volume as viewed game object #6129 * fixed changelog * Add smoothness remark (#6226) * Removed legacy VR code from HDRP #5923 * Fixed duplicated entry for com.unity.modules.xr in the runtime asmdef file #5895 * Improve light clipping and culling #2 #4711 * Hdrp/fix/decal material ui errors #6225 * Fix z-fighting in sceneview when scene lighting is off (#6213) * Do not override the depth state of transparent materials in RenderDebugView * Changelog * Changelog - add case number Co-authored-by: sebastienlagarde <[email protected]> * Update CHANGELOG.md * Mention default post processing in default volumes. (#6233) * Fix cubemap inspector so that thumbnail for cubemap work #6231 * - Fix an exception in ray tracing that happens if two LOD levels are using the same mesh renderer. (#6197) Co-authored-by: sebastienlagarde <[email protected]> * [Backport 8.x.x] Fix some typos in the debug menu (#6249) * Backport renaming * changelog * Added debug exposure to light hierarchy debug. (#6216) # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. (#6254) * Clearer naming of tile and cluster categories for environment lights #6227 * Fix texture curve destroy (#6277) # Conflicts: # com.unity.render-pipelines.core/CHANGELOG.md * Fixed an issue with refraction model and ray traced recursive rendering (case 1198578). (#6270) * fix for Fogbugz 1214609 - HDRP Wizard addively increases the Light Intesity instead of setting it (#6266) * Fixed an issue where a dynamic sky changing any frame may not update the ambient probe. #6235 * Add XR setting to control camera jitter for temporal effects #6259 * fix unreachable code in TextureXR.useTexArray (#6260) Co-authored-by: sebastienlagarde <[email protected]> * Deprecate Utilities namespace #6219 * Fix issue on thumbnail generation so that no error on new project and thumbnail are generated at first import #6265 * Update CHANGELOG.md * [8.x.x Backport] Partial fix LookDev opened when CoreRP package reimported (#6289) * Fix null texture usage happening on CoreRP upgrade * Partially fix garbage collected stylesheet issue. (Need more work on UIElement side, see case 1228706 ) * Update CHANGELOG.md * Clean log * [Backport 8.x.x] Hdrp/fix default volume switch (#6336) * Fixed an issue where default volume would not update when switching profile. * Fixed an issue when setting the default volume for the first time where the hdrp asset would not be dirtied * Changelog * [Backport 8.x.x] Fixed an issue where AO override would not override specular occlusion (#6339) * Manual cherry pick of 9162acb50898c948e35475bb1c0d58dbea4217b7 * Changelog Co-authored-by: sebastienlagarde <[email protected]> * [Backport 8.x.x] Fixed an issue where Volume inspector might not refresh correctly in some cases. (#6335) * Fixed an issue where Volume inspector might not refresh correctly in some cases. * changelog Co-authored-by: sebastienlagarde <[email protected]> * Hdrp/fix material baked emission #5392 * Fixed volume components lifespan in the clipboard #5869 * Hdrp/fix/particle light shadows #6111 * Bugfix: uncached reflection probe cameras were reseting the debug mode #6245 * Fix case in PBR sky where a camera below ground might invalidate result of a camera above #6272 * Hdrp/probe scale 1219246 (#6288) * Fix when scale down < 0 all direction of box Influence Volume * Update Change log * Update CHANGELOG.md * Split set rendering feature set and API validity check #6301 * Fix Render Texture with XR #6306 * Fix sRGB mismatch with XR SDK #6311 * Fix XR single-pass with Mock HMD plugin #6313 * Fix XR culling with multiple cameras #6314 * Add custom pass opaque rendering error message #6330 * Update Light-Component.md (#6332) * Update CHANGELOG.md * Update TextureCurve.cs * fix merge issue * Update CHANGELOG.md * - Fixed an issue related to the envlightdatasrt not being bound in recursive rendering. (#6410) * First pass of light loop optimizations (still single threaded) (#6367) (#6424) * Saving 10% off the PrepareLightForGPU * 18% decrease in cost with this * Around 12% cost shaving off GetLightData * Around 6.5% win here * Faster View matrix flip * Missing *=-1 * About 7% win in preprocess light data * Another small batch * Small cleanup for first optimization pass * Tiny bit more cleanup * Address review points * Add comment * changelog # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md * Catch and handle NRefactory parser exceptions (#6392) Co-authored-by: vlad-andreev <[email protected]> * Avoid negative input to sqrt() (#6397) - The calculation of `k` is not numerically robust when done in FP16 and might generate a negative value. - This can be observed as rendering artifacts on Mali drivers newer than Bifrost/Valhall R21. - This commit fixes this by by clamping `k` to [0, inf] before the `sqrt()`. - On Mali-G77 the clamp compiles down to a free output modifier on the previous instruction, so there's no performance impact. * Refreshed the GUIDs for additional post processing data to avoid conflicts with PPv2 (#6394) * Added known issues page (#6447) * Platform/playstation #6380 * Shadow cascade tooltip fix (when using the metric mode) #6448 * Focus on Decal uses the extends of the projectors #6449 * [8.x.x Backport] Fixed how the area light influence volume is computed to match rasterization. (#6455) * - Fixed how the area light influence volume is computed to match rasterization. * Fix an issue with axis order Co-authored-by: sebastienlagarde <[email protected]> * Fixed usage of light size data that are not available at runtime. (#6490) * Changed the diffusion profile warning on the material to an info and changed the message to be more precise. (#6481) * Fix shadow tesselation culling (#6477) * Fix custom pass culling params * Fixed shadow tessellation culling * revert custom pass code * Add option to disable XR rendering on the camera settings #6372 * Move scene view camera settings to camera settings window #6390 * Corrected typo and changed links to .md (#6414) * Corrected typo and changed links to .md * Update Master-Node-Fabric.md * Hdrp /fix reset of HDAdditionalLightData #6453 * Fix null error when leaving debug menu #6467 * Hdrp /fix drag area width at left of light intensity #6471 * Fix issue with baked reflection probes constantly marked as dirty with auto-bake on #6473 * Fix custom pass depth copy #6484 * Hdrp /lookdev ui fixes #6491 * Expose a debug constant in ShaderLab to make HDRP/Unlit SRP Batcher compatible again. #6496 * fix unused leftover (#6497) * Fix custom pass test reference images (#6512) * [8.x.x Backport] Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). (#6506) * - Fixed a weird behavior in the scalable settings drawing when the space becomes tiny (1212045). * Small fix to avoid text overlapping Co-authored-by: Remi Chapelain <[email protected]> * Fixed an usage of a a compute buffer not bound (1229964) (#27) Co-authored-by: Anis <[email protected]> * Removed wrongly serialized fields in StaticLightingSky (#6441) * Fix issues in the post process system with RenderTexture being invalid in some cases. Causing rendering problems. #6480 * Fixed an issue where changing the default volume profile from another inspector would not update the default volume editor. #6493 * Hdrp/docs/glossary f number (#6523) * Update Glossary.md * Update Glossary.md * path validation when creating new volume profile (#36) * Clamp probes compression factor to 0 #19 * [Backport 8.x.x] Fix various leaks in HDRP (#119) * Fixed a number of leak in HDRP # Conflicts: # com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs * Update changelog * [8.x.x backport] Follow references when deleting unloading unused assets on shader graph save (case 1230996) (#115) * Follow references when unloading unneeded assets * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix MSAA resolve when there is no motion vectors * Fix issues causing planar probes to be broken with multiple cameras in the scene * Axf - Add specaa, add baked ao, fix reflection hierarchy for carpaint. * Hdrp/fix/custom pass msaa rendering info * Added disocclusion and ghosting to the glossary (#75) * fix switch shader compilation (#111) * Update SceneViewDrawMode.cs (#118) * Fix culling of reflection probes that change position * Fix null reference when processing light probe * Fix black screen in XR when HDRP package is present but not used * [8.x.x Backport] Fixed an issue with the specularFGD term being used when the material has a clear coat (lit shader). (#20) * Fixed an issue with the specularFGD term being used when the material has a clear coat (lit shader). * update ssr screenshot Co-authored-by: Sebastien Lagarde <[email protected]> * Added support for rasterized area light shadows in StackLit + slight refactor * fix Stacklit.hlsl after merge * Update the scripting API for FrameSettings, FrameSettingsOverrideMask and IBitArray (#110) * Vfx/docs/bulk review continued (#78) * Reviewed Contexts and terminology. * Began reviewing Events * Added sticky notes doc and reviewed Events * Update Contexts.md * Formatted documentation. * Update Contexts.md Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: Tristan Genevet <[email protected]> * Added baked GI rp support caveat and made setting shadow filter quality clearer for deferred high. (#145) * Fix for white flash happening when changing lighting condition (like teleport) * Fix issue with metal shader and raytracing * Fix default volume profile collapse * Update AxF-Shader.md (#152) * Bind missing buffer #159 Co-authored-by: anisunity <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: skhiat <[email protected]> Co-authored-by: Remi Slysz <[email protected]> Co-authored-by: Fabien Houlmann <[email protected]> Co-authored-by: Evgenii Golubev <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: fredericv-unity3d <[email protected]> Co-authored-by: Thomas <[email protected]> Co-authored-by: JordanL8 <[email protected]> Co-authored-by: vlad-andreev <[email protected]> Co-authored-by: vlad-andreev <[email protected]> Co-authored-by: ChristianF-ARM <[email protected]> Co-authored-by: Tim Cannell <[email protected]> Co-authored-by: Jussi Knuuttila <[email protected]> Co-authored-by: Remi Chapelain <[email protected]> Co-authored-by: Anis <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: Tristan Genevet <[email protected]> Co-authored-by: victor <[email protected]>
1 parent 78a614f commit 2a4aa3f

File tree

8 files changed

+66
-15
lines changed

8 files changed

+66
-15
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5050
- Fixed culling of planar reflection probes that change position (case 1218651)
5151
- Fixed null reference when processing lightprobe (case 1235285)
5252
- Fix black screen in XR when HDRP package is present but not used.
53+
- Fixed white flash happening with auto-exposure in some cases (case 1223774)
54+
- Fixed NaN which can appear with real time reflection and inf value
55+
- Fixed raytracing shader compilation on Metal
56+
- Fixed an issue that was collapsing the volume components in the HDRP default settings
57+
- Fixed warning about missing bound decal buffer
5358

5459
### Changed
5560
- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history.

com.unity.render-pipelines.high-definition/Documentation~/AxF-Shader.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This process does not duplicate the Textures and other resources that the origin
2525

2626
### Creating AxF Materials from scratch
2727

28-
New Materials in HDRP use the [Lit Shader](https://docs.unity3d.com/Packages/[email protected]/manual/Lit-Shader.html) by default. To create an AxF Material from scratch, create a Material and then make it use the AxF Shader. To do this:
28+
New Materials in HDRP use the [Lit Shader](Lit-Shader.md) by default. To create an AxF Material from scratch, create a Material and then make it use the AxF Shader. To do this:
2929

3030
1. In the Unity Editor, navigate to your Project's Asset window.
3131
2. Right-click the Asset Window and select **Create > Material**. This adds a new Material to your Unity Project’s Asset folder.
@@ -60,8 +60,9 @@ Note: The AxF Importer imports every Texture as half float, linear, sRGB gamut (
6060
| --------------------- | ------------------------------------------------------------ |
6161
| **Material Tiling U** | Sets the tile rate along the x-axis for every Texture in the **Surface Inputs** section. HDRP uses this value to tile the Textures along the x-axis of the Material’s surface, in object space. |
6262
| **Material Tiling V** | Sets the tile rate along the y-axis for every Texture in the **Surface Inputs** section. HDRP uses this value to tile the Textures along the y-axis of the Material’s surface, in object space. |
63-
| **BRDF Type** | Controls the main AxF Material representation.<br/>&#8226; **SVBRDF**: For information on the properties Unity makes visible when you select this option, see [BRDF Type - SVBRDF](https://docs.google.com/document/d/1_Oq2hsx3J7h8GHKoQM_8qf6Ip5VlHv_31K7dYYVOEmU/edit#heading=h.f1msh9g44mev).<br/>&#8226;**CAR_PAINT**: For information on the properties Unity makes visible when you select this option, see [BRDF Type - CAR_PAINT](https://docs.google.com/document/d/1_Oq2hsx3J7h8GHKoQM_8qf6Ip5VlHv_31K7dYYVOEmU/edit#heading=h.eorkre6buegg). |
63+
| **BRDF Type** | Controls the main AxF Material representation.<br/>&#8226; **SVBRDF**: For information on the properties Unity makes visible when you select this option, see [BRDF Type - SVBRDF](#SVBRDF).<br/>&#8226;**CAR_PAINT**: For information on the properties Unity makes visible when you select this option, see [BRDF Type - CAR_PAINT](#CAR_PAINT). |
6464

65+
<a name="SVBRDF"></a>
6566
#### BRDF Type - SVBRDF
6667

6768
| **Property** | **Description** |
@@ -86,6 +87,7 @@ Note: The AxF Importer imports every Texture as half float, linear, sRGB gamut (
8687
| **- Enable Refraction** | Indicates whether the clear coat is refractive. If you enable this checkbox, HDRP uses angles refracted by the clear coat to evaluate the undercoat of the Material surface. |
8788
| **- - Clearcoat IOR** | Specifies a Texture (red channel only) that implicitly defines the index of refraction (IOR) for the clear coat by encoding it to a monochromatic (single value) F0 (aka as specular color or Fresnel reflectance at 0 degree incidence. This also assumes the coat interfaces with air). As such, the value is in the range of **0** to **1** and HDRP calculates the final IOR as:<br/>`IOR = (1.0 + squareRoot(R) ) / (1.0 - squareRoot(R))`<br/>Where **R** is the normalized value in the red color channel of this Texture. Note: HDRP uses this IOR for both coat refraction and, if enabled, transmission and reflectance calculations through and on the coat. Therefore, you must always assign a Texture to this property when you enable clear coat. |
8889

90+
<a name="CAR_PAINT"></a>
8991
#### BRDF Type - CAR_PAINT
9092

9193
| **Property** | **Description** |

com.unity.render-pipelines.high-definition/Editor/RenderPipeline/Settings/DefaultSettingsPanel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class Styles
4545
ReorderableList m_BeforeTransparentCustomPostProcesses;
4646
ReorderableList m_BeforePostProcessCustomPostProcesses;
4747
ReorderableList m_AfterPostProcessCustomPostProcesses;
48-
int m_CurrentVolumeProfileHash;
48+
int m_CurrentVolumeProfileInstanceID;
4949

5050
public void OnGUI(string searchContext)
5151
{
@@ -209,9 +209,9 @@ void Draw_VolumeInspector()
209209
EditorGUILayout.EndHorizontal();
210210

211211
// The state of the profile can change without the asset reference changing so in this case we need to reset the editor.
212-
if (m_CurrentVolumeProfileHash != asset.GetHashCode() && m_CachedDefaultVolumeProfileEditor != null)
212+
if (m_CurrentVolumeProfileInstanceID != asset.GetInstanceID() && m_CachedDefaultVolumeProfileEditor != null)
213213
{
214-
m_CurrentVolumeProfileHash = asset.GetHashCode();
214+
m_CurrentVolumeProfileInstanceID = asset.GetInstanceID();
215215
m_CachedDefaultVolumeProfileEditor = null;
216216
}
217217

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ float4 SampleEnv(LightLoopContext lightLoopContext, int index, float3 texCoord,
130130
color.rgb = SampleSkyTexture(texCoord, lod, sliceIdx).rgb;
131131
}
132132

133+
// Planar, Reflection Probes and Sky aren't pre-expose, so best to clamp to max16 here in case of inf
134+
color.rgb = ClampToFloat16Max(color.rgb);
135+
133136
return color;
134137
}
135138

com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadows.shader

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Shader "Hidden/HDRP/ScreenSpaceShadows"
77
#pragma target 4.5
88
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
99
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
10+
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl"
1011
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl"
1112
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
1213
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl"

com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ Shader "HDRP/LayeredLit"
369369
HLSLINCLUDE
370370

371371
#pragma target 4.5
372-
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
373372

374373
#pragma shader_feature_local _ALPHATEST_ON
375374
#pragma shader_feature_local _DEPTHOFFSET_ON
@@ -527,6 +526,8 @@ Shader "HDRP/LayeredLit"
527526
ColorMask 0
528527

529528
HLSLPROGRAM
529+
530+
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
530531
//enable GPU instancing support
531532
#pragma multi_compile_instancing
532533
#pragma instancing_options renderinglayer
@@ -556,7 +557,7 @@ Shader "HDRP/LayeredLit"
556557
Tags { "LightMode" = "GBuffer" } // This will be only for opaque object based on the RenderQueue index
557558

558559
Cull [_CullMode]
559-
ZTest[_ZTestGBuffer]
560+
ZTest [_ZTestGBuffer]
560561

561562
Stencil
562563
{
@@ -567,6 +568,8 @@ Shader "HDRP/LayeredLit"
567568
}
568569

569570
HLSLPROGRAM
571+
572+
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
570573
//enable GPU instancing support
571574
#pragma multi_compile_instancing
572575
#pragma instancing_options renderinglayer
@@ -593,8 +596,8 @@ Shader "HDRP/LayeredLit"
593596
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
594597
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
595598
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/ShaderPass/LitSharePass.hlsl"
596-
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitData.hlsl"
597-
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassGBuffer.hlsl"
599+
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitData.hlsl"
600+
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassGBuffer.hlsl"
598601

599602
#pragma vertex Vert
600603
#pragma fragment Frag
@@ -612,6 +615,8 @@ Shader "HDRP/LayeredLit"
612615
Cull Off
613616

614617
HLSLPROGRAM
618+
619+
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
615620
//enable GPU instancing support
616621
#pragma multi_compile_instancing
617622
#pragma instancing_options renderinglayer
@@ -652,6 +657,8 @@ Shader "HDRP/LayeredLit"
652657
ZWrite On
653658

654659
HLSLPROGRAM
660+
661+
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
655662
//enable GPU instancing support
656663
#pragma multi_compile_instancing
657664
#pragma instancing_options renderinglayer
@@ -690,6 +697,8 @@ Shader "HDRP/LayeredLit"
690697
ColorMask 0
691698

692699
HLSLPROGRAM
700+
701+
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
693702
//enable GPU instancing support
694703
#pragma multi_compile_instancing
695704
#pragma instancing_options renderinglayer
@@ -726,6 +735,8 @@ Shader "HDRP/LayeredLit"
726735
ZWrite On
727736

728737
HLSLPROGRAM
738+
739+
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
729740
//enable GPU instancing support
730741
#pragma multi_compile_instancing
731742
#pragma instancing_options renderinglayer
@@ -774,6 +785,8 @@ Shader "HDRP/LayeredLit"
774785
Cull [_CullMode]
775786

776787
HLSLPROGRAM
788+
789+
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
777790
//enable GPU instancing support
778791
#pragma multi_compile_instancing
779792
#pragma instancing_options renderinglayer
@@ -837,6 +850,8 @@ Shader "HDRP/LayeredLit"
837850

838851
HLSLPROGRAM
839852

853+
#pragma only_renderers d3d11
854+
840855
#pragma raytracing surface_shader
841856

842857
#pragma multi_compile _ DEBUG_DISPLAY
@@ -880,6 +895,8 @@ Shader "HDRP/LayeredLit"
880895

881896
HLSLPROGRAM
882897

898+
#pragma only_renderers d3d11
899+
883900
#pragma raytracing surface_shader
884901

885902
#pragma multi_compile _ DEBUG_DISPLAY
@@ -919,6 +936,8 @@ Shader "HDRP/LayeredLit"
919936

920937
HLSLPROGRAM
921938

939+
#pragma only_renderers d3d11
940+
922941
#pragma raytracing surface_shader
923942

924943
#pragma multi_compile _ DEBUG_DISPLAY
@@ -954,6 +973,8 @@ Shader "HDRP/LayeredLit"
954973

955974
HLSLPROGRAM
956975

976+
#pragma only_renderers d3d11
977+
957978
#pragma raytracing surface_shader
958979

959980
#define SHADERPASS SHADERPASS_RAYTRACING_VISIBILITY
@@ -978,6 +999,8 @@ Shader "HDRP/LayeredLit"
978999

9791000
HLSLPROGRAM
9801001

1002+
#pragma only_renderers d3d11
1003+
9811004
#pragma raytracing surface_shader
9821005

9831006
#pragma multi_compile _ DEBUG_DISPLAY
@@ -1010,6 +1033,8 @@ Shader "HDRP/LayeredLit"
10101033

10111034
HLSLPROGRAM
10121035

1036+
#pragma only_renderers d3d11
1037+
10131038
#pragma raytracing surface_shader
10141039

10151040
#pragma multi_compile _ DEBUG_DISPLAY

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,26 @@ public void BeginFrame(CommandBuffer cmd, HDCamera camera, HDRenderPipeline hdIn
372372
}
373373
else
374374
{
375-
if (IsExposureFixed())
375+
// Fix exposure is store in Exposure Textures at the beginning of the frame as there is no need for color buffer
376+
// Dynamic exposure (Auto, curve) is store in Exposure Textures at the end of the frame (as it rely on color buffer)
377+
// Texture current and previous are swapped at the beginning of the frame.
378+
bool isFixedExposure = IsExposureFixed();
379+
if (isFixedExposure)
376380
{
377381
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.FixedExposure)))
378382
{
379383
DoFixedExposure(cmd, camera);
380384
}
381385
}
382386

383-
cmd.SetGlobalTexture(HDShaderIDs._ExposureTexture, GetExposureTexture(camera));
387+
// Note: GetExposureTexture(camera) must be call AFTER the call of DoFixedExposure to be correctly taken into account
388+
// When we use Dynamic Exposure and we reset history we can't use pre-exposure (as there is no information)
389+
// For this reasons we put neutral value at the beginning of the frame in Exposure textures and
390+
// apply processed exposure from color buffer at the end of the Frame, only for a single frame.
391+
// After that we re-use the pre-exposure system
392+
RTHandle currentExposureTexture = (camera.resetPostProcessingHistory && !isFixedExposure) ? m_EmptyExposureTexture : GetExposureTexture(camera);
393+
394+
cmd.SetGlobalTexture(HDShaderIDs._ExposureTexture, currentExposureTexture);
384395
cmd.SetGlobalTexture(HDShaderIDs._PrevExposureTexture, GetPreviousExposureTexture(camera));
385396
}
386397
}
@@ -485,9 +496,9 @@ void PoolSource(ref RTHandle src, RTHandle dst)
485496
cmd.DispatchCompute(cs, kernel, (camera.actualWidth + 7) / 8, (camera.actualHeight + 7) / 8, camera.viewCount);
486497

487498
PoolSource(ref source, destination);
499+
}
488500
}
489501
}
490-
}
491502

492503
if (m_PostProcessEnabled)
493504
{
@@ -876,9 +887,9 @@ void DoDynamicExposure(CommandBuffer cmd, HDCamera camera, RTHandle colorBuffer,
876887

877888
if (camera.resetPostProcessingHistory)
878889
{
879-
kernel = cs.FindKernel("KReset");
880-
cmd.SetComputeTextureParam(cs, kernel, HDShaderIDs._OutputTexture, prevExposure);
881-
cmd.DispatchCompute(cs, kernel, 1, 1, 1);
890+
// For Dynamic Exposure, we need to undo the pre-exposure from the color buffer to calculate the correct one
891+
// When we reset history we must setup neutral value
892+
prevExposure = m_EmptyExposureTexture; // Use neutral texture
882893
}
883894

884895
m_ExposureVariants[0] = 1; // (int)exposureSettings.luminanceSource.value;

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,6 +3104,10 @@ void RenderDBuffer(HDCamera hdCamera, CommandBuffer cmd, ScriptableRenderContext
31043104
{
31053105
// We still bind black textures to make sure that something is bound (can be a problem on some platforms)
31063106
m_DbufferManager.BindBlackTextures(cmd);
3107+
3108+
// Bind buffer to make sure that something is bound .
3109+
cmd.SetGlobalBuffer(HDShaderIDs._DecalPropertyMaskBufferSRV, m_DbufferManager.propertyMaskBuffer);
3110+
31073111
return;
31083112
}
31093113

0 commit comments

Comments
 (0)