Skip to content

Commit 24a1479

Browse files
eturquinkechoJulienIgnace-UnitysebastienlagardeFrancescoC-unity
authored
[HDRP][PathTracing] High resolution sky on camera ray misses (#3389)
* 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 55bb6ff. * 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 57ee23b. * 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]> * Merged changes for high res sky display in path tracing. * Uncommented PS5 includes. * Cosmetic. * 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 6bfc794. * 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 2653b9c. * 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]> * Made the code more rendergraph compliant and cleaner. * Fix keywords with fbx importer (#3350) Co-authored-by: sebastienlagarde <[email protected]> * Higt res env on camera misses, render sky only on first accum frame. * Updated changelog. * Support for camera motion blur when recording. * Fixed typo. * Update CHANGELOG.md * Formatting * Update 5005 PT screenshots * Fixed dirtiness issue with multiple cameras setup. Co-authored-by: Kleber Garcia <[email protected]> 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: 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: jenniferd-unity <[email protected]> Co-authored-by: Frédéric Vauchelles <[email protected]> Co-authored-by: Fabien Houlmann <[email protected]>
1 parent 30768c9 commit 24a1479

File tree

10 files changed

+123
-53
lines changed

10 files changed

+123
-53
lines changed
Lines changed: 2 additions & 2 deletions
Loading

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8989
- Improved shadow cascade GUI drawing with pixel perfect, hover and focus functionalities.
9090
- Improving the screen space global illumination.
9191
- Moving MaterialHeaderScopes to Core
92+
- Changed resolution (to match the render buffer) of the sky used for camera misses in Path Tracing. (case 1304114).
9293

9394
## [11.0.0] - 2020-10-21
9495

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Accumulation/Shaders/Accumulation.compute

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
#pragma kernel KMain
66

7-
#pragma multi_compile _ INPUT_FROM_RADIANCE_TEXTURE
7+
#pragma multi_compile _ INPUT_FROM_FRAME_TEXTURE
88

99
// Inputs
10-
#ifdef INPUT_FROM_RADIANCE_TEXTURE
11-
TEXTURE2D_X(_RadianceTexture);
10+
#ifdef INPUT_FROM_FRAME_TEXTURE
11+
TEXTURE2D_X(_FrameTexture);
1212
#endif
1313

1414
float4 _AccumulationWeights;
@@ -63,8 +63,8 @@ void KMain(uint3 dispatchThreadId : SV_DispatchThreadID)
6363
}
6464
else
6565
{
66-
#ifdef INPUT_FROM_RADIANCE_TEXTURE
67-
float4 color = _RadianceTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)];
66+
#ifdef INPUT_FROM_FRAME_TEXTURE
67+
float4 color = _FrameTexture[COORD_TEXTURE2D_X(dispatchThreadId.xy)];
6868
#else
6969
float4 color = _CameraColorTextureRW[COORD_TEXTURE2D_X(dispatchThreadId.xy)];
7070
#endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ RenderAccumulationParameters PrepareRenderAccumulationParameters(HDCamera hdCame
286286
parameters.accumulationCS.shaderKeywords = null;
287287
if (inputFromRadianceTexture)
288288
{
289-
parameters.accumulationCS.EnableKeyword("INPUT_FROM_RADIANCE_TEXTURE");
289+
parameters.accumulationCS.EnableKeyword("INPUT_FROM_FRAME_TEXTURE");
290290
}
291291
return parameters;
292292
}
@@ -311,7 +311,7 @@ static void RenderAccumulation(in RenderAccumulationParameters parameters, RTHan
311311
cmd.SetComputeTextureParam(accumulationShader, parameters.accumulationKernel, HDShaderIDs._CameraColorTextureRW, outputTexture);
312312
if (!inputTexture.Equals(outputTexture))
313313
{
314-
cmd.SetComputeTextureParam(accumulationShader, parameters.accumulationKernel, HDShaderIDs._RadianceTexture, inputTexture);
314+
cmd.SetComputeTextureParam(accumulationShader, parameters.accumulationKernel, HDShaderIDs._FrameTexture, inputTexture);
315315
}
316316
cmd.SetComputeVectorParam(accumulationShader, HDShaderIDs._AccumulationWeights, frameWeights);
317317
cmd.SetComputeIntParam(accumulationShader, HDShaderIDs._AccumulationNeedsExposure, parameters.needExposure ? 1 : 0);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest,
122122

123123
if (hdCamera.viewCount == 1)
124124
{
125-
colorBuffer = RenderPathTracing(m_RenderGraph, hdCamera);
125+
colorBuffer = RenderPathTracing(m_RenderGraph, hdCamera, colorBuffer);
126126
}
127127
else
128128
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public HDRenderPipeline(HDRenderPipelineAsset asset, HDRenderPipelineAsset defau
473473
InitRayTracedIndirectDiffuse();
474474
InitRaytracingDeferred();
475475
InitRecursiveRenderer();
476-
InitPathTracing();
476+
InitPathTracing(m_RenderGraph);
477477
InitRayTracingAmbientOcclusion();
478478
}
479479

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,12 +721,13 @@ static class HDShaderIDs
721721
public static readonly int _SubSurfaceLightingBuffer = Shader.PropertyToID("_SubSurfaceLightingBuffer");
722722
public static readonly int _IndirectDiffuseLightingBuffer = Shader.PropertyToID("_IndirectDiffuseLightingBuffer");
723723

724-
// Accumulation
724+
// Accumulation and path tracing
725725
public static readonly int _AccumulationFrameIndex = Shader.PropertyToID("_AccumulationFrameIndex");
726726
public static readonly int _AccumulationNumSamples = Shader.PropertyToID("_AccumulationNumSamples");
727727
public static readonly int _AccumulationWeights = Shader.PropertyToID("_AccumulationWeights");
728728
public static readonly int _AccumulationNeedsExposure = Shader.PropertyToID("_AccumulationNeedsExposure");
729-
public static readonly int _RadianceTexture = Shader.PropertyToID("_RadianceTexture");
729+
public static readonly int _FrameTexture = Shader.PropertyToID("_FrameTexture");
730+
public static readonly int _SkyCameraTexture = Shader.PropertyToID("_SkyCameraTexture");
730731

731732
// Preintegrated texture name
732733
public static readonly int _PreIntegratedFGD_GGXDisneyDiffuse = Shader.PropertyToID("_PreIntegratedFGD_GGXDisneyDiffuse");

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

Lines changed: 81 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,32 @@ public partial class HDRenderPipeline
6969
#endif // UNITY_EDITOR
7070
ulong m_CacheAccelSize = 0;
7171
uint m_CacheLightCount = 0;
72+
int m_CameraID = 0;
73+
bool m_RenderSky = true;
7274

73-
RTHandle m_RadianceTexture; // stores the per-pixel results of path tracing for this frame
75+
TextureHandle m_FrameTexture; // stores the per-pixel results of path tracing for one frame
76+
TextureHandle m_SkyTexture; // stores the sky background
7477

75-
void InitPathTracing()
78+
void InitPathTracing(RenderGraph renderGraph)
7679
{
7780
#if UNITY_EDITOR
7881
Undo.postprocessModifications += OnUndoRecorded;
7982
Undo.undoRedoPerformed += OnSceneEdit;
8083
SceneView.duringSceneGui += OnSceneGui;
8184
#endif // UNITY_EDITOR
8285

83-
m_RadianceTexture = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R32G32B32A32_SFloat, dimension: TextureXR.dimension,
84-
enableRandomWrite: true, useMipMap: false, autoGenerateMips: false,
85-
name: "PathTracingFrameBuffer");
86+
TextureDesc td = new TextureDesc(Vector2.one, true, true);
87+
td.colorFormat = GraphicsFormat.R32G32B32A32_SFloat;
88+
td.useMipMap = false;
89+
td.autoGenerateMips = false;
90+
91+
td.name = "PathTracingFrameBuffer";
92+
td.enableRandomWrite = true;
93+
m_FrameTexture = renderGraph.CreateSharedTexture(td);
94+
95+
td.name = "PathTracingSkyBuffer";
96+
td.enableRandomWrite = false;
97+
m_SkyTexture = renderGraph.CreateSharedTexture(td);
8698
}
8799

