1,728 Commits over 1,491 Days - 0.05cph!
Use intermediary texture to avoid collision in filtering generated cubemaps, this should fix the cubemap corruption in certain hardware
Make async optional, make CameraComponent still be async since we are not waiting for any other operation than itself
Make sure any GPU callbacks are finished before disposing of pixmaps on managed, read from RGBA8888 pixmaps directly
Make RenderSceneToPixmap non-blocking and fix annoying wasRendered assert
Revert to NativeRenderingEngine hack, still need to deal with edge cases, I'm debugging it better
Use Present() which also has logic to handle swapchain size changes for widgets than HandlePendingSwapChainResize()
Fix shitty hack on RenderScene()
Change GetShadowDownsampleLevel to calculate based on the percentage of how much the light is visible on the screen rather than distance heuristics, also adjust CalculateSpotResolution and increase base value
Invalidate light cache when a light moves
Backport new SceneSystemWellKnownTextureObjectID_t textures
Backport LightProbe from main, remove debug stuff (we handle it our own debug vis )
Remove AmbientLightSH from lightbinner, Directional Light doesn't control ambient color anymore, this is a visually breaking change, I'll see to put a better replacement to existing things
Set skybox as global cubemap
Be able to sample cubemaps from any resolution, use diffuse cubemap as diffuse indirect illumination if no GI in scene
Move pixel.raytrace.ssr.hlsl to ScreenSpaceTrace and make it a class, move crap from it to be all shared
More adjustments for screenspace shadowing, fix valid hit test always returning true
Bindless Lightcookies (#1556)
https://files.facepunch.com/sampavlovic/1b0211b1/lightcookies.png
Stub for shadow class, enumize lightflags
Sample lightcookies with explicit LOD since we can use this on compute as well
Remove ilightcookieutils, cookieslice, etc
Remove all references to lightcookiemanager, add Texture2D GetLightCookieTexture() to lightbinner
Fix typos and get bindless cookeies on shader, m_lightCookie is just a standard HRenderTexture now
Cookies on fog
Delete lightcookies.vtex which was a fixed array that we never really used
Bindless Cubemaps (#1552)
Bindless cubemaps!
Remove references to texture cube arrays
Remove all CPU path for envmaps, bindings, fingerprinting, etc, should've removed 3 years ago but now we're ready for it
Remove remainder of CPU-driven code for cubemaps, rename indooroutdoorlevel to just renderpriority
Update shaders
Sort envmaps by priority
Remove now unused m_bNeedsRender
Recompile terrain after rebase
Fix typos and get bindless cookeies on shader, m_lightCookie is just a standard HRenderTexture now
Remove all references to lightcookiemanager, add Texture2D GetLightCookieTexture() to lightbinner
Remove all references to lightcookiemanager, add Texture2D GetLightCookieTexture() to lightbinner
Remove ilightcookieutils, cookieslice, etc
Remove now unused m_bNeedsRender
Update shaders
Sort envmaps by priority
Remove remainder of CPU-driven code for cubemaps, rename indooroutdoorlevel to just renderpriority
Disable frustum shadow map culling using volume cullers, the view we render for the shadow is already doing frustum culling so I'm not fully sure if this is doing anything, on CS2 it seems to only be used for barn light shadows anyway ( And with an explicit illumination bounds OOB )? Fixes shadow flickering on props
Fix typo, not meant to pass high precision offset to fog, just direct position
https://i.imgur.com/EGNuSTA.png
Remove references to texture cube arrays
Remove all CPU path for envmaps, bindings, fingerprinting, etc, should've removed 3 years ago but now we're ready for it
Shadow Cache + Time Sliced Shadows (#1535)
Print actual lightdesc for shadow map on debug markers, cleanup
Readd shadow volume culling, CDrawShadowMapsForLightParams has all frusta inside itself, no need for multiple
Readd shadow volume culling, CDrawShadowMapsForLightParams has all frusta inside itself, no need for multiple
Remove all atlas downsampling bullshit, not even being used
Backport shadowcache from CS2
Backport more shadowcache code from cs2, start adapting lightbinner for new layout
Remove ConsiderLight and LightEntry, they're bullshit now and overcomplicated, used to figure out which lights had priority but not needed anymore, data flow is leaner now
Time sliced shadows + shadow caching
Remove shadow template views, doesn't make sense to have this code duplicated and makes it harder to work with it, I don't think we use those HLVR constants the code mentions, and if we do it should just be on the standard pipeline
Vulkan: Fix ClearImpl not respecting layer viewports smaller than the screen, and instead just clearing everything with a fast renderpass, this caused issues when we want to just clear a small rect
lb_time_sliced_shadows, fix directional lights not showing up, clear each rect when wanting to draw rather than having a complicated shadow atlas clear system
Make CSM to be re-rendered for each view since they are view-dependent, but we can keep the same tiles we reserved
Static vs. Dynamic object rendering for FindOrCreateShadowMapsForLight
Fuck off with subrect clearing on shadowcache, we do it much simpler on draw now which is guaranteed to be clean, our goal is to go bindless too so it doesnt even apply
Pass per view lighting constants to shadow, transition barriers to fog
Fix file move on vpc for shadowmap_texturebarrier_renderer.h
Make atmospherics on shadingmodel take position with offset directly, recompile terrain with it, fixes volumetric fog on terrain
Add mutex on read/writing m_CulledLights, guarantees it won't be overwritten twice while doing a callback before finishing rendering next frame or would write while allocating lights
Fix baked fog on scenes, only enable volumetric fog if there are any fog volumes in scene
https://files.facepunch.com/sampavlovic/1b2511b1/image%20%289%29.png
lb_indexed_pointlight_shadows. By default for now, don't cast shadows to indexed point lights if the cvar is set, rarely worth anything useful
Fix file move on vpc for shadowmap_texturebarrier_renderer.h
Fuck off with subrect clearing on shadowcache, we do it much simpler on draw now which is guaranteed to be clean, our goal is to go bindless too so it doesnt even apply
Pass per view lighting constants to shadow, transition barriers to fog
Make CSM to be re-rendered for each view since they are view-dependent, but we can keep the same tiles we reserved
Static vs. Dynamic object rendering for FindOrCreateShadowMapsForLight
Remove shadow template views, doesn't make sense to have this code duplicated and makes it harder to work with it, I don't think we use those HLVR constants the code mentions, and if we do it should just be on the standard pipeline
Vulkan: Fix ClearImpl not respecting layer viewports smaller than the screen, and instead just clearing everything with a fast renderpass, this caused issues when we want to just clear a small rect
lb_time_sliced_shadows, fix directional lights not showing up, clear each rect when wanting to draw rather than having a complicated shadow atlas clear system
Time sliced shadows + shadow caching
Remove ConsiderLight and LightEntry, they're bullshit now and overcomplicated, used to figure out which lights had priority but not needed anymore, data flow is leaner now
Backport more shadowcache code from cs2, start adapting lightbinner for new layout
Reduce parallel cubemap updates on load, we allocate a new lightbinner for each new parallel view and each of them allocates a lot of new GPU buffers when they should be shared, I'll revisit this after shadowcache
Remove all atlas downsampling bullshit, not even being used
Backport shadowcache from CS2
GPU Shadow Culling (#1523)
---------
Co-authored-by: Matt Stevens <matt@mattstevens.co.uk>
Remove all atlas downsampling bullshit, not even being used
Was accidentally creating new lightbinner (without light info I needed too) every frame :S CSceneSystem::GetLightBinnerStandard() is "FindOrCreate" while from CSceneView actually gets the actual one
GPU Shadow Culling
POC: Don't render shadows that are not visible by GPU depth bounds
sc_show_rejected_lights
enum support for VFX HLSL
We dropped DX11 support so we can support it without a worry
microsoft/DirectXShaderCompiler/wiki/Language-Versions#hlsl-2017
r_gpu_shadow_culling cvar, parallelize static light visibility tests
Cone intersection for tiled light culling
Bloat cones a wee bit, still do sphere culling for point lights
Move culled lights list for shadow culling to lightbinner rather than shadowcache, lightbinners are guaranteed to be per view (first order, first served though), this lets multiview work for culled lights
https://i.imgur.com/JwxhgOJ.png
Only show the considered lights in the debug view, we don't cull the unconsidered lights so it'd show them as unculled
Cast shadows of non culled lights, not culled lights.. wtf?
Only debug draw actual shadow casters, add spot light debug drawer
Fix debug views for dynamic lights, update comments