1,728 Commits over 1,491 Days - 0.05cph!
[pick] Add Motion.hlsl for motion vectors
Iterate GTAO, start deoising, remove unused shit, fix bug with binding too many textures on the lexer
Remove old SDF functions entirely (byebye)
Iterate GTAO, works almost perfectly ingame, add noise function to it
Iterate GTAO, use built in uint encoding for passes, all 3 passes work, workaround for dxc compiler bug with dot product with half floats
Calculate gtao depth and normals properly, use inverted depth for gtao
Remove overriding SkyIndirectLighting to false in hammer maps, a lot of public maps are built without lighting and rely on IBL to have ambient lighting, we don't have a good way to tell if a map has baked lighting on MapLoader, better to just keep this on and let artist elect if they want IBL lighting by themselves
Add experimental r_tiled_rendering_conservative_culling so people can play with it, uses near-z approach for tiled culling for even better perfomance, doesn't play well with translucents, will be deprecated when we have two sets of light lists
Don't do OnDisabled(); OnEnabled() on Skybox2D dirty but clean up probe cleanly if needed
Test tl, tr, bl and br corners instead of updownleftright for cone frustum culling
Tiled Frustum Culling (#1669)
SkyBox2D Indirect Lighting ( Reflections/IBL ) can be toggled, hammer maps don't expect skyboxes to be used for lighting since it has vrad
Be more conservative by testing 4 points of cone base rather than a sphere shape
Tiled Frustums
Start moving tiled_light_culling to use frusta
Iterate frustum tiled culling
Near/far tiled frustum planes
Very simple ConeIntersect and AABBIntersect
Cubemap frustum cullinng
Show cubemap complexity on tiled debug vis as well
https://files.facepunch.com/sampavlovic/1b2911b1/HM0UBknyYv.png
Set up things to use worldSpaceNear to fix orthographic rendering with tiled rendering, use depth min/max for building tiled frustums
https://imgur.com/a/tybd5Dv
Fix ortho projection for CalculateScreenTiles
fix DepthMinMax on ortho projections, fixes tiled lights on ortho projections
https://files.facepunch.com/sampavlovic/1b3011b1/ZiyxdtwHc1.png
Delete tiled_frustums_cs, main shader does everything, we recalculate it every frame anyway since we also match the depth chain for the far plane, can store it later again from it if we need it for anything
Transform plane directly to local instead of using inverse matrix
Light.GetInvertedRadius() not used anywhere, let's make it Light.GetRadius()
Push radius changes to lightbinner.hlsl
Fix frustum calculation so it wouldnt mess up with low farz, fix FetchDepthMinMax
Using invprojrow3 to linearize depth feels a bit incorrect specially when moving far-z use correct algorithm, can be accelerated later
Depth Near-Far was inverted on tiled_culling, perfect for both near/far planes now
Allow using conservative near-z culling with D_CONSERVATIVE_CULLING and remove elegibility of D_DEPTH_PREPASS, we always have it
https://i.imgur.com/9UlrmTc.png
https://i.imgur.com/joEz72S.png
Allow using conservative near-z culling with D_CONSERVATIVE_CULLING and remove elegibility of D_DEPTH_PREPASS, we always have it
https://i.imgur.com/9UlrmTc.png
https://i.imgur.com/joEz72S.png
Using invprojrow3 to linearize depth feels a bit incorrect specially when moving far-z use correct algorithm, can be accelerated later
Depth Near-Far was inverted on tiled_culling, perfect for both near/far planes now
Fix frustum calculation so it wouldnt mess up with low farz, fix FetchDepthMinMax
Push radius changes to lightbinner.hlsl
Light.GetInvertedRadius() not used anywhere, let's make it Light.GetRadius()
Transform plane directly to local instead of using inverse matrix
Tiled Frustums
Start moving tiled_light_culling to use frusta
Iterate frustum tiled culling
Near/far tiled frustum planes
Very simple ConeIntersect and AABBIntersect
Cubemap frustum cullinng
Show cubemap complexity on tiled debug vis as well
https://files.facepunch.com/sampavlovic/1b2911b1/HM0UBknyYv.png
Set up things to use worldSpaceNear to fix orthographic rendering with tiled rendering, use depth min/max for building tiled frustums
https://imgur.com/a/tybd5Dv
Fix ortho projection for CalculateScreenTiles
[pick] Fix Depth::GetLinear and add Depth::Linearize
fix DepthMinMax on ortho projections, fixes tiled lights on ortho projections
https://files.facepunch.com/sampavlovic/1b3011b1/ZiyxdtwHc1.png
Delete tiled_frustums_cs, main shader does everything, we recalculate it every frame anyway since we also match the depth chain for the far plane, can store it later again from it if we need it for anything
Apply cubemap normalization properly on flat ambient light
Apply subsurface scattering to IBL lighting, looks shit otherwise
https://imgur.com/a/yipFu52
Iterate GTAO
Iterate GTAO
Fog Fix, allows you to change light settings for volumetric fog specifically and does a massive cleanup, last try of this had some perf issues but should be sorted
Squashed commit of the following:
commit 4c0d34857bb545c62a83b6b09ef65261dca3ddd8
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Thu Oct 3 18:41:48 2024 +0100
We dont use CLightBinnerStandard::InitForView twice in same view, rename GetLightbinnerStandard from scenesystem to not conflict with views getlightbinnerstandard which has different behavior
commit 8f3d1244f38a74525bcba28dc520ae5bf1dd1099
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Wed Oct 2 14:06:40 2024 +0100
Make fog lights buffer persistent with the volumetric fog's lifetime
commit 0d5bee31cad9b54fc75e2dbff85accfd03d7b3e1
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Wed Oct 2 13:52:39 2024 +0100
Make sure this is properly inlined to never trash cache
commit 5709fcf4b113088c684c095fc08d05fe176f940c
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Wed Oct 2 11:46:35 2024 +0100
LightBinner::InitFromParent and disable fog shadows
commit 93fa098f5c55bddfa4b3d3261b26b7c9edfc8dd8
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Tue Oct 1 18:01:49 2024 +0100
Some lightbinner cleanup, allow it to be used directly without the complex system that scenesystem wants, remove bRenderFogClipmaps for
commit 6f0125fd6ad1bf5512346ffe3c727532a6687cf4
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Fri Sep 6 13:23:03 2024 -0300
Put fog mode in it's own category and add nice icons to them
https://files.facepunch.com/sam/1b0611b1/zwd8qAJFu7.png
commit 0ff3702c73cf54edddc5dd82b8c54598904fae10
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Fri Sep 6 13:14:08 2024 -0300
Share dynamic shadow atlas if we have more than one lightbinner per view ( for example, fog ), fix light fog strength
commit 50170c166dd1cc37d863046aa632a30fb6629860
Author: Sam Pavlovic <sam@sampavlovic.com>
Date: Fri Sep 6 12:47:35 2024 -0300
VolumetricFogRenderer has it's own lightbinner outside of lightbinner pool, does lightbinning to fetch fog lights for the fog context only, fixes fog light settings not doing anything, deprecate LAYERFLAGS_NEEDS_FOG_CONTRIBUTING_LIGHTS since we don't need special code for that anymore
Don't update shadows on fog pass, some lights are set to be updated always but should all be fetched from cache
We dont use CLightBinnerStandard::InitForView twice in same view, rename GetLightbinnerStandard from scenesystem to not conflict with views getlightbinnerstandard which has different behavior
VolumetricFogRenderer has it's own lightbinner outside of lightbinner pool, does lightbinning to fetch fog lights for the fog context only, fixes fog light settings not doing anything, deprecate LAYERFLAGS_NEEDS_FOG_CONTRIBUTING_LIGHTS since we don't need special code for that anymore
Share dynamic shadow atlas if we have more than one lightbinner per view ( for example, fog ), fix light fog strength
Put fog mode in it's own category and add nice icons to them
https://files.facepunch.com/sam/1b0611b1/zwd8qAJFu7.png
Some lightbinner cleanup, allow it to be used directly without the complex system that scenesystem wants, remove bRenderFogClipmaps for
LightBinner::InitFromParent and disable fog shadows
Make sure this is properly inlined to never trash cache
Make fog lights buffer persistent with the volumetric fog's lifetime
LightBinner::InitFromParent and disable fog shadows
VolumetricFogRenderer has it's own lightbinner outside of lightbinner pool, does lightbinning to fetch fog lights for the fog context only, fixes fog light settings not doing anything, deprecate LAYERFLAGS_NEEDS_FOG_CONTRIBUTING_LIGHTS since we don't need special code for that anymore
Share dynamic shadow atlas if we have more than one lightbinner per view ( for example, fog ), fix light fog strength
Put fog mode in it's own category and add nice icons to them
https://files.facepunch.com/sam/1b0611b1/zwd8qAJFu7.png
Some lightbinner cleanup, allow it to be used directly without the complex system that scenesystem wants, remove bRenderFogClipmaps for
If Graphics.RenderTarget is not overriden, let it return the actual output rendertarget so you can fetch MSAA textures without copy ( you're going to shoot your own balls using this if you dont know what you're doing )
Fix Depth::GetLinear and add Depth::Linearize
[pick] Fix Depth::GetLinear and add Depth::Linearize
fix DepthMinMax on ortho projections, fixes tiled lights on ortho projections
https://files.facepunch.com/sampavlovic/1b3011b1/ZiyxdtwHc1.png
Fix ortho projection for CalculateScreenTiles
Set up things to use worldSpaceNear to fix orthographic rendering with tiled rendering, use depth min/max for building tiled frustums
https://imgur.com/a/tybd5Dv
Show cubemap complexity on tiled debug vis as well
https://files.facepunch.com/sampavlovic/1b2911b1/HM0UBknyYv.png
If Graphics.RenderTarget is not overriden, let it return the actual output rendertarget so you can fetch MSAA textures without copy ( you're going to shoot your own balls using this if you dont know what you're doing )
Tiled Frustums
Start moving tiled_light_culling to use frusta
Iterate frustum tiled culling
Near/far tiled frustum planes
Very simple ConeIntersect and AABBIntersect
Just get rid of F_DISABLE_Z_PREPASS entirely, it's not applicable for users to set it, static overlay uses BoolAttribute( NoZPrepass, true ); directly
use default depth_only combo for skin
Remove F_DISABLE_Z_PREPASS from shaders except if you want it explicit, remove it from eyeao until we recompile shaders
Remove aoproxies ambient occlusion, it never looked too right and it's stupid to have artists authoring them manually, almost no one did
I still think SDF AO works better than SSAO in most cases, but they should live as a renderhook and artists don't need to touch anything, the way it is now is very hard to maintain, it could be 10x simpler
VrMonitor goes long unused since we removed SceneMonitor & VR Multiview
Replace AO on shader with a single, non-directional AO but that composites properly, older shaders wont have incompatibility problems, also makes Dynamic Reflection work without ao
AO on lighting pass
GTAO stub, remove sdf.hlsl (until we meet again 🫡 )
Iterate gtao
Fill up _renderTarget on Graphics Scope so that we can fetch the immediate color/depth textures also without a copy
Fetch depth and color directly for DoF so that we can do pixel perfect fetches, start making near dof not shit
Fix Depth::GetLinear, be expressive about it for correctness before all, precompute these values later
Start fixing up dof https://files.facepunch.com/sam/1b2211b1/ombChoX97P.png
Iterate DoF
Smooth fade DoF from composite shader
Iterate dof, needs cleanup, almost perfect
Wave intrinsics to do early out for far dof
DoF2 Downsample with bias based on depth, cleanup
https://files.facepunch.com/sam/1b0211b1/sbox-dev_rXaN2wxsmC.mp4
Front blur, tweaks
Final tweaks, add depth gap for adding an area where u might want more focus
https://files.facepunch.com/sam/1b0211b1/sbox-dev_VBIoPeaBWP.mp4
Depth Resolve writes to both channels correctly
Final cleanups for dof2
Enable autoexposure for other tonemaps
https://files.facepunch.com/sam/1b1311b1/sbox-dev_mAXJ3CQmYe.mp4
We were multiplying BRDF twice making envmaps look awfully dark
https://files.facepunch.com/sam/1b1311b1/E8pK9UTpn4.png
Avoid directional lights clipping with world with a reasonable value
Ensure proper number of maximum simultanious updates for EnvMapProbe dirty updates
Destroy buffers properly when deleting lightbinner
Move s_LightList out of singleton to the CLightObjectDesc, make other light-like object descriptors use CUtlVectorFixedGrowable instead of linked list ( trashes the cache while iterating ), all of them should be consistent now, use a single light descriptor for all light types
Tiled Culling Renderer buffers shouldn't live in Lightbinner, but instead on CLightCullingRenderer itself since they're rendered per view, so we just reuse that memory, Lightbinners are allocated in a pool, so all that memory was wasted on GPU, remove wasteful copy of binned lights on tiled light callback
Don't generate shadow frusta for unshadowed lights
Separate shadow generation, both shadow maps and the viewproj we pass, into SetupShadowsForLight in Lightbinner, when we do bindless shadows and lightbinner caching, this is where to look for it
Go back to do a copy of current light list for CLightCullVisibilityReadback, callbacks can have latency longer than one frame and that list could change
Cleanup, fix mixed logic for shadows
Fix lights and their cookies not being able to rotate on roll
Add baked lights after dynamic ones
Move s_LightList out of singleton to the CLightObjectDesc, make other light-like object descriptors use CUtlVectorFixedGrowable instead of linked list ( trashes the cache while iterating ), all of them should be consistent now, use a single light descriptor for all light types
Tiled Culling Renderer buffers shouldn't live in Lightbinner, but instead on CLightCullingRenderer itself since they're rendered per view, so we just reuse that memory, Lightbinners are allocated in a pool, so all that memory was wasted on GPU, remove wasteful copy of binned lights on tiled light callback
Don't generate shadow frusta for unshadowed lights
Separate shadow generation, both shadow maps and the viewproj we pass, into SetupShadowsForLight in Lightbinner, when we do bindless shadows and lightbinner caching, this is where to look for it
Go back to do a copy of current light list for CLightCullVisibilityReadback, callbacks can have latency longer than one frame and that list could change
Partial backport of ISceneObjectDesc::OnSceneObjectVisibleInView
Add lights to lightbinner through CLightObjectDesc::OnSceneObjectVisibleInView instead of LightBinnerStandard::AddLights
Add stub GBuffer.hlsl for DepthNormals() mode and move ToolVis to it's own file and class so it's not a mess, aiming to remove ToolVis() mode, S_DISABLE_SPECULAR_HIGHLIGHTS not referenced anywhere
Don't add more lights to visible list than the list can permit, this relatively low limit is silly but don't want to break api until frustum tiled cull is here https://files.facepunch.com/sam/1b1011b1/parsecd_CiKjzyScdq.mp4
Don't add more lights to visible list than the list can permit, this relatively low limit is silly but don't want to break api until frustum tiled cull is here
https://files.facepunch.com/sam/1b1011b1/parsecd_CiKjzyScdq.mp4
Lightbinner caching experiment, AddLight still sucks and we need to deal with shadows and faster insertions
https://files.facepunch.com/sam/1b1011b1/NkiL7ryaEs.png
Revert "Fog Fix (#1661)", causing some slowdown problems, will be
brought back shortly
This reverts commit f0981cbaf9679a34c219f57cd232a638f60d463f.