88100
void ReleasePathTracing()
@@ -92,15 +104,21 @@ void ReleasePathTracing()
92104
Undo.undoRedoPerformed -= OnSceneEdit;
93105
SceneView.duringSceneGui -= OnSceneGui;
94106
#endif // UNITY_EDITOR
95-
96-
RTHandles.Release(m_RadianceTexture);
97107
}
98108

99109
internal void ResetPathTracing()
100110
{
111+
m_RenderSky = true;
101112
m_SubFrameManager.Reset();
102113
}
103114

115+
internal void ResetPathTracing(int camID, CameraData camData)
116+
{
117+
m_RenderSky = true;
118+
camData.ResetIteration();
119+
m_SubFrameManager.SetCameraData(camID, camData);
120+
}
121+
104122
private Vector4 ComputeDoFConstants(HDCamera hdCamera, PathTracing settings)
105123
{
106124
var dofSettings = hdCamera.volumeStack.GetComponent<DepthOfField>();
@@ -119,6 +137,7 @@ private void OnSceneEdit()
119137
// If we just change the sample count, we don't necessarily want to reset iteration
120138
if (m_PathTracingSettings && m_CacheMaxIteration != m_PathTracingSettings.maximumSamples.value)
121139
{
140+
m_RenderSky = true;
122141
m_CacheMaxIteration = (uint)m_PathTracingSettings.maximumSamples.value;
123142
m_SubFrameManager.SelectiveReset(m_CacheMaxIteration);
124143
}
@@ -157,8 +176,7 @@ private void CheckDirtiness(HDCamera hdCamera)
157176
{
158177
camData.width = (uint)hdCamera.actualWidth;
159178
camData.height = (uint)hdCamera.actualHeight;
160-
camData.ResetIteration();
161-
m_SubFrameManager.SetCameraData(camID, camData);
179+
ResetPathTracing(camID, camData);
162180
return;
163181
}
164182

@@ -167,8 +185,7 @@ private void CheckDirtiness(HDCamera hdCamera)
167185
if (enabled != camData.skyEnabled)
168186
{
169187
camData.skyEnabled = enabled;
170-
camData.ResetIteration();
171-
m_SubFrameManager.SetCameraData(camID, camData);
188+
ResetPathTracing(camID, camData);
172189
return;
173190
}
174191

@@ -177,16 +194,14 @@ private void CheckDirtiness(HDCamera hdCamera)
177194
if (enabled != camData.fogEnabled)
178195
{
179196
camData.fogEnabled = enabled;
180-
camData.ResetIteration();
181-
m_SubFrameManager.SetCameraData(camID, camData);
197+
ResetPathTracing(camID, camData);
182198
return;
183199
}
184200

185201
// Check camera matrix dirtiness
186202
if (hdCamera.mainViewConstants.nonJitteredViewProjMatrix != (hdCamera.mainViewConstants.prevViewProjMatrix))
187203
{
188-
camData.ResetIteration();
189-
m_SubFrameManager.SetCameraData(camID, camData);
204+
ResetPathTracing(camID, camData);
190205
return;
191206
}
192207

@@ -203,6 +218,7 @@ private void CheckDirtiness(HDCamera hdCamera)
203218
{
204219
m_TransformDirty = false;
205220
ResetPathTracing();
221+
return;
206222
}
207223

208224
// Check lights dirtiness
@@ -220,6 +236,13 @@ private void CheckDirtiness(HDCamera hdCamera)
220236
m_CacheAccelSize = accelSize;
221237
ResetPathTracing();
222238
}
239+
240+
// If the camera has changed, re-render the sky texture
241+
if (camID != m_CameraID)
242+
{
243+
m_RenderSky = true;
244+
m_CameraID = camID;
245+
}
223246
}
224247

