Skip to content

[Hold] Binned Lighting Technique for the HDRP (v3) #2805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 224 commits into
base: master
Choose a base branch
from

Conversation

sebastienlagarde
Copy link
Contributor

@sebastienlagarde sebastienlagarde commented Dec 1, 2020

Purpose of this PR

Add binned lighting (a.k.a. Z-binning) technique to the HDRP. Binned lighting replaces both fine-pruned tiled lighting (a.k.a. FPTL) and clustered lighting techniques. Binned lighting is essentially tiled+.

Short comparison:

Technique Resolution in X&Y Resolution in Z Transparent geometry
Tiled lighting High None Yes
FPTL High Perfect No
Binned lighting High Some Yes
Clustered lighting Low Low Yes

Performance-wise, FPTL ≥ Binned lighting ≥ Tiled lighting.
Note that there is some overhead associated with filtering the light list during the lighting pass as well.

The work is incomplete.

What works:

  • binning;
  • classification;
  • build dispatch indirect;
  • Lit, TerrainLit, Deferred Lighting, Volumetric shaders;
  • decals.

What doesn't:

  • everything else. In particular, DeferredTile.shader does not work.

Next steps (in no particular order):

  • fix ray tracing & contact shadows (which made liberal use of tiled lighting buffers);
  • add the render graph support;
  • add a single debug mode (more details on request).

Once all the compile errors are fixed and everything works and passes automated tests (including ray tracing and XR), we should perform manual regression testing and verify culling efficiency using the added debug mode.

The next step (once everything works) is to perform some testing on the consoles and optimize. Specifically, we must scalarize access to the data structure for AMD GPUs.

The final step is to remove the unused old code.


Testing status

image


Comments to reviewers

If anyone is interested, I accept offers to help (reach out to me or Sebastien).

EvgeniiG and others added 13 commits January 15, 2021 17:52
* tile debug view works similarly for z-binning compared to tile and cluster debug

* remove unused #else

* tile debug view works similarly for z-binning compared to tile and cluster debug

* remove unused #else

* fix incorrect summary display of highlighted tile

* cleanup debug menu

* fix merge errors
* populate the zBinBitArrayBuffer

* reflection probes use unsorted zbin lookup

* do separate zBinBuffer and zBinBitArrayBuffer calculations

* remove reflection probe sort in the shader

* fix merge errors

* cleanup pr

* fix compile

* address PR comments

* removed spaces
EvgeniiG and others added 5 commits February 8, 2021 17:16
… into HDRP/z-binning-3

# Conflicts:
#	com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs
#	com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManager.RenderGraph.cs
#	com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerPunctual.RenderGraph.cs
#	com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader
#	com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader
#	com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader
#	com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.Debug.cs
#	com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.LightLoop.cs
* Fixed entity count increments per eye which triggered runtime asserts.

* Fixed missing incremental call.

* Added logic to prevent shadow job being queued per view.

* Adjust XR threshhold for several tests.

* Code cleanup.
@sebastienlagarde sebastienlagarde changed the title Binned Lighting Technique for the HDRP (v3) [Hold] Binned Lighting Technique for the HDRP (v3) Jul 12, 2021
@EvgeniiG EvgeniiG removed their assignment May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants