Skip to content

Commit cbf9bde

Browse files
FrancescoC-unitykechoJulienIgnace-Unitysebastienlagardepmavridis
committed
Fix constant buffer being stomped on by shadows during async tasks (#4093)
* Hd/fix 1299116 tesselation cull (#3057) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * StackLit: Fix SG surface option property block to only display energy conserving specular color option for the specular input parametrization (similar to case 1257050) (#3060) * Fixed missing BeginCameraRendering call for custom render mode of a Camera (#3063) * Implement custom drawer for layer mask parameters (#3066) * Adding mixed light baking shadowmask test (#3052) * adding a shadow mask test * Update reference images * Fixing hull constant shader's tesselation cull algorithm. Before it was comparing edges being out of the frustum. This is wrong because the camera could be inside a triangle, in which case the edges could be out of at least 1 frustum plane. Correct fix is to check all three vertices if they are out of at least 1 plane. Result packed tightly into the functions w return component. * Renamed to a new function so we keep backwards compatibility. Restored the shadow shader pass path, accidentally changed it to bool4 and use near plane. * Fixing type back to bool, instead of bool4 * Merging changelog information from rebase. * Making sure scene declaration pass is a bool4 * Adding new test for tesselation culling, with a weird camera angle which fails previous setup. * Fixing formatting of code, rearranging order of test in editor build settings. * Adding reference images for test. * Missing meta file for new tests * Fix bad merge issue * fix bad merge issue * fix bad merge issue Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: Rémi Chapelain <[email protected]> * Change the source value for the ray tracing frame index iterator from m_FrameCount to the camera frame count (case 1301356). (#3032) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Added a RenderGraph pass that resets the camera size after the dynamic res upscale (#3070) * Added a RenderGraph pass that resets the camera size after the dynamic res upscale * Updated changelog # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md * fixed class name * update class name * PR fix * Fixed RTHandle scale Co-authored-by: sebastienlagarde <[email protected]> * Fix Light Intensity UI Prefab Override Application (1299563) (#3061) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * Apply the fix * Changelog * Mofified approach to the fix, this time also fixing override saving of light unit * Use more precise rect line offset calculation * Update CHANGELOG.md Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> * Fix Undo/Redo Stability for Light Temperature (1304176, 1301076) (#3079) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * StackLit: Fix SG surface option property block to only display energy conserving specular color option for the specular input parametrization (similar to case 1257050) (#3060) * Fixed missing BeginCameraRendering call for custom render mode of a Camera (#3063) * Implement custom drawer for layer mask parameters (#3066) * Adding mixed light baking shadowmask test (#3052) * adding a shadow mask test * Update reference images * Apply the fix * Changelog * Update CHANGELOG.md * fix merge issue Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: Rémi Chapelain <[email protected]> * Fix labels style (#3046) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * Fix labels style * Update CHANGELOG.md Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> * Fixed side effect on styles during compositor rendering. (#3081) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * StackLit: Fix SG surface option property block to only display energy conserving specular color option for the specular input parametrization (similar to case 1257050) (#3060) * Fixed missing BeginCameraRendering call for custom render mode of a Camera (#3063) * Implement custom drawer for layer mask parameters (#3066) * Adding mixed light baking shadowmask test (#3052) * adding a shadow mask test * Update reference images * Changed the clamping approach for RTR and RTGI (in both perf and quality) to improve visual quality. (#3020) Co-authored-by: sebastienlagarde <[email protected]> * Fixed the condition on temporal accumulation in the reflection denoiser (case 1303504). (#3027) Co-authored-by: sebastienlagarde <[email protected]> * Changed the warning message for ray traced area shadows (case 1303410). (#3029) * - Changed the warning message for ray traced area shadows (case 1303410). * Adds approximation information about ray-traced area shadows Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: sebastienlagarde <[email protected]> * Fixed side effect on styles during compositor rendering. * Update CHANGELOG.md * fix merge issue Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Rémi Chapelain <[email protected]> Co-authored-by: anisunity <[email protected]> Co-authored-by: Lewis Jordan <[email protected]> * [HDRP][Compositor] Fix size and spacing of compositor info boxes (#3101) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * StackLit: Fix SG surface option property block to only display energy conserving specular color option for the specular input parametrization (similar to case 1257050) (#3060) * Fixed missing BeginCameraRendering call for custom render mode of a Camera (#3063) * Implement custom drawer for layer mask parameters (#3066) * Adding mixed light baking shadowmask test (#3052) * adding a shadow mask test * Update reference images * Changed the clamping approach for RTR and RTGI (in both perf and quality) to improve visual quality. (#3020) Co-authored-by: sebastienlagarde <[email protected]> * Fixed the condition on temporal accumulation in the reflection denoiser (case 1303504). (#3027) Co-authored-by: sebastienlagarde <[email protected]> * Changed the warning message for ray traced area shadows (case 1303410). (#3029) * - Changed the warning message for ray traced area shadows (case 1303410). * Adds approximation information about ray-traced area shadows Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: sebastienlagarde <[email protected]> * Disabled specular occlusion for what we consider medium and larger scale rtao > 1.25 with a 25cm falloff interval. (#3023) Co-authored-by: sebastienlagarde <[email protected]> * Removed 2505_Area_Light_ShadowMask_Baking from baking queue (#3087) * Lightmaps / Removed scene from baking queue + meta files * update reference screenshots Co-authored-by: Sebastien Lagarde <[email protected]> * Fix size and spacing of compositor info boxes * Fix typo in changelog Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: Rémi Chapelain <[email protected]> Co-authored-by: anisunity <[email protected]> Co-authored-by: Lewis Jordan <[email protected]> * [HDRP][Compositor] Fix color picker UI glitch in the Graphics Compositor (#3105) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * StackLit: Fix SG surface option property block to only display energy conserving specular color option for the specular input parametrization (similar to case 1257050) (#3060) * Fixed missing BeginCameraRendering call for custom render mode of a Camera (#3063) * Implement custom drawer for layer mask parameters (#3066) * Adding mixed light baking shadowmask test (#3052) * adding a shadow mask test * Update reference images * Changed the clamping approach for RTR and RTGI (in both perf and quality) to improve visual quality. (#3020) Co-authored-by: sebastienlagarde <[email protected]> * Fixed the condition on temporal accumulation in the reflection denoiser (case 1303504). (#3027) Co-authored-by: sebastienlagarde <[email protected]> * Changed the warning message for ray traced area shadows (case 1303410). (#3029) * - Changed the warning message for ray traced area shadows (case 1303410). * Adds approximation information about ray-traced area shadows Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: sebastienlagarde <[email protected]> * Disabled specular occlusion for what we consider medium and larger scale rtao > 1.25 with a 25cm falloff interval. (#3023) Co-authored-by: sebastienlagarde <[email protected]> * Removed 2505_Area_Light_ShadowMask_Baking from baking queue (#3087) * Lightmaps / Removed scene from baking queue + meta files * update reference screenshots Co-authored-by: Sebastien Lagarde <[email protected]> * Removed unused index parameter * Fix box light attenuation (#3056) * Fix box light attenuation * Update screenshots Co-authored-by: sebastienlagarde <[email protected]> * Revert "Disabled specular occlusion for what we consider medium and larger scale rtao > 1.25 with a 25cm falloff interval. (#3023)" This reverts commit 55bb6ff781233350ca8f3db747b8593acfbda4a3. * Revert "Revert "Disabled specular occlusion for what we consider medium and larger scale rtao > 1.25 with a 25cm falloff interval. (#3023)"" This reverts commit 57ee23b9177c581f50c8a8ac4e3dfd166646acc7. * Fix default value of _SpecularOcclusionBlend * Fix color picker UI glitch in the Graphics Compositor Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: Rémi Chapelain <[email protected]> Co-authored-by: anisunity <[email protected]> Co-authored-by: Lewis Jordan <[email protected]> * Fix 1299233 ies resize bug (#3094) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * StackLit: Fix SG surface option property block to only display energy conserving specular color option for the specular input parametrization (similar to case 1257050) (#3060) * Fixed missing BeginCameraRendering call for custom render mode of a Camera (#3063) * Implement custom drawer for layer mask parameters (#3066) * Adding mixed light baking shadowmask test (#3052) * adding a shadow mask test * Update reference images * Changed the clamping approach for RTR and RTGI (in both perf and quality) to improve visual quality. (#3020) Co-authored-by: sebastienlagarde <[email protected]> * Fixed the condition on temporal accumulation in the reflection denoiser (case 1303504). (#3027) Co-authored-by: sebastienlagarde <[email protected]> * Changed the warning message for ray traced area shadows (case 1303410). (#3029) * - Changed the warning message for ray traced area shadows (case 1303410). * Adds approximation information about ray-traced area shadows Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: sebastienlagarde <[email protected]> * Disabled specular occlusion for what we consider medium and larger scale rtao > 1.25 with a 25cm falloff interval. (#3023) Co-authored-by: sebastienlagarde <[email protected]> * Fix 1299233 ies resize bug * change log * Update CHANGELOG.md * fix merge issue Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: Rémi Chapelain <[email protected]> Co-authored-by: anisunity <[email protected]> Co-authored-by: Lewis Jordan <[email protected]> * filter for xbone addded (#3116) * [Yamato] Enable cache server for standalone build jobs (#3106) * create standalone_cache jobs * use cache jobs for trunk verification * fix commands so linux can recognise them need to wrap each string around "extra-editor-arg" * Fix undo redo on layered lit editor (#3059) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * Fix undo redo on layered lit editor * Update CHANGELOG.md Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> * [HDRP] Added Vulkan install in system requirements (#3122) * Added vulkan install in system requirements * Reworded content Co-authored-by: Lewis Jordan <[email protected]> * [HDRP] Fix issue with compositor related custom passes (#3055) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * Fix issue with compositor related custom passes still active after disabling the compositor Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> * Fixed some render texture leaks. (#3050) * Fixed Render Graph immediate mode. (#3033) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix issue with shadow mask and area lights (#3019) * Not checking NdotL since it's not really valid for area lights (We have multiple valid light directions, not one) * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issue with capture callback (now includes post processing results) (#3035) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix decal draw order for ShaderGraph decal materials (#3018) * Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed various Look Dev issues after exiting Playmode (#2956) * Fixed access to invalid Contexts references after exiting playmode. * Fixed comparison gizmo after playmode. * Fixes from PR feedback * Fixed a few render texture memory leaks. * Update changelog * Added comment * Update CHANGELOG.md Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> * Hd/fix wizard runtime resources (#3123) * Fix runtim resource wizard fix regression * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fixed lookdev reload bug when viewing a scene object (#3108) * Fixed lookdev reload bug when viewing a scene object * Updated changelog * Re-added lookdev fix Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix error in Depth Of Field near radius blur calculation (#3131) * Fix error in Depth Of Field near radius blur calculation * Fix typo Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix GC allocs (#3136) * Fix gc alloc errors * Avoid setting the name of an object during render (gc alloc) * Avoid gc allocs (for real this time) * Revert: Fix 1299233 ies resize bug (#3094) * Hide light shadow near plane gizmo when shadows are disabled (#3114) Co-authored-by: sebastienlagarde <[email protected]> * Hd/fix backplate globalcubemap2 (#3111) * Removed backplate from rendering of lighting cubemap as it did not really work conceptually and caused artefacts. * Update changelog * Remove useless code * Compilation fix. * Update doc * Update Override-HDRI-Sky.md Co-authored-by: sebastienlagarde <[email protected]> * [HDRP][Path Tracing] Added alpha channel to path traced results (#3127) * Added alpha support changes for path tracing in bugfix branch. * Updated changelog and added doc. Co-authored-by: sebastienlagarde <[email protected]> * Doc update (#3160) * Fix various shader warnings (#3158) * Histogram and scalarization warnings. * Fix warning in probe * Changelog * Update CHANGELOG.md Co-authored-by: Sebastien Lagarde <[email protected]> * Update Override-Screen-Space-GI.md * Fixed shadow matte not working with ambient occlusion when MSAA is en… (#3157) * Fixed shadow matte not working with ambient occlusion when MSAA is enabled * Add MSAA test * update refrence screenshots win dx11 * update DX12 and win vulkan screen * update screenshots for mac * update screen of linux vulkan * Update HDLightUI.cs (#3203) * [HDRP] fix nullref when chaging RP from HDRP to URP (#3191) * Fixed volume atlas release * Updated changelog * fix case 1307653 (#3205) * Fix LookDev env library assignment after leaving playmode. (#3214) * Fixed LookDev environment library assignement after leaving playmode. * Update changelog * Update Hair Shader Preset Documentation (#3208) * Correct the language for hair shader documentation. * Update hair-shader.md * Update hair-shader.md Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix locale diffusion profile shader property value in ShaderGraph (#3213) * Fixed diffusion profile shader property float values using the current culture instead of invariant * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix error in the RTHandle scale of Depth Of Field when TAA is enabled (#3182) Co-authored-by: sebastienlagarde <[email protected]> * Reset to current quality settings after preprocess build in HDRP (#3218) Co-authored-by: sebastienlagarde <[email protected]> * Have bilinear default (#3223) Co-authored-by: Sebastien Lagarde <[email protected]> * Update CHANGELOG.md * Added missing character to the layered lit document (#3310) * Fix needs of exposure for debug display "SSR Transparent" (#3308) * Fix needs of exposure for debug display "SSR Transparent" * Add Change Log * [HDRP] Fix GUI exception in material UI (#3315) * Fixed an exception when opening the color picker in a material UI * Updated changelog * [HDRP] Update decal angle fade tooltip (#3322) * Added tooltip in decal fade angle prop * Updated changelog * Mention in TAA doc that a certain use case will lead to problems. (#3317) * Doc update. * Review feedback. * Hide shadow resolution value (#3335) * Bump timer of 2nd runtime test to make it work on all platforms. (#3314) * Bump wait * Bump timer again * Revert "Bump timer again" This reverts commit 6bfc7943a6173025d8d268477e3985b0479e6922. * Fix light frustum planes (#3341) * Project skybox without perspective for ortho cameras (#2955) * [HDRP] Fix coat normal space (#2888) * Fix coat normal space * Update CHANGELOG.md Co-authored-by: Sebastien Lagarde <[email protected]> * Avoid issues causing faulty transitions in shadows (resulting in no shadows with unconventional aspect ratio) (#2776) * Fixed volume component tooltips using the same parameter name (#2754) * Use the proper history info for Bicubic resampling in TAA (#2759) * Use proper info for previous buffer info * changelog * Fixed lookdev movement (#2757) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix issue with saving some quality settings in volume overrides (#2758) * Fix issue with saving some quality settings volume overrides * Fix typo in changelog Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fixed NullReferenceException in HDRenderPipeline.UpgradeResourcesIfNeeded (case 1292524) (#2765) * fix issue with confusing text (#2766) * Fix * Fix white dots * Changelog * Rename the sunrise icon to fix typo, causing issue with 2x resolution loading. (#2809) * [HDRP] Rename HDRP to HD Render Pipeline in menu item (#2819) * [HDRP] Update HDRP menu in shader graph * Update CHANGELOG.md * HDRP/Fix package version showing package after the last "verified" package (#2783) * Fix typo * Remove last version checker from wizard and add link to package manager instead * Update CHANGELOG.md * Update documentation * Update Render-Pipeline-Wizard.md Co-authored-by: Sebastien Lagarde <[email protected]> * Revert bad changelog merge * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: sebastienlagarde <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: John Parsaie <[email protected]> Co-authored-by: Remi Slysz <[email protected]> * Fixed invalid loop length for probe baking (case 1289680) (#2830) * Fixed invalid loop length for probe baking (case 1289680) # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * Fix volumetric fog with XR single-pass (#2823) * fix volumetric fog with XR single-pass rendering * update changelog Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix rendering issues for the first frame (#2836) * Fix first frame exposure, depth pyramid / AO * Update changelog * Comment * Typo * Add missing RenderGraphBuilder.ReadTexture call * Move ComputePackedMipChainInfo at the beginning of ExecuteWithRenderGraph Co-authored-by: sebastienlagarde <[email protected]> * Update 5001_Fog_FogFallback.png * Revert "Update 5001_Fog_FogFallback.png" This reverts commit 2653b9c6f42670ba1c46090b1d1e0118f7d0fe6a. * Update 5001_Fog_FogFallback.unity * Fix AOV API for render graph (#2909) * Fix AOV api in rendergraph # Conflicts: # com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs * Update changelog * Fix a small discrepancy in the marker placement in light intensity sliders (#2924) * Update CHANGELOG.md * Fix issue with VT spewing errors when transparent and opaque are disabled (#2925) * Fix * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed a bug in the sphere-aabb light cluster (case 1294767). (#2920) Co-authored-by: sebastienlagarde <[email protected]> * Move EndCameraRendering callback out of the profiling scope (#2917) * Move EndCameraRendering callback out of the profiling scope * added a comment Co-authored-by: sebastienlagarde <[email protected]> * Fixed baked light being included into the ray tracing light cluster (case 1296203). (#2915) Co-authored-by: sebastienlagarde <[email protected]> * Handle all enums the same way for UI (#2913) Co-authored-by: sebastienlagarde <[email protected]> * Changed the message when the graphics device doesn't support ray tracing (case 1287355). (#2916) * [HDRP] Fix default blocks for Hair and Eye shader graphs (#2919) * Fixed default eye shader blocks * Fix missing emission block in hair shader * Updated changelog Co-authored-by: sebastienlagarde <[email protected]> * Init scene camera debug framesettings (#2931) * Fixed using the wrong method to define if a light should be included in the light cluster depending on its baking status. (#2932) * - Fixed using the wrong method to define if a light should be included in the light cluster depending on its baking status. * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Change the behavior of custom passes when the volume is disabled (#2930) * Changed the behavior of custom passes when the Custom Pass Volume component is disabled * Updated changelog * Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels (#2921) * Fixed display of LOD Bias and maximum level in frame settings when using Quality Levels * Update changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed an issue when trying to open a look dev env library when Look Dev is not supported. (#2929) * Fixed an issue when trying to open a look dev env library when Look Dev is not supported. * Update changelog Co-authored-by: sebastienlagarde <[email protected]> * Enable Reflector for Spotlight by default * - Fixed shader graph not supporting indirectdxr multibounce (case 1294694). (#2933) Co-authored-by: sebastienlagarde <[email protected]> * Fixed the planar depth texture not being properly created and rendered to (case 1299617). (#2926) * Fixed the planar depth texture not being properly created and rendered to (case 1299617). * adding comment Co-authored-by: sebastienlagarde <[email protected]> * Fixed C# 8 compilation issue with turning on nullable checks (case 1300167) (#2949) * Fixed C# 8 compilation issue with turning on nullable checks - bis (#2951) * Fixed C# 8 compilation issue with turning on nullable checks (case 1300167) * Update MaterialDebug.cs * Fix scripting light test with enableReflector true by default * Project skybox without perspective for ortho cameras * Explicit orthographic argument Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: FrancescoC-unity <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: John Parsaie <[email protected]> Co-authored-by: Remi Slysz <[email protected]> Co-authored-by: Frédéric Vauchelles <[email protected]> Co-authored-by: Fabien Houlmann <[email protected]> Co-authored-by: anisunity <[email protected]> Co-authored-by: JulienIgnace-Unity <[email protected]> * Fix non temporal SSAO issues with the rendergraph pass (#3351) * Fix * changelog * Reset ambient probe upon switching to very different skies (#3340) * Set ambient probe to black when there is a big difference * Changelog * Fix a couple of things * Change name Co-authored-by: sebastienlagarde <[email protected]> * Fix white flash on camera cuts with volumetric (#3354) * Have two frames with reprojection off on cut (due to exposure) * changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix issues with light layers issues when editing multiple lights (#3323) * Avoid syncing light layers when we have multiple values. * Changelog Co-authored-by: sebastienlagarde <[email protected]> * Maximum of reflection distance must be bound by the min of all dimensions, (#3329) not the maximum. * Fixed debug panel reseting when going through enum items (#3370) * tentative fix for enum navigation in the runtime debug UI * Update changelog Co-authored-by: sebastienlagarde <[email protected]> * Fix keywords with fbx importer (#3350) Co-authored-by: sebastienlagarde <[email protected]> * Fixed lightmaps not working properly with shader graphs in ray traced reflections (case 1305335). (#3352) Co-authored-by: sebastienlagarde <[email protected]> * revert: Reset ambient probe upon switching to very different skies (#3340) * Hdrp/fix tesselation wireframe (#3355) * SCENEPICKING pass was utilizing a camera that had relative rendering on, however world positions in SCENEPICKING are absolute. This causes inconsystencies in tesselation wireframe view. This fix corrects the offset of worldspace on tesselation for SCENEPICKING pass. * Correct range (0 to 1) in order to get pixel accurage projection value. * Moving function to LitDataMeshModification.hlsl for clarity. * Changing CameraView matrix instead of offsetting the position using macro forwarding. * Redirecting camera matrix more cleanly. * Reordering picking transforms include for proper macro order. * Changelog description Co-authored-by: sebastienlagarde <[email protected]> * Adding missing meta from HDRP_test * Hd/fix input registering domain reload (#3373) * Update InputRegistering.cs * Remove asset modification if InputSystem package is in use * Prevent missuse of InputRegistering while InputSystem package is in use * Update CHANGELOG.md * cleaning * more cleaning * Update code to use Next instead of GetArrayElementAtIndex * Fix nullref (#3460) Co-authored-by: sebastienlagarde <[email protected]> * Fix DepthOfField CoC debug view (#3466) * Push stuff for debug * changelog Co-authored-by: sebastienlagarde <[email protected]> * Fixed an issue with first frame of ao causing some kind of ghosting e… (#3457) * Fixed an issue with first frame of ao causing some kind of ghosting effect. * Update changelog * Fix mipmap generation internal format (#3470) Co-authored-by: sebastienlagarde <[email protected]> * Change wizard check to be ok with -force api (#3422) * Delete Volumes.meta * revert: Hd/fix input registering domain reload #3373 * update Vulkan win reference screenshots * Fixed performance issue with ShaderGraph and Alpha Test * Fixed dimensionality of a couple vectors (from 3 to 2). (#3395) * Fix error when increasing the maximum planar reflection limit (#3332) Co-authored-by: sebastienlagarde <[email protected]> * Updated documentation of RequestRenderNextUpdate (#3368) * Updated documentation of RequestRenderNextUpdate * Fixed documentation * Update HDProbe.cs * Update HDAdditionalReflectionData.cs Co-authored-by: Lewis Jordan <[email protected]> * Fix alpha output in AOVs and debug views when using shadow matte (#3593) * Fix shader compile error with debug output and shadow matte * Correct alpha output in AOVs and material debug when using shadow matte * Update changelog * Added an additional check in the "check scene for ray tracing" (case 1314963). (#3616) * Fixed an issue with transparent meshes writing their depths and recursive rendering (case 1314409). (#3619) * Fixed issue with compositor custom pass hooks added/removed repeatedly (#3613) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fixed SSR with SSR_Transparent (#3603) * Fixed SSR used with transparent: Keyword overrided * Change Log Co-authored-by: sebastienlagarde <[email protected]> * Decal in material debug display (#3608) Co-authored-by: sebastienlagarde <[email protected]> * Formatting * Hd/fix pivot size ratio percistency through 0 (#3600) * Change default pivot * Fix ratio persistency through 0 size (case 1308338) * Update CHANGELOG.md * Added multi edition support * Add missing Undo recording * Fix multi edition initialization and multiple state display and targets used in OnSceneGUI * Add missing projection update * Fix inspector refresh when there is multiple different value and we edit them (remove multiple state) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix volume component nullref (#3644) * Fixed nullref when adding a volume component in a Volume profile asset * Updated changelog * Fixed decal normal for double sided materials (case 1312065) (#3610) * Fixed decal normal for double sided materials (case 1312065) * Simplify mirror mode * Update DecalUtilities.hlsl * Update DecalUtilities.hlsl * Updates graphic test * Update screenshots Co-authored-by: sebastienlagarde <[email protected]> * Fixed render graph resource log to display properly MB and improved readability. (#3638) * Display a warning help box when decal atlas is out of size (#3634) Co-authored-by: sebastienlagarde <[email protected]> * Improved render texture debug names (#3631) * Fixing ordering of UI Frame settings [Fogbugz 1315452] (#3628) * Fixing wrong ordering of frame settings on the UI. Ignoring enums that are tagged as obsolete. * Moving reflection call to its own utility function, and caching frame settings names. * Adding changelog changes. Co-authored-by: sebastienlagarde <[email protected]> * Port change. (#3656) * Fix issue with velocity rejection in post-DoF TAA (#3672) * Unify Emissive mapping options on lit shaders (#3606) * Add POM to emissive on tessellated shaders * Fix uv1 for lit shaders * Updated graphic test * reenable test * Update screenshots (test for linux) Co-authored-by: sebastienlagarde <[email protected]> * Fix a leak cause for area light cookies (#3614) * Add border around texture when blitting * Comments * tentative fix * Actual fix. * Update 5001_PathTracing.png * Update 1202_Lit_DoubleSideNormalMode.unity * Hd/alpha to mask frame setting fix 1315452 (#3681) * OverridableFrameSettingsArea.Field.overrideable and OverridableFrameSettingsArea.Field.customOverrideable are duplicate delegates: - They are only called in OverridableFrameSettingsArea.Field.IsOverrideableWithDependencies. - overrideable first gets a chance to declare the field as not overridable, and then customOverrideable gets a chance to override the final result. - customOverrideable is called once for each FrameSettingsFieldAttribute.dependencies, sometimes resulting in duplicate run of the same function with the same input multiple times. - customOverrideable is also coupled with some "positive / negative dependency" system making it hard to understand unnecessarily. It is neater to keep only OverridableFrameSettingsArea.Field.overrideable and delete OverridableFrameSettingsArea.Field.customOverrideable, while adding a ignoreOverride boolean. * With the previous commit, declaring a field with both positive and negative dependency no longer has weird problem with custom override-able delegate. So we give AlphaToMask a positive and a negative dependency as is needed. But still the AlphaToMask field needs a custom override-able delegate to handle cases like when HDRP Asset force deferred while frame setting has forward Lit Shader Mode, so we added a custom override-able delegate too. * update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * Hd/rough distortion fix 1317952 (#3683) * Fix Rough Distortion frame setting not greyed out when Distortion is disabled in HDRP Asset * update CHANGELOG.md * Fix issue with physically-based DoF computation and transparent materials with depth-writes ON. (#3689) Co-authored-by: Sebastien Lagarde <[email protected]> * Update RaytracingIntersection.hlsl (#3703) * Hd/fix access current hdrp asset for default frame settings 1317968 (#3695) * Fix issue of accessing default frame setting stored in current HDRPAsset instead fo the default HDRPAsset * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * Fix SSGI frame setting not greyed out while SSGI is disabled in HDRP Asset (#3693) * Fix SSGI frame setting not greyed out while SSGI is disabled in HDRP Asset * Update CHANGELOG.md Co-authored-by: sebastienlagarde <[email protected]> * Reduced the maximal number of bounces for both RTGI and RTR (case 1318876). (#3864) * Fix scene being fully grey on playstation when histogram exposure is used but not curve remapping (#3867) * Allocate the curve texture always * Changelog * fix faulty lights (#3870) * Fixed indent level on material Global Illumination field (#3881) * [HDRP] Disc light realtime gi UI error (#3866) * Added an error in the UI when trying to use disk lights with realtime GI * Updated changelog * Remove useless shaders from the creation menu (#3893) * Fixed HDRPAsset loosing its reference to the ray tracing resources when clicking on a different quality level that doesn't have ray tracing (case 1320304). (#3894) * Fixed error message when having MSAA and Screen Space Shadows (case 1318698). (#3865) Co-authored-by: sebastienlagarde <[email protected]> * Fixed Nans happening in RTR when the history render target is bigger than the current viewport (case 1321139). (#3876) Co-authored-by: sebastienlagarde <[email protected]> * [HDRP] Fix tube light mode (#3871) * Fixed tube light mode selection (case 1317776) * Updated changelog * PR fixes Co-authored-by: sebastienlagarde <[email protected]> * Added tooltips for features being disabled because of MSAA/Raytracing (#3879) * Added tooltips to warn when some features may be disabled. * Update change log * Formatting * Update CHANGELOG.md * Changed the behavior of the clear coat and SSR/RTR for the stack lit to mimic the Lit's behavior (case 1320154). (#3872) * Changed the behavior of the clear coat and SSR/RTR for the stack lit to mimic the Lit's behavior (case 1320154). * Added information about using clear coat with rtr * Reference image meta file (long time oversight) * Modifying test 1302_03 Stacklit to make it fail with new fix * Update reference images Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: Remi Chapelain <[email protected]> * Fix warning for ShadowLoop (#3885) * Fix warning and changelog * Fix formating * Remove unused variable * Unused variable Co-authored-by: SoufianeKHIAT <[email protected]> * Fix SSR for 4K Render Target (#3874) * Fix SSR for 4K (tested on volumetric cloud demo) * Add ChangeLog Co-authored-by: sebastienlagarde <[email protected]> * Fix GBuffer debug view when using virtual texturing (#3880) * Fix gbuffer debug view * changelog Co-authored-by: sebastienlagarde <[email protected]> * Bugfix 1319005: Fix fog noise issues (#3891) * Fix fog noise issues * Code comment + changelog update * Proper fix for near-plane issue * Updated reference images Co-authored-by: Sebastien Lagarde <[email protected]> * Fix Decal Normal Blending NaN (Case #1317162) (#3883) * Apply the nan guard fix * Changelog * Move the epsilon onto the same line * Remove the nan fix via normal blend weight epsilon * Suppress the nan via safe normalize for the zero length normal Co-authored-by: sebastienlagarde <[email protected]> * Fixed issue in wizard when resource folder not exist (#3907) Co-authored-by: sebastienlagarde <[email protected]> * Fix for Xbox device types in SubSurfaceScattering (#3942) * [CI] Updated pinned editor versions * Fix for Xbox device types in SubSurfaceScattering Co-authored-by: [email protected] <[email protected]> * Fixed issue with Decal projector edge on Metal (case 1286074) (#3941) * Fix normal and update ref images. (#3928) Co-authored-by: sebastienlagarde <[email protected]> * Fix diffusion profile doc (#3968) * Fixed a potential issue causing the custom pass UI drawers to not render correctly when using custom properties. (#3898) * Moved the leaf example from sss to translucent (#3990) * Merge branch 'master' into hd/bugfix * Added rough distortion to the frame settings (#3991) Co-authored-by: Sebastien Lagarde <[email protected]> * Fix Render Graph UI bug in Render Pipeline Debugger (#3992) * Fix * Changelog Co-authored-by: Sebastien Lagarde <[email protected]> * Fixed formatting issue and reworded some bits in the motion vectors page (#3987) * Fixed image formatting * Attempted to reorder information to make it clearer * Added a more explicit note for object motion vectors * Added a fallback for the ray traced directional shadow in case of a transmission (case 1307870). (#3882) * Added a fallback for the ray traced directional shadow in case of a transmission (case 1307870). * Changes requested by the review * Documented fix. Documented this bugfix in the Light Types guide section of Light-component.md. * Typo fix (whoops) * Moved fix documentation Moved documentation to the Ray-Traced-Shadows.md page. * fixing old typo Co-authored-by: Vic-Cooper <[email protected]> Co-authored-by: Remi Chapelain <[email protected]> * Fix sss in planar reflections planar (#3919) * Fix SSS materials in planar reflections * Proper fix * Undo matrix rename Co-authored-by: sebastienlagarde <[email protected]> * Added note about SSGI and RTGI replacing all lightmap and light probe data (#3913) * fix pivot edit mode 2D slider gizmo not supporting multi-edition (decal) (#3908) Co-authored-by: sebastienlagarde <[email protected]> * Merge branch 'master' into hd/bugfix * [HDRP][Fogbugz 1325312] Hdrp/fix inverted y on cas (#4027) * Fixing missing of inverted Y on non dev player builds for CAS with DRS * Changelog updates * SceneObjectIDMap: Fix a nasty bug where game object to entry index dictionary would get out of sync from the entries list (#4038) * SceneObjectIDMap: Fix a nasty bug where gameobject to entry index dictionary would get out of sync from the entries list after an insertion occurred to fill a hole. This resulted in a nasty bug where reflection probes would occasionally generate the same bake texture filename as eachother, would overwrite eachothers textures, and would point to the same texture after the bake completed. Issue can be reproduced by baking, removing reflection probes, adding new reflection probes, and baking again. * Update CHANGELOG.md Co-authored-by: pastasfuture <[email protected]> * Fix shader compil issue on PS4 in Stacklit.hlsl (#4064) * [Fogbugz 1325700] Fixing volumetric screen zmask & depth pyramid for hw drs (#4050) * FIxing volumetric drs tmp screen zmask textures and also the depth pyramid, to consider hardware DRS when its on * Changelog * Added todo comment. * Update StackLit.hlsl * HD/Decals: allows negative UV (#4083) Decals: allows negative UV (#4083) * Add new CB API and refactor a bit of shadow init * Changelog * Fix typos * Fixes * Use new API * Fix GCAlloc * Fix issue post merge * Fix formatting issue Co-authored-by: Kleber Garcia <[email protected]> Co-authored-by: JulienIgnace-Unity <[email protected]> Co-authored-by: Sebastien Lagarde <[email protected]> Co-authored-by: Pavlos Mavridis <[email protected]> Co-authored-by: Antoine Lelievre <[email protected]> Co-authored-by: slunity <[email protected]> Co-authored-by: Adrien de Tocqueville <[email protected]> Co-authored-by: Rémi Chapelain <[email protected]> Co-authored-by: anisunity <[email protected]> Co-authored-by: John Parsaie <[email protected]> Co-authored-by: Lewis Jordan <[email protected]> Co-authored-by: skhiat <[email protected]> Co-authored-by: Martin Thorzen <[email protected]> Co-authored-by: Sophia <[email protected]> Co-authored-by: Remi Slysz <[email protected]> Co-authored-by: Emmanuel Turquin <[email protected]> Co-authored-by: jenniferd-unity <[email protected]> Co-authored-by: Frédéric Vauchelles <[email protected]> Co-authored-by: Fabien Houlmann <[email protected]> Co-authored-by: victorsclui <[email protected]> Co-authored-by: Remi Chapelain <[email protected]> Co-authored-by: SoufianeKHIAT <[email protected]> Co-authored-by: Jarkko Lempiäinen <[email protected]> Co-authored-by: Adrian1066 <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Vic-Cooper <[email protected]> Co-authored-by: pastasfuture <[email protected]> # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md # com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowAtlas.cs # com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowManager.cs # com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDDynamicShadowAtlas.cs # com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowAtlas.cs # com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowManager.cs
1 parent 9061b15 commit cbf9bde

File tree

8 files changed

+267
-108
lines changed

8 files changed

+267
-108
lines changed

com.unity.render-pipelines.core/Runtime/Common/ConstantBuffer.cs

Lines changed: 132 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class ConstantBuffer
1919
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
2020
public static void PushGlobal<CBType>(CommandBuffer cmd, in CBType data, int shaderId) where CBType : struct
2121
{
22-
var cb = TypedConstantBuffer<CBType>.instance;
22+
var cb = ConstantBufferSingleton<CBType>.instance;
2323

2424
cb.UpdateData(cmd, data);
2525
cb.SetGlobal(cmd, shaderId);
@@ -35,7 +35,7 @@ public static void PushGlobal<CBType>(CommandBuffer cmd, in CBType data, int sha
3535
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
3636
public static void Push<CBType>(CommandBuffer cmd, in CBType data, ComputeShader cs, int shaderId) where CBType : struct
3737
{
38-
var cb = TypedConstantBuffer<CBType>.instance;
38+
var cb = ConstantBufferSingleton<CBType>.instance;
3939

4040
cb.UpdateData(cmd, data);
4141
cb.Set(cmd, cs, shaderId);
@@ -51,7 +51,7 @@ public static void Push<CBType>(CommandBuffer cmd, in CBType data, ComputeShader
5151
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
5252
public static void Push<CBType>(CommandBuffer cmd, in CBType data, Material mat, int shaderId) where CBType : struct
5353
{
54-
var cb = TypedConstantBuffer<CBType>.instance;
54+
var cb = ConstantBufferSingleton<CBType>.instance;
5555

5656
cb.UpdateData(cmd, data);
5757
cb.Set(mat, shaderId);
@@ -65,7 +65,7 @@ public static void Push<CBType>(CommandBuffer cmd, in CBType data, Material mat,
6565
/// <param name="data">Input data of the constant buffer.</param>
6666
public static void UpdateData<CBType>(CommandBuffer cmd, in CBType data) where CBType : struct
6767
{
68-
var cb = TypedConstantBuffer<CBType>.instance;
68+
var cb = ConstantBufferSingleton<CBType>.instance;
6969

7070
cb.UpdateData(cmd, data);
7171
}
@@ -78,7 +78,7 @@ public static void UpdateData<CBType>(CommandBuffer cmd, in CBType data) where C
7878
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
7979
public static void SetGlobal<CBType>(CommandBuffer cmd, int shaderId) where CBType : struct
8080
{
81-
var cb = TypedConstantBuffer<CBType>.instance;
81+
var cb = ConstantBufferSingleton<CBType>.instance;
8282

8383
cb.SetGlobal(cmd, shaderId);
8484
}
@@ -92,7 +92,7 @@ public static void SetGlobal<CBType>(CommandBuffer cmd, int shaderId) where CBTy
9292
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
9393
public static void Set<CBType>(CommandBuffer cmd, ComputeShader cs, int shaderId) where CBType : struct
9494
{
95-
var cb = TypedConstantBuffer<CBType>.instance;
95+
var cb = ConstantBufferSingleton<CBType>.instance;
9696

9797
cb.Set(cmd, cs, shaderId);
9898
}
@@ -105,13 +105,13 @@ public static void Set<CBType>(CommandBuffer cmd, ComputeShader cs, int shaderId
105105
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
106106
public static void Set<CBType>(Material mat, int shaderId) where CBType : struct
107107
{
108-
var cb = TypedConstantBuffer<CBType>.instance;
108+
var cb = ConstantBufferSingleton<CBType>.instance;
109109

110110
cb.Set(mat, shaderId);
111111
}
112112

113113
/// <summary>
114-
/// Release all currently allocated constant buffers.
114+
/// Release all currently allocated singleton constant buffers.
115115
/// This needs to be called before shutting down the application.
116116
/// </summary>
117117
public static void ReleaseAll()
@@ -122,86 +122,148 @@ public static void ReleaseAll()
122122
m_RegisteredConstantBuffers.Clear();
123123
}
124124

125-
internal abstract class ConstantBufferBase
126-
{
127-
public abstract void Release();
128-
}
129-
130125
internal static void Register(ConstantBufferBase cb)
131126
{
132127
m_RegisteredConstantBuffers.Add(cb);
133128
}
129+
}
134130

135-
class TypedConstantBuffer<CBType> : ConstantBufferBase where CBType : struct
136-
{
137-
// Used to track all global bindings used by this CB type.
138-
HashSet<int> m_GlobalBindings = new HashSet<int>();
139-
// Array is required by the ComputeBuffer SetData API
140-
CBType[] m_Data = new CBType[1];
131+
/// <summary>
132+
/// The base class of Constant Buffer.
133+
/// </summary>
134+
public abstract class ConstantBufferBase
135+
{
136+
/// <summary>
137+
/// Release the constant buffer.
138+
/// </summary>
139+
public abstract void Release();
140+
}
141141

142-
static TypedConstantBuffer<CBType> s_Instance = null;
143-
internal static TypedConstantBuffer<CBType> instance
144-
{
145-
get
146-
{
147-
if (s_Instance == null)
148-
s_Instance = new TypedConstantBuffer<CBType>();
149-
return s_Instance;
150-
}
151-
set
152-
{
153-
s_Instance = value;
154-
}
155-
}
156-
ComputeBuffer m_GPUConstantBuffer = null;
157142

158-
TypedConstantBuffer()
159-
{
160-
m_GPUConstantBuffer = new ComputeBuffer(1, UnsafeUtility.SizeOf<CBType>(), ComputeBufferType.Constant);
161-
ConstantBuffer.Register(this);
162-
}
143+
/// <summary>
144+
/// An instance of a constant buffer.
145+
/// </summary>
146+
/// <typeparam name="CBType">The type of structure representing the constant buffer data.</typeparam>
147+
public class ConstantBuffer<CBType> : ConstantBufferBase where CBType : struct
148+
{
149+
// Used to track all global bindings used by this CB type.
150+
HashSet<int> m_GlobalBindings = new HashSet<int>();
151+
// Array is required by the ComputeBuffer SetData API
152+
CBType[] m_Data = new CBType[1];
163153

164-
public void UpdateData(CommandBuffer cmd, in CBType data)
165-
{
166-
m_Data[0] = data;
154+
155+
ComputeBuffer m_GPUConstantBuffer = null;
156+
157+
/// <summary>
158+
/// Constant Buffer constructor.
159+
/// </summary>
160+
public ConstantBuffer()
161+
{
162+
m_GPUConstantBuffer = new ComputeBuffer(1, UnsafeUtility.SizeOf<CBType>(), ComputeBufferType.Constant);
163+
}
164+
165+
/// <summary>
166+
/// Update the GPU data of the constant buffer.
167+
/// </summary>
168+
/// <param name="cmd">Command Buffer used to execute the graphic commands.</param>
169+
/// <param name="data">Input data of the constant buffer.</param>
170+
public void UpdateData(CommandBuffer cmd, in CBType data)
171+
{
172+
m_Data[0] = data;
167173
#if UNITY_2021_1_OR_NEWER
168-
cmd.SetBufferData(m_GPUConstantBuffer, m_Data);
174+
cmd.SetBufferData(m_GPUConstantBuffer, m_Data);
169175
#else
170-
cmd.SetComputeBufferData(m_GPUConstantBuffer, m_Data);
176+
cmd.SetComputeBufferData(m_GPUConstantBuffer, m_Data);
171177
#endif
172-
}
178+
}
173179

174-
public void SetGlobal(CommandBuffer cmd, int shaderId)
175-
{
176-
m_GlobalBindings.Add(shaderId);
177-
cmd.SetGlobalConstantBuffer(m_GPUConstantBuffer, shaderId, 0, m_GPUConstantBuffer.stride);
178-
}
180+
/// <summary>
181+
/// Bind the constant buffer globally.
182+
/// </summary>
183+
/// <param name="cmd">Command Buffer used to execute the graphic commands.</param>
184+
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
185+
public void SetGlobal(CommandBuffer cmd, int shaderId)
186+
{
187+
m_GlobalBindings.Add(shaderId);
188+
cmd.SetGlobalConstantBuffer(m_GPUConstantBuffer, shaderId, 0, m_GPUConstantBuffer.stride);
189+
}
179190

180-
public void Set(CommandBuffer cmd, ComputeShader cs, int shaderId)
181-
{
182-
cmd.SetComputeConstantBufferParam(cs, shaderId, m_GPUConstantBuffer, 0, m_GPUConstantBuffer.stride);
183-
}
191+
/// <summary>
192+
/// Bind the constant buffer to a compute shader.
193+
/// </summary>
194+
/// <param name="cmd">Command Buffer used to execute the graphic commands.</param>
195+
/// <param name="cs">Compute shader to which the constant buffer should be bound.</param>
196+
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
197+
public void Set(CommandBuffer cmd, ComputeShader cs, int shaderId)
198+
{
199+
cmd.SetComputeConstantBufferParam(cs, shaderId, m_GPUConstantBuffer, 0, m_GPUConstantBuffer.stride);
200+
}
201+
202+
/// <summary>
203+
/// Bind the constant buffer to a material.
204+
/// </summary>
205+
/// <param name="mat">Material to which the constant buffer should be bound.</param>
206+
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
207+
public void Set(Material mat, int shaderId)
208+
{
209+
// This isn't done via command buffer because as long as the buffer itself is not destroyed,
210+
// the binding stays valid. Only the commit of data needs to go through the command buffer.
211+
// We do it here anyway for now to simplify user API.
212+
mat.SetConstantBuffer(shaderId, m_GPUConstantBuffer, 0, m_GPUConstantBuffer.stride);
213+
}
214+
215+
/// <summary>
216+
/// Update the GPU data of the constant buffer and bind it globally.
217+
/// </summary>
218+
/// <param name="cmd">Command Buffer used to execute the graphic commands.</param>
219+
/// <param name="data">Input data of the constant buffer.</param>
220+
/// <param name="shaderId">Shader porperty id to bind the constant buffer to.</param>
221+
public void PushGlobal(CommandBuffer cmd, in CBType data, int shaderId)
222+
{
223+
UpdateData(cmd, data);
224+
SetGlobal(cmd, shaderId);
225+
}
226+
227+
/// <summary>
228+
/// Release the constant buffers.
229+
/// </summary>
230+
public override void Release()
231+
{
232+
// Depending on the device, globally bound buffers can leave stale "valid" shader ids pointing to a destroyed buffer.
233+
// In DX11 it does not cause issues but on Vulkan this will result in skipped drawcalls (even if the buffer is not actually accessed in the shader).
234+
// To avoid this kind of issues, it's good practice to "unbind" all globally bound buffers upon destruction.
235+
foreach (int shaderId in m_GlobalBindings)
236+
Shader.SetGlobalConstantBuffer(shaderId, (ComputeBuffer)null, 0, 0);
237+
m_GlobalBindings.Clear();
184238

185-
public void Set(Material mat, int shaderId)
239+
CoreUtils.SafeRelease(m_GPUConstantBuffer);
240+
}
241+
}
242+
243+
class ConstantBufferSingleton<CBType> : ConstantBuffer<CBType> where CBType : struct
244+
{
245+
static ConstantBufferSingleton<CBType> s_Instance = null;
246+
internal static ConstantBufferSingleton<CBType> instance
247+
{
248+
get
186249
{
187-
// This isn't done via command buffer because as long as the buffer itself is not destroyed,
188-
// the binding stays valid. Only the commit of data needs to go through the command buffer.
189-
// We do it here anyway for now to simplify user API.
190-
mat.SetConstantBuffer(shaderId, m_GPUConstantBuffer, 0, m_GPUConstantBuffer.stride);
250+
if (s_Instance == null)
251+
{
252+
s_Instance = new ConstantBufferSingleton<CBType>();
253+
ConstantBuffer.Register(s_Instance);
254+
}
255+
return s_Instance;
191256
}
192-
193-
public override void Release()
257+
set
194258
{
195-
// Depending on the device, globally bound buffers can leave stale "valid" shader ids pointing to a destroyed buffer.
196-
// In DX11 it does not cause issues but on Vulkan this will result in skipped drawcalls (even if the buffer is not actually accessed in the shader).
197-
// To avoid this kind of issues, it's good practice to "unbind" all globally bound buffers upon destruction.
198-
foreach (int shaderId in m_GlobalBindings)
199-
Shader.SetGlobalConstantBuffer(shaderId, (ComputeBuffer)null, 0, 0);
200-
m_GlobalBindings.Clear();
201-
202-
CoreUtils.SafeRelease(m_GPUConstantBuffer);
203-
s_Instance = null;
259+
s_Instance = value;
204260
}
205261
}
262+
263+
public override void Release()
264+
{
265+
base.Release();
266+
s_Instance = null;
267+
}
206268
}
207269
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
168168
- Fixed usage of Panini Projection with floating point HDRP and Post Processing color buffers.
169169
- Fixed a NaN generating in Area light code.
170170
- Fixed CustomPassUtils scaling issues when used with RTHandles allocated from a RenderTexture.
171+
- Fixed issue with constant buffer being stomped on when async tasks run concurrently to shadows.
171172

172173
### Changed
173174
- Removed the material pass probe volumes evaluation mode.

com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowAtlas.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public HDCachedShadowAtlas(ShadowMapType type)
7777
m_ShadowType = type;
7878
}
7979

80-
public override void InitAtlas(RenderPipelineResources renderPipelineResources, RenderGraph renderGraph, bool useSharedTexture, int width, int height, int atlasShaderID, Material clearMaterial, int maxShadowRequests, HDShadowInitParameters initParams, BlurAlgorithm blurAlgorithm = BlurAlgorithm.None, FilterMode filterMode = FilterMode.Bilinear, DepthBits depthBufferBits = DepthBits.Depth16, RenderTextureFormat format = RenderTextureFormat.Shadowmap, string name = "")
80+
public override void InitAtlas(HDShadowAtlasInitParameters atlasInitParams)
8181
{
82-
base.InitAtlas(renderPipelineResources, renderGraph, useSharedTexture, width, height, atlasShaderID, clearMaterial, maxShadowRequests, initParams, blurAlgorithm, filterMode, depthBufferBits, format, name);
82+
base.InitAtlas(atlasInitParams);
8383
m_IsACacheForShadows = true;
8484

8585
m_AtlasResolutionInSlots = HDUtils.DivRoundUp(width, m_MinSlotSize);
@@ -91,7 +91,7 @@ public override void InitAtlas(RenderPipelineResources renderPipelineResources,
9191

9292
// Note: If changing the characteristics of the atlas via HDRP asset, the lights OnEnable will not be called again so we are missing them, however we can explicitly
9393
// put them back up for placement. If this is the first Init of the atlas, the lines below do nothing.
94-
DefragmentAtlasAndReRender(initParams);
94+
DefragmentAtlasAndReRender(atlasInitParams.initParams);
9595
m_CanTryPlacement = true;
9696
m_NeedOptimalPacking = true;
9797
}

com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDCachedShadowManager.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,16 @@ private HDCachedShadowManager()
274274
areaShadowAtlas = new HDCachedShadowAtlas(ShadowMapType.AreaLightAtlas);
275275
}
276276

277-
internal void InitPunctualShadowAtlas(RenderPipelineResources renderPipelineResources, RenderGraph renderGraph, bool useSharedTexture, int width, int height, int atlasShaderID, Material clearMaterial, int maxShadowRequests, HDShadowInitParameters initParams,
278-
HDShadowAtlas.BlurAlgorithm blurAlgorithm = HDShadowAtlas.BlurAlgorithm.None, FilterMode filterMode = FilterMode.Bilinear, DepthBits depthBufferBits = DepthBits.Depth16, RenderTextureFormat format = RenderTextureFormat.Shadowmap, string name = "")
277+
internal void InitPunctualShadowAtlas(HDShadowAtlas.HDShadowAtlasInitParameters atlasInitParams)
279278
{
280-
m_InitParams = initParams;
281-
punctualShadowAtlas.InitAtlas(renderPipelineResources, renderGraph, useSharedTexture, width, height, atlasShaderID, clearMaterial, maxShadowRequests, initParams, blurAlgorithm, filterMode, depthBufferBits, format, name);
279+
m_InitParams = atlasInitParams.initParams;
280+
punctualShadowAtlas.InitAtlas(atlasInitParams);
282281
}
283282

284-
internal void InitAreaLightShadowAtlas(RenderPipelineResources renderPipelineResources, RenderGraph renderGraph, bool useSharedTexture, int width, int height, int atlasShaderID, Material clearMaterial, int maxShadowRequests, HDShadowInitParameters initParams,
285-
HDShadowAtlas.BlurAlgorithm blurAlgorithm = HDShadowAtlas.BlurAlgorithm.None, FilterMode filterMode = FilterMode.Bilinear, DepthBits depthBufferBits = DepthBits.Depth16, RenderTextureFormat format = RenderTextureFormat.Shadowmap, string name = "")
283+
internal void InitAreaLightShadowAtlas(HDShadowAtlas.HDShadowAtlasInitParameters atlasInitParams)
286284
{
287-
m_InitParams = initParams;
288-
areaShadowAtlas.InitAtlas(renderPipelineResources, renderGraph, useSharedTexture, width, height, atlasShaderID, clearMaterial, maxShadowRequests, initParams, blurAlgorithm, filterMode, depthBufferBits, format, name);
285+
m_InitParams = atlasInitParams.initParams;
286+
areaShadowAtlas.InitAtlas(atlasInitParams);
289287
}
290288

291289
internal void RegisterLight(HDAdditionalLightData lightData)

com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDDynamicShadowAtlas.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ partial class HDDynamicShadowAtlas : HDShadowAtlas
1212
float m_RcpScaleFactor = 1;
1313
HDShadowResolutionRequest[] m_SortedRequestsCache;
1414

15-
public HDDynamicShadowAtlas(RenderPipelineResources renderPipelineResources, RenderGraph renderGraph, bool useSharedTexture, int width, int height, int atlasShaderID, Material clearMaterial, int maxShadowRequests, HDShadowInitParameters initParams, BlurAlgorithm blurAlgorithm = BlurAlgorithm.None, FilterMode filterMode = FilterMode.Bilinear, DepthBits depthBufferBits = DepthBits.Depth16, RenderTextureFormat format = RenderTextureFormat.Shadowmap, string name = "")
16-
: base(renderPipelineResources, renderGraph, useSharedTexture, width, height, atlasShaderID, clearMaterial, maxShadowRequests, initParams, blurAlgorithm, filterMode, depthBufferBits, format, name)
15+
public HDDynamicShadowAtlas(HDShadowAtlasInitParameters atlaInitParams)
16+
: base(atlaInitParams)
1717
{
18-
m_SortedRequestsCache = new HDShadowResolutionRequest[Mathf.CeilToInt(maxShadowRequests)];
18+
m_SortedRequestsCache = new HDShadowResolutionRequest[Mathf.CeilToInt(atlaInitParams.maxShadowRequests)];
1919
}
2020

2121
internal void ReserveResolution(HDShadowResolutionRequest shadowRequest)

0 commit comments

Comments
 (0)