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
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
dd03169
Implement clipping and culling (does not consider view frustum corners)
EvgeniiG Jul 20, 2020
d3b4b95
Support orthographic projection
EvgeniiG Aug 5, 2020
10a585e
Turn 'scaleXY' into a scalar
EvgeniiG Aug 5, 2020
7a7d8f3
Test corners of the view volume
EvgeniiG Aug 6, 2020
a8d04ba
Improve the placeholder for the linear depth
EvgeniiG Aug 6, 2020
2ea9f8b
Fix aspect
EvgeniiG Aug 6, 2020
0b870db
Bugfix
EvgeniiG Aug 6, 2020
83d73e9
Optimize
EvgeniiG Aug 7, 2020
3f137ab
Also store view space Z
EvgeniiG Aug 7, 2020
be9e040
Optimize orthographic
EvgeniiG Aug 8, 2020
e4d275c
Optimize LUT
EvgeniiG Aug 10, 2020
e1a5fcc
Add wave intrinsic support
EvgeniiG Aug 11, 2020
c648e2a
Fix group count
EvgeniiG Aug 11, 2020
d6cfa8f
Reduce the kernel count to 1
EvgeniiG Aug 11, 2020
f3f540f
Remove old code
EvgeniiG Aug 11, 2020
f1aeb31
Bounds check
EvgeniiG Aug 12, 2020
d2f3fda
Add a profiling marker
EvgeniiG Aug 12, 2020
6aefaf3
Fix lane masks
EvgeniiG Aug 12, 2020
157cd8e
Fix compiler warning
EvgeniiG Aug 12, 2020
a2da924
Remove GPU Pro reference
EvgeniiG Aug 12, 2020
70859f7
Be politically correct
EvgeniiG Sep 17, 2020
be59aa0
Merge branch 'HDRP/staging' into HDRP/light-aabb-2
EvgeniiG Sep 19, 2020
6e8a605
No instrinsics on Xbox
EvgeniiG Aug 26, 2020
b50cded
Manually re-apply the changes (except for LightLoop.cs)
EvgeniiG Sep 23, 2020
8e912a5
Manually re-apply the changes to LightLoop.cs
EvgeniiG Sep 26, 2020
51a4020
Make things compile
EvgeniiG Sep 29, 2020
9b0f90f
Update the naming convention
EvgeniiG Sep 29, 2020
2b52e44
Split the output of the AABB pass into XY and W buffers
EvgeniiG Sep 30, 2020
5360134
Implement the Z-binning pass
EvgeniiG Oct 2, 2020
4bc512a
Store {start, end} rather than {start, count}
EvgeniiG Oct 2, 2020
9f9ef7d
Assert
EvgeniiG Oct 5, 2020
283b83f
IndexFromCoordinate, CoordinateFromIndex
EvgeniiG Oct 6, 2020
7e11c2d
Dispatch a group per category
EvgeniiG Oct 6, 2020
856f5c4
Dimensions
EvgeniiG Oct 7, 2020
913b473
BinCoarseXY prototype
EvgeniiG Oct 8, 2020
a6c1ccb
Feed shader constants
EvgeniiG Oct 8, 2020
5e051dc
Fix near plane issues
EvgeniiG Oct 8, 2020
dbacfd5
Feed the shader
EvgeniiG Oct 8, 2020
1eeecab
Add the right marker
EvgeniiG Oct 9, 2020
1a28ade
Bugfix
EvgeniiG Oct 9, 2020
f668097
Better fix
EvgeniiG Oct 9, 2020
6bf4f74
Remove thread block grouping
EvgeniiG Oct 13, 2020
42f2cba
Manually edit the HLSL file...
EvgeniiG Oct 13, 2020
7891197
Delete
EvgeniiG Oct 13, 2020
38a29e8
Share more code
EvgeniiG Oct 13, 2020
3861d9a
Comment
EvgeniiG Oct 13, 2020
aa98827
Start working on the binned lighting API
EvgeniiG Oct 14, 2020
34cdfd0
Rename: 'tile' -> 'xyTile'
EvgeniiG Oct 14, 2020
1026852
Bruteforce lighting works
EvgeniiG Oct 14, 2020
f20a1a2
More efficient tile indexing
EvgeniiG Oct 15, 2020
8b56147
Share code between coarse and fine tiles
EvgeniiG Oct 15, 2020
fc54793
TODOs
EvgeniiG Oct 16, 2020
b90ea95
Port the bounding sphere code
EvgeniiG Oct 22, 2020
d292b78
Use z-binning for punctual lights during the deferred lighting pass
EvgeniiG Oct 23, 2020
1fdea75
Store metadata per tile
EvgeniiG Oct 23, 2020
b72b6e6
Rename 'xyTile' -> 'tile'
EvgeniiG Oct 23, 2020
3b98d96
Fill coarse tiles
EvgeniiG Oct 24, 2020
b4d515d
Clean up
EvgeniiG Oct 24, 2020
1929a83
TODO
EvgeniiG Oct 24, 2020
54b1e3f
Naming
EvgeniiG Oct 24, 2020
3dbd648
Split the tile buffer into header + body
EvgeniiG Oct 26, 2020
065828e
Add VERTS_PER_FACE
EvgeniiG Oct 27, 2020
5513089
Add 'ClippingUtilities.hlsl'
EvgeniiG Oct 27, 2020
0f7ed48
Comment
EvgeniiG Oct 27, 2020
8fd1c01
Add a prototype for PruneCoarseTiles
EvgeniiG Oct 28, 2020
bc1f01f
TryCullEntity WIP
EvgeniiG Oct 29, 2020
6374308
OptimizeOrthographicMatrix
EvgeniiG Oct 30, 2020
5f47615
Fix broken shaders
EvgeniiG Oct 30, 2020
e663fd5
Assert
EvgeniiG Oct 30, 2020
a7802ac
Fix z-flip
EvgeniiG Oct 30, 2020
d900d8e
Don't hope; assert
EvgeniiG Oct 30, 2020
433e23f
Implement sphere culling
EvgeniiG Oct 31, 2020
e95e700
Update warning
EvgeniiG Oct 31, 2020
c8301f5
Comment
EvgeniiG Oct 31, 2020
6a48ee4
Optimize FiniteLightBound
EvgeniiG Oct 31, 2020
d621d7f
Early out
EvgeniiG Oct 31, 2020
917a6b0
Allow TryCullSphere to trivially accept
EvgeniiG Nov 3, 2020
deb2550
TryCullBoundingFrustum works
EvgeniiG Nov 6, 2020
b64bcd6
Optimize
EvgeniiG Nov 6, 2020
d98a85a
Do not use the shifted clip space of Blinn
EvgeniiG Nov 7, 2020
11a57a6
TMI
EvgeniiG Nov 7, 2020
b01810e
Allow the bounding sphere to be disabled
EvgeniiG Nov 7, 2020
603549a
Comment
EvgeniiG Nov 8, 2020
f2ba62b
Fine tile binning works
EvgeniiG Nov 10, 2020
a54890e
Rename profiling marker
EvgeniiG Nov 10, 2020
f5cb659
Remove debug symbols
EvgeniiG Nov 10, 2020
d7d6f31
Assert
EvgeniiG Nov 10, 2020
176b160
Reduce the size of the fine tile buffer
EvgeniiG Nov 11, 2020
4f31913
Add 'classification.compute'
EvgeniiG Nov 11, 2020
ee3720c
Optimize
EvgeniiG Nov 11, 2020
9653936
Fix classification scripts
EvgeniiG Nov 13, 2020
f259602
Remove all the 'register' crap
EvgeniiG Nov 13, 2020
20021ee
Build Dispatch Indirect is done (still need to fix Deferred.compute)
EvgeniiG Nov 13, 2020
6cf6bd3
TODO
EvgeniiG Nov 13, 2020
d7afe67
Bind the stencil texture for the classification pass
EvgeniiG Nov 13, 2020
9c46860
Classification + dispatch indirect + compute deferred lighting works
EvgeniiG Nov 13, 2020
1a30c03
Add a profiling scope
EvgeniiG Nov 13, 2020
cd86a2e
TODO
EvgeniiG Nov 13, 2020
a3576b4
Try to fix deferred pixel shaders
EvgeniiG Nov 14, 2020
c1cb95c
Optimize
EvgeniiG Nov 17, 2020
929ea35
Another attempted fix...
EvgeniiG Nov 17, 2020
1635bf1
Simplify
EvgeniiG Nov 18, 2020
0a3bb4f
Z-bin the lit shader
EvgeniiG Nov 18, 2020
c2cdc77
Add area light support
EvgeniiG Nov 18, 2020
303566a
Add decal support
EvgeniiG Nov 19, 2020
f132dd7
Enable directional lights
EvgeniiG Nov 19, 2020
6b83df2
Fix HDShadowLoop.hlsl (ShadowLoopMin)
EvgeniiG Nov 19, 2020
1aa1e27
Add reflection probe support
EvgeniiG Nov 20, 2020
a653fa4
Fix TerrainLit
EvgeniiG Nov 20, 2020
c3b1771
Update the HDRI sky to use binned lighting
EvgeniiG Nov 21, 2020
adcc752
Fix the AxF shader
EvgeniiG Nov 21, 2020
a60769b
Remove GetTileSize()
EvgeniiG Nov 21, 2020
21be3e2
Fix insertion sort
EvgeniiG Nov 21, 2020
f50b5ba
Fix TerrainLit_Basemap (test fails???)
EvgeniiG Nov 21, 2020
641b553
Const
EvgeniiG Nov 21, 2020
c91c858
Support ranged queries
EvgeniiG Nov 24, 2020
c70446c
Add density volume support (merge DensityVolumeEngineData and Oriente…
EvgeniiG Nov 25, 2020
1dd8fc3
Fix volume voxelization pass
EvgeniiG Nov 25, 2020
81c39b8
Share more code
EvgeniiG Nov 25, 2020
ddb5206
Fix volume voxelization pass (2)
EvgeniiG Nov 25, 2020
f0d5703
Fix a camera-relative bug
EvgeniiG Nov 26, 2020
3e034ec
Fix copy-paste fail
EvgeniiG Nov 27, 2020
e78c2e4
Fix volumetric lighting
EvgeniiG Nov 27, 2020
db54bf7
Symbols
EvgeniiG Nov 27, 2020
9197895
Merge commit 'b649f8f4e7575455263949df5942c4f6a14fd317' into 'HDRP/z-…
EvgeniiG Dec 1, 2020
ae8cc57
formatting
sebastienlagarde Dec 1, 2020
17c94f1
Merge commit '30d75d046a2d57ccf268c863476808514a4086a4' into 'HDRP/z-…
EvgeniiG Dec 1, 2020
814507d
Merge branch 'master' into HDRP/z-binning-3
EvgeniiG Dec 1, 2020
7efd2b1
Fix compile errors (disable render graph!)
EvgeniiG Dec 1, 2020
2be10ef
BuildGPULightListOutput
EvgeniiG Dec 1, 2020
32c58b0
Profiling scope
EvgeniiG Dec 2, 2020
85a011f
Update BuildGPULightListOutput
EvgeniiG Dec 3, 2020
b5bc6ed
Massage more copy-pasted structs...
EvgeniiG Dec 3, 2020
02aba3e
Update BuildGPULightListfor the render graph
EvgeniiG Dec 3, 2020
3a5ff5e
Render graph VolumeVoxelizationPass
EvgeniiG Dec 3, 2020
2f59f66
Render graph VolumetricLightingPass
EvgeniiG Dec 3, 2020
cd9f162
Render graph DeferredLightingPass
EvgeniiG Dec 3, 2020
d6cc771
Render graph ForwardOpaquePass & ForwardTransparentPass
EvgeniiG Dec 4, 2020
25dcd91
Silence the whining validation layer
EvgeniiG Dec 4, 2020
daf2f8b
Comments
EvgeniiG Dec 5, 2020
fbdad1d
More comments
EvgeniiG Dec 5, 2020
530ec2e
Fix punctual contact shadows
FrancescoC-unity Dec 7, 2020
f3eb22b
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
JulienIgnace-Unity Dec 7, 2020
0f88a26
Merge branch 'HDRP/z-binning-3' of https://github.com/Unity-Technolog…
JulienIgnace-Unity Dec 7, 2020
1d3a117
Fix shader compiler warnings
FrancescoC-unity Dec 7, 2020
7089944
Fix assertion on wrong light type
FrancescoC-unity Dec 7, 2020
836942b
Merge branch 'HDRP/z-binning-3' of https://github.com/Unity-Technolog…
JulienIgnace-Unity Dec 7, 2020
92eb11d
Fix after master merge
JulienIgnace-Unity Dec 7, 2020
fd86270
Fix test 2316 (Issue was log depth stretching more than 16bit)
FrancescoC-unity Dec 7, 2020
f211a21
Merge branch 'master' into HDRP/z-binning-3
sebastienlagarde Dec 7, 2020
216bbdf
First pass of DXR correction
sebastienlagarde Dec 7, 2020
49ff365
comment compil issue in DEbugViewTiles.shader for Yamato
sebastienlagarde Dec 7, 2020
c42a880
Merge branch 'master' into HDRP/z-binning-3
sebastienlagarde Dec 7, 2020
6705fd8
Update HDRenderPipelineResources.asset
sebastienlagarde Dec 7, 2020
40403e3
Fix compil issue with DebugTileView.shader
sebastienlagarde Dec 7, 2020
e0b1685
Add a very simple debug mode for binned lighting
EvgeniiG Dec 8, 2020
315cb2b
Clamp the lerp
EvgeniiG Dec 8, 2020
0ee34ae
Comment
EvgeniiG Dec 8, 2020
007fb95
Fix bounding frustum of pyramid lights
EvgeniiG Dec 8, 2020
c8232f2
Use a smaller epsilon
EvgeniiG Dec 8, 2020
f971fb9
Fix ray-traced contact shadows
FrancescoC-unity Dec 8, 2020
aa7e6a5
Fix asserts about z-axis not pointing forward in tests.
FrancescoC-unity Dec 8, 2020
b2f54f6
Fix LaneSwizzle function call in tile.compute
FrancescoC-unity Dec 8, 2020
2694f19
Merge branch 'master' into HDRP/z-binning-3
sebastienlagarde Dec 8, 2020
74c9b60
Fix errors when going in and out xr with 2 or more views.
FrancescoC-unity Dec 8, 2020
120a449
Update shader graph and contact shadow for ZBinning + clean stripper …
sebastienlagarde Dec 8, 2020
f547ea5
Fix incorrect linear depth values computed for orthographic projectio…
EvgeniiG Dec 8, 2020
2207969
Fix singularity in GetOrthoBasisViewNormal
EvgeniiG Dec 8, 2020
3b5170f
Save 1x instruction
EvgeniiG Dec 9, 2020
d54236f
Fix conditional macro not compiling
sebastienlagarde Dec 9, 2020
08847d6
Fix VFX shaders
sebastienlagarde Dec 9, 2020
5a47b77
Fixed ScreenSpace Shadows with ZBinning (#2876)
JulienIgnace-Unity Dec 10, 2020
7278199
Fix an issue where queries over z-bin ranges would fail to find lights
EvgeniiG Dec 11, 2020
6549432
Constrain the V-Buffer to the camera frustum
EvgeniiG Dec 11, 2020
b63fa2f
Faster early termination
EvgeniiG Dec 11, 2020
37b7185
Fix unsafe sampling of the volumetric buffers
EvgeniiG Dec 11, 2020
0118acc
Simpler fix (better visuals, too)
EvgeniiG Dec 11, 2020
a8ab7d4
Fix artifacts introduced by USE_DEPTH_BUFFER optimization
EvgeniiG Dec 11, 2020
16f9516
Comment/warning/TODO about potential problems
EvgeniiG Dec 11, 2020
afb8580
Implement the "tile bit field" approach
EvgeniiG Dec 15, 2020
5baf38f
Temporarily enable the debug symbols to work around the compiler bug
EvgeniiG Dec 15, 2020
0a405f2
Add debug symbols shortcut to the Lit shader
EvgeniiG Dec 16, 2020
799e393
Fix linear depth for partially off-screen polygons
EvgeniiG Dec 16, 2020
cf98e14
Fix copy-paste error
EvgeniiG Dec 17, 2020
7baac06
Work around the compiler bug
EvgeniiG Dec 17, 2020
253edd4
Merge branch 'HDRP/z-binning-3' into HDRP/tile-bit-fields
EvgeniiG Dec 17, 2020
b4201e1
Implement the "tile bit field" approach (v2)
EvgeniiG Dec 17, 2020
8f54375
Fix
EvgeniiG Dec 17, 2020
27a52b6
Compiler warning
EvgeniiG Dec 17, 2020
89862c3
Remove outdated comment
EvgeniiG Jan 4, 2021
f4a16df
Release memory
EvgeniiG Jan 4, 2021
e5125f6
Implement the new entity lookup API
EvgeniiG Jan 6, 2021
e41c8a7
Fix script breaking player build
EvgeniiG Jan 7, 2021
2c9bf41
Defensive programming
EvgeniiG Jan 11, 2021
d1ad95b
Reduce the number of clipping planes
EvgeniiG Jan 12, 2021
8bbd0bd
Update comment
EvgeniiG Jan 12, 2021
3a86dbc
Remove junk
EvgeniiG Jan 12, 2021
10276c5
Comment
EvgeniiG Jan 13, 2021
791d038
Merge branch 'master' into 'HDRP/z-binning-3'
EvgeniiG Jan 13, 2021
b23f163
Merge branch 'master' into HDRP/z-binning-3
sebastienlagarde Jan 14, 2021
4a86a11
Fix RayTracingContactShadow
EvgeniiG Jan 14, 2021
4e7e68a
Restore LightCategory for ray tracing
EvgeniiG Jan 14, 2021
c170dbc
Optimize for powers of 2
EvgeniiG Jan 14, 2021
0d15a74
TODO
EvgeniiG Jan 14, 2021
2534d34
Fix define
EvgeniiG Jan 14, 2021
b9fb7bf
Increase the fine tile size from 8x8 to 16x16
EvgeniiG Jan 16, 2021
6a6a664
Reduce the pressure on the atomic counter
EvgeniiG Jan 16, 2021
26db7f7
Add the means to control the memory budget of tiled lighting without …
EvgeniiG Jan 21, 2021
56b29c7
Capitalize
EvgeniiG Jan 21, 2021
4096c98
Do not use log depth for z-binning
EvgeniiG Jan 21, 2021
b41754d
Hdrp/z binning debug 2 (#3078)
Paulm-Unity Jan 22, 2021
93d54ad
Hdrp/z binning refprobes (#3249)
Paulm-Unity Jan 26, 2021
b5e28be
Clean up the reflection probe API
EvgeniiG Jan 27, 2021
e5606b6
cluster decals are not depth sorted (#3271)
Paulm-Unity Jan 27, 2021
48fb66e
Fix RenderGraph implementation of contact shadows
EvgeniiG Jan 28, 2021
bd2468a
Merge branch 'master' into 'HDRP/z-binning-3'
EvgeniiG Jan 28, 2021
260d295
Port the D3D12 crash workaround
EvgeniiG Feb 2, 2021
503b0ab
dont add probes with invalid rendered data to bounded entity collection
Paulm-Unity Feb 3, 2021
f0c9d38
Add another HasValidRenderedData check
EvgeniiG Feb 3, 2021
47926ef
Reduce the number of SGPRs used at the cost of additional memory loads
EvgeniiG Feb 9, 2021
dbb9c5c
Use the depth buffer for light culling (disabled feature)
EvgeniiG Feb 10, 2021
8812384
Merge branch 'master' of https://github.com/Unity-Technologies/Graphi…
JulienIgnace-Unity Feb 11, 2021
70b9577
Fix planar reflection probes
Paulm-Unity Feb 17, 2021
a10cec9
[DRAFT] zbinning XR support (#3855)
thomas-zeng Mar 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.Rendering.HighDefinition;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Experimental.Rendering;
#endif

public class BakeProbes : MonoBehaviour
{
public ReflectionProbe[] refProbe;

IEnumerator Start()
{
yield return new WaitForSeconds(0.5f);
foreach (var probe in refProbe)
{
Lightmapping.BakeReflectionProbe(probe, "Assets/" + probe.ToString() + ".hdr");
HDAdditionalReflectionData addRefData = probe.gameObject.GetComponent<HDAdditionalReflectionData>();

Texture texture = (Texture)AssetDatabase.LoadAssetAtPath("Assets/" + probe.ToString() + ".hdr", typeof(Texture));
addRefData.bakedTexture = texture;
yield return null;
}
#if UNITY_EDITOR
var system = ScriptableBakedReflectionSystemSettings.system;
system.BakeAllReflectionProbes();
#endif
}

}
Loading