225248
static RTHandle PathTracingHistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
@@ -270,7 +293,7 @@ PathTracingParameters PreparePathTracingParameters(HDCamera hdCamera)
270293
return parameters;
271294
}
272295

273-
static void RenderPathTracing(in PathTracingParameters parameters, RTHandle radianceTexture, CommandBuffer cmd)
296+
static void RenderPathTracing(in PathTracingParameters parameters, RTHandle frameTexture, RTHandle skyTexture, CommandBuffer cmd)
274297
{
275298
// Define the shader pass to use for the path tracing pass
276299
cmd.SetRayTracingShaderPass(parameters.pathTracingShader, "PathTracingDXR");
@@ -291,10 +314,11 @@ static void RenderPathTracing(in PathTracingParameters parameters, RTHandle radi
291314
// Set the data for the ray miss
292315
cmd.SetRayTracingIntParam(parameters.pathTracingShader, HDShaderIDs._RaytracingCameraSkyEnabled, parameters.cameraData.skyEnabled ? 1 : 0);
293316
cmd.SetRayTracingVectorParam(parameters.pathTracingShader, HDShaderIDs._RaytracingCameraClearColor, parameters.backgroundColor);
317+
cmd.SetRayTracingTextureParam(parameters.pathTracingShader, HDShaderIDs._SkyCameraTexture, skyTexture);
294318
cmd.SetRayTracingTextureParam(parameters.pathTracingShader, HDShaderIDs._SkyTexture, parameters.skyReflection);
295319

296320
// Additional data for path tracing
297-
cmd.SetRayTracingTextureParam(parameters.pathTracingShader, HDShaderIDs._RadianceTexture, radianceTexture);
321+
cmd.SetRayTracingTextureParam(parameters.pathTracingShader, HDShaderIDs._FrameTexture, frameTexture);
298322
cmd.SetRayTracingMatrixParam(parameters.pathTracingShader, HDShaderIDs._PixelCoordToViewDirWS, parameters.pixelCoordToViewDirWS);
299323
cmd.SetRayTracingVectorParam(parameters.pathTracingShader, HDShaderIDs._PathTracedDoFConstants, parameters.dofParameters);
300324

@@ -306,26 +330,52 @@ class RenderPathTracingData
306330
{
307331
public PathTracingParameters parameters;
308332
public TextureHandle output;
333+
public TextureHandle sky;
309334
}
310335

311-
TextureHandle RenderPathTracing(RenderGraph renderGraph, in PathTracingParameters parameters, TextureHandle pathTracingBuffer)
336+
TextureHandle RenderPathTracing(RenderGraph renderGraph, in PathTracingParameters parameters, TextureHandle pathTracingBuffer, TextureHandle skyBuffer)
312337
{
313338
using (var builder = renderGraph.AddRenderPass<RenderPathTracingData>("Render PathTracing", out var passData))
314339
{
315340
passData.parameters = parameters;
316341
passData.output = builder.WriteTexture(pathTracingBuffer);
342+
passData.sky = builder.ReadTexture(skyBuffer);
317343

318344
builder.SetRenderFunc(
319345
(RenderPathTracingData data, RenderGraphContext ctx) =>
320346
{
321-
RenderPathTracing(data.parameters, data.output, ctx.cmd);
347+
RenderPathTracing(data.parameters, data.output, data.sky, ctx.cmd);
322348
});
323349

324350
return passData.output;
325351
}
326352
}
327353

328-
TextureHandle RenderPathTracing(RenderGraph renderGraph, HDCamera hdCamera)
354+
// Simpler variant used by path tracing, without depth buffer or volumetric computations
355+
void RenderSky(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle skyBuffer)
356+
{
357+
if (m_CurrentDebugDisplaySettings.DebugHideSky(hdCamera))
358+
return;
359+
360+
using (var builder = renderGraph.AddRenderPass<RenderSkyPassData>("Render Sky for Path Tracing", out var passData))
361+
{
362+
passData.visualEnvironment = hdCamera.volumeStack.GetComponent<VisualEnvironment>();
363+
passData.sunLight = GetCurrentSunLight();
364+
passData.hdCamera = hdCamera;
365+
passData.colorBuffer = builder.WriteTexture(skyBuffer);
366+
passData.depthTexture = builder.WriteTexture(CreateDepthBuffer(renderGraph, true, false));
367+
passData.debugDisplaySettings = m_CurrentDebugDisplaySettings;
368+
passData.skyManager = m_SkyManager;
369+
370+
builder.SetRenderFunc(
371+
(RenderSkyPassData data, RenderGraphContext context) =>
372+
{
373+
data.skyManager.RenderSky(data.hdCamera, data.sunLight, data.colorBuffer, data.depthTexture, data.debugDisplaySettings, context.cmd);
374+
});
375+
}
376+
}
377+
378+
TextureHandle RenderPathTracing(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle colorBuffer)
329379
{
330380
RayTracingShader pathTracingShader = m_Asset.renderPipelineRayTracingResources.pathTracing;
331381
m_PathTracingSettings = hdCamera.volumeStack.GetComponent<PathTracing>();
@@ -336,34 +386,33 @@ TextureHandle RenderPathTracing(RenderGraph renderGraph, HDCamera hdCamera)
336386

337387
CheckDirtiness(hdCamera);
338388

339-
var parameters = PreparePathTracingParameters(hdCamera);
340-
TextureHandle outputTexture = CreateColorBuffer(renderGraph, hdCamera, false);
341-
// TODO RENDERGRAPH: This texture needs to be persistent
342-
// (apparently it only matters for some tests, loading a regular scene with pathtracing works even if this one is not persistent)
343-
// So we need to import a regular RTHandle. This is not good because it means the texture will always be allocate even if not used...
344-
// Refactor that when we formalize how to handle persistent textures better (with automatic lifetime and such).
345-
var radianceTexture = renderGraph.ImportTexture(m_RadianceTexture);
346-
347389
if (!m_SubFrameManager.isRecording)
348390
{
349391
// If we are recording, the max iteration is set/overridden by the subframe manager, otherwise we read it from the path tracing volume
350392
m_SubFrameManager.subFrameCount = (uint)m_PathTracingSettings.maximumSamples.value;
351393
}
352394

353-
354395
#if UNITY_HDRP_DXR_TESTS_DEFINE
355396
if (Application.isPlaying)
356397
m_SubFrameManager.subFrameCount = 1;
357398
#endif
358399

400+
var parameters = PreparePathTracingParameters(hdCamera);
359401
if (parameters.cameraData.currentIteration < m_SubFrameManager.subFrameCount)
360402
{
361-
RenderPathTracing(m_RenderGraph, parameters, radianceTexture);
403+
// Keep a sky texture around, that we compute only once per accumulation (except when recording, with potential camera motion blur)
404+
if (m_RenderSky || m_SubFrameManager.isRecording)
405+
{
406+
RenderSky(m_RenderGraph, hdCamera, m_SkyTexture);
407+
m_RenderSky = false;
408+
}
409+
410+
RenderPathTracing(m_RenderGraph, parameters, m_FrameTexture, m_SkyTexture);
362411
}
363412

364-
RenderAccumulation(m_RenderGraph, hdCamera, radianceTexture, outputTexture, true);
413+
RenderAccumulation(m_RenderGraph, hdCamera, m_FrameTexture, colorBuffer, true);
365414

366-
return outputTexture;
415+
return colorBuffer;
367416
}
368417
}
369418
}

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/PathTracing/Shaders/PathTracingMain.raytrace

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,23 @@
2626
float4x4 _PixelCoordToViewDirWS;
2727
int _RaytracingCameraSkyEnabled;
2828
float4 _RaytracingCameraClearColor;
29-
30-
// DoF related parameters
31-
float4 _PathTracedDoFConstants; // x: aperture radius, y: focus distance, zw: unused
29+
TEXTURE2D_X(_SkyCameraTexture);
3230

