-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Probe Volume Dynamic GI V1 (#7) Large feature addition to Probe Volumes to support Dynamic GI at runtime & in editor via compute jobs. Huge coordination across game team, Spotlight & HDRP team to refine the algorithm and feature set. Key Features - New toggle on a light "Affects Dynamic GI" - New toggle on a probe Volume "Support Dynamic GI" - New debug draw mode on a probe volume "Draw Neighbors" to visualize the neighbor the dynamic GI light will bounce around in - All light types are supported Missing features - During albedo baking step, mask volumes are not being sampled correctly - Off screen lights are missing their shadows when being sampled by the Hit pass of the Dynamic GI compute shader - Directional light GI seems off, maybe its the offscreen shadow issues - Sky lighting is not supported at the moment in the dynamic GI - Currently does not encode emissive in the neighborhood bake data, only albedo, surface distance & normal - Currently does require a re-bake when geometry changes, the only thing it relies on getting from the lightmapper is the probe validity value Commit notes: * Added dynamic GI options onto HDLight and ProbeVolume inspectors * work in progress dynamic gi * lots more refactoring on the data model and packing for hits vs misses * Cleanup dynamic GI code into separate file * Working axis baking code with visualization * small fixes * validity scale fix * neighbor draw quad scale control * small fix * scale fix * First pass at albedo extraction code for DynamicGI * bake bug fix * Albedo baking via Shader Graph works now, and more tweaks to neighbor debug draw * bug fix * Dynamic GI neighbor cleanup to use real probe volume data for positioning * bug fix for non uniform density volumes * cleanup * Cleanup and setup of Propagation Buffers * more work in progress dynamic GI, have a test read modify write of SH data working * cleanup dynamic GI values when its disabled * more cleanup * bug fix * New improved Albedo sampling code from Francesco * cache debug shader not material, works better for some reason * Lots of shader code and setup for real-time GI propagation. Still a work in progress but most code written on GPU side * All the compute data hooked up first pass * Kinda of working * Slightly better, still not there * Fixes plus re-write of SH data in dynamic GI * First kinda working version of new RTGI, needs lots of tuning and improvements * Move VolumeComponent to seperate file so it is preserved when assets are saved * More improvements, anti alias punctual lights and add a secondary bounce to hits * Tweaks, added FCC's SH logic for testing / comps * Cleanup and addition of 3D texture for Irradiance sampling to smooth out history * Cleanup & and added back bounce boost control for hit pass * Tuning defaults * more filddleing with defaults * temp code for testing * Intended L1 * Adding Affect Dynamic GI to light explorer UI Fixing hit lighting logic to work with multiple lights * Adding de-ringing to SH Exposing class outside of HDRP for play mode testing * Move probe volume update code around so worked better with needing state set before dispatches * Integration of SG logic for Irradiance Cache, way cleaner and better results. Removed old Irradiance cache logic using L1 SH * More cleanup and refinements of SG algorithm * Bias punctual lights near surfaces to fix strobing * Cleanup * name cleanup * Support volume rotation in neighbor debug view mode * Fixed contribution normalization. Changed the direction for infinite bounces evaluation from reflection to surface normal. * changing default sharpness to 3.5 to reduce dark banding a tad * Hacked prototype of an alternative propagation algorithm. * Smoothed radiance gathering from hits. * Cleanup and temp NaN propagation workaround. * Changed History Contribution min limit to 0 to be able to test propagation without it. * Removed old algorithm, cleaned up data format and volume parameters to make new directional version the default one * Fixed Probe Volume dynamic GI data access after merging with the DOTS Probe Volume feature. Signed-off-by: Andrew Saraev <andrew.saraev@unity3d.com> * Fixed up popping issues with Dynamic GI and other probe volumes in view, plus made it so the light list is global, not camera view culled so all lights stay active in the list for GI to propagate more accurately and shadows to update even for lights behind the camera. Merged with latest * Build compile fixes * Player build fixes, real-time GI now works in player builds * HDRP settings and toggles for probe volume dynamic GI * missed files for previous checkin * small optimizations * turn on optimizations in key dynamic gi shaders for perf * Custom dynamic GI light list that also includes off screen lights * Explicitly set dataUpdated when data is uploaded to the atlas instead of setting it in GetPayload() of the volume. To simplify communication with the DOTS version. * use shadows for dynamic GI lights. This still has a bug where off screen lights get their shadow indexes reset to -1 * Better disposing of propagation buffers Cleaned up global compute buffers for SH L012 and validity buffers, and reusing those per probe volume for propagation to reduce memory usage * possible mem leak fix & piping light bounce intensity through to dynamic GI * Some PR feedback and distance checks to probe hit & propagation phases * Added basic distance checks to entire probe volume to dispatch dynamic GI jobs or not * directional lights are weird, maybe the shadows, we should avoid them * PR feedback * Refactored ProbeVolumeBuffers cleanup to keep GameObject and DOTS logic similar. * Attempt to reduce white space conflicts * Profiler marker for Dynamic GI Slight optimization in light loop * Optimized C# by not doing SetData calls on Buffers unnecessarily Co-authored-by: Andrew Saraev <andrew.saraev@unity3d.com> Bug fixes from Dynamic GI. Cleanup buffers after bakes, and only dispatch dynamic GI for scene or game cameras Dynamic GI Spherical Harmonic from Spherical Gaussian Modes (#9) * Implemented SH from SG Modes which can be toggled between in the Probe Dynamic GI volume settings. SamplePeakAndProject is the same mode we are used to: Spherical gaussians will simply be evaluated at their peak and projected to convert to spherical harmonics. SHFromSGFit: A spherical gaussian to spherical harmonic function fit is used, which is physically plausible. SHFromSGFitWithCosineWindow: A spherical gaussian with an additional cosine window to spherical harmonic function fit is used, which is physically plausible. Less directional blur than SHFromSGFit. * Cleanup pass on SG to SH supporting math. Created Zonal Harmonic data type with supporting functions to add type saftey to the transforms as we have done with the other spherical harmonic functions. Created specialized zonal harmonic rotation functions which significantly reduces the work required for rotation. It's possible the compiler was handling this already by stripping out work on zero coefficients, and by automatically using floats instead of float3s when all channels are the same - but better to not put too much pressure on the compiler. This should also make it easier in the future to create specialized rotation functions for cardinal rotations (which will introduce additional zeros). Co-authored-by: pastasfuture <nickb@bonfirestudios.com> Dynamic GI: Fix a bunch of shader warnings in DynamicGI shaders. Bug fix so that lights can act as dynamic GI only lights
- Loading branch information
1 parent
9e40718
commit 121c875
Showing
81 changed files
with
5,946 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.