3331
// Output(s)
34-
RWTexture2D<float4> _RadianceTexture;
32+
RW_TEXTURE2D_X(float4, _FrameTexture);
33+
34+
// DoF related parameters
35+
float4 _PathTracedDoFConstants; // x: aperture radius, y: focus distance, zw: unused
3536

3637
[shader("miss")]
3738
void MissCamera(inout PathIntersection pathIntersection : SV_RayPayload)
3839
{
3940
bool skyEnabled = _EnvLightSkyEnabled && _RaytracingCameraSkyEnabled;
40-
pathIntersection.value = skyEnabled ? SampleSkyTexture(WorldRayDirection(), 0.0, 0).xyz : _RaytracingCameraClearColor.xyz * GetInverseCurrentExposureMultiplier();
41-
pathIntersection.alpha = skyEnabled ? 1.0 : _RaytracingCameraClearColor.w;
41+
float4 missColor = skyEnabled ? _SkyCameraTexture[COORD_TEXTURE2D_X(pathIntersection.pixelCoord)] : _RaytracingCameraClearColor;
42+
pathIntersection.value = missColor.xyz * GetInverseCurrentExposureMultiplier();
43+
pathIntersection.alpha = missColor.w;
4244

43-
ApplyFogAttenuation(WorldRayOrigin(), WorldRayDirection(), pathIntersection.value);
45+
ApplyFogAttenuation(WorldRayOrigin(), WorldRayDirection(), pathIntersection.value, pathIntersection.alpha);
4446

4547
if (_EnableVolumetricFog && _RaytracingMinRecursion <= 1)
4648
{
@@ -149,7 +151,7 @@ void RayGen()
149151
// Evaluate the ray intersection
150152
TraceRay(_RaytracingAccelerationStructure, RAY_FLAG_CULL_BACK_FACING_TRIANGLES, RAYTRACINGRENDERERFLAG_PATH_TRACING, 0, 1, 0, rayDescriptor, pathIntersection);
151153

152-
_RadianceTexture[currentPixelCoord] = float4(pathIntersection.value, pathIntersection.alpha);
154+
_FrameTexture[COORD_TEXTURE2D_X(currentPixelCoord)] = float4(pathIntersection.value, pathIntersection.alpha);
153155
}
154156

155157
// This should never be called, return magenta just in case

0 commit comments

Comments
 (0)