userSam Pavloviccancel
branchsbox/mastercancel

645 Commits over 1,461 Days - 0.02cph!

4 Months Ago
Enable indirect lighting from IBL in volumetric fog shader, can be toggled with volume_fog_ibl_indirect https://files.facepunch.com/sam/1b2711b1/PIwbCCNGYB.png
4 Months Ago
Fix IBL not working, Transparency in AmbientColor is used to lerp between artist's decided flat color and IBL/GI, defaults to GI AmbientLight component defaults to Gray color
4 Months Ago
Don't implicitly set zfar as infinity, if we want to do so we can do from C# side, but make it respect what we pass as zfar
4 Months Ago
For legacy hammer maps, take global volumetric fog scale from VolumetricFogController
4 Months Ago
Fix ortho lights in SceneMapLoader and custom shadow size, note that shadow culling will suck on ortho lights until we change tiled culling to use frusta
4 Months Ago
Update shaders
4 Months Ago
Fix shitty jitter and noise in volumetric fog https://files.facepunch.com/sam/1b2211b1/NDCtmFBjFj.jpg
4 Months Ago
Adjust depth bias for gizmos and debug lines, we have way more granular precision than I thought
4 Months Ago
Cubemapper Fixes (#1627) Refactoring and fixes for Cubemapper, cleaned it up, makes it really WYSIWYG Makes them work on Scene viewport Updates any time they're dirty Barriers should be set properly now Parallax for ambient envmap lighting Diffuse lighting from envmap should be working properly now Cubemap feathering is tighter by default now, should fix some "leaks" now that skybox is also a global cubemap
4 Months Ago
Use two passes for ggx cubemap filtering just like in cubemapper Use bilinear filtering for SampleEnvironmentMapLevel, worth the tradeoff since we're much faster now Up sky.shader version
4 Months Ago
Make SSR reconstruction ghosting less apparent
4 Months Ago
GGXCubemapBlurHelper::GetFaceAndUVFromDirection was giving mirrored directions, recode it to point to correct direction, GGX skyboxes look very nice now, fixes a few issues specially in low resolutions, up sky.shader version so CI rebuilds textures
4 Months Ago
Fix terrain clipmaps being generated at the shadow map's position rather than the main camera's when rendering shadows
4 Months Ago
Make sure light cookie is resident and valid if we're getting it's index for lightbinner
5 Months Ago
Fix Depth::GetWorldPosition dividing by zero on skyboxes, pass epsilon to it use Depth::GetWorldPosition on Motion Blur, fix darkening/overbrightening of it based on sample count
5 Months Ago
Don't try to compile shaders that have missing source files
5 Months Ago
Do draw opaque objects flagged with no depth prepass, also set correct behaviour for SCENEOBJECTFLAG_NO_Z_PREPASS on actual depth prepass layer
5 Months Ago
Envmap Ambient Lighting + Sky Envmaps (#1568)
5 Months Ago
Remove alphatest layers and unused attributes, all done in opaque pass Depth Fast Path was fucked up with material overrides, disable depth fast path on that batch if we're using material overrides then, this whole system seems complicated to begin with too, additionally material flags were not being updated when you did a SetMaterialOverride This fixes translucent material overrides rendering as if they were opaque https://files.facepunch.com/sam/1b2811b1/UNobtq1Qnd.png Handle translucency flags for material overrides in renderingpipeline Nullcheck bMaterialOverride
6 Months Ago
Remove Log.Info from SceneCubemap
6 Months Ago
How did this end up here
6 Months Ago
Only do SceneCubemap.RenderDirty() when it actually updates rather than every frame Only clear up light count instead of also envmap count on AllocateLights()
6 Months Ago
Vulkan: When a swapchain needs an update, update only that specific swapchain rather than all of them, remove that stupid EnsureSwapChainsUpToDate too, fixes resizes on tools looking horrible too Handle NativeRenderWidget presents outside of Begin/FinishRenderingViews block, a lot of the logic for rendering is in the RenderingViews block and was getting stomped on, the hack we had before only hid that, separates render/present steps cleanly, should fix vulkan crash issues on tools
6 Months Ago
Make sure we only load skybox if it uses a sky shader, CSkyBoxObjectDesc expects a static input layout and causes validation errors if anything else is assigned, this also makes sure you can only select skybox materials
6 Months Ago
Only ensure swapchains up to date in tools mode and dont let hostedwidget change videomode, that's also handled by EnsureSwapChainsUpToDate and was causing a vulkan crash Fix Directional AO shader, it was broken for a while and nobody noticed, add a proper falloff curve to it, I feel like just deleting this and starting new with the new Scene Distance Field AO stuff
6 Months Ago
Use explicit UAV barriers for cubemapper
6 Months Ago
Sort envmaps properly Fix debug vis on Material API https://i.imgur.com/v1jw9qv.png Ambient occlusion debug vis https://files.facepunch.com/sampavlovic/1b2311b1/ao.png
6 Months Ago
Ensure all swapchains are up to date before doing any rendering rather than when doing it per swapchain when the NativeRenderingWidget renders Finally get rid of that renderdevice window hack that has been there forever, do SetWindowPos correctly in hostedwidget for main window Use SizeToParent to set initial window position initially for HostedWidgets
6 Months Ago
Do an initial clear initialization on FindOrCreateFrameBufferScratchTexture to make sure the data is not garbage, should fix SSR accumulation artifacts specially on multiview UI-only clears should respect if ( r_ui.GetBool() ) as also per sbox/issues/1575 , will check to make this a clear layer rather than a render layer
6 Months Ago
Use intermediary texture to avoid collision in filtering generated cubemaps, this should fix the cubemap corruption in certain hardware
6 Months Ago
Revert to NativeRenderingEngine hack, still need to deal with edge cases, I'm debugging it better
6 Months Ago
Use Present() which also has logic to handle swapchain size changes for widgets than HandlePendingSwapChainResize()
6 Months Ago
Fix shitty hack on RenderScene()
6 Months Ago
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
7 Months Ago
Bindless Lightcookies (#1556) https://files.facepunch.com/sampavlovic/1b0211b1/lightcookies.png
7 Months Ago
Bindless Cubemaps (#1552)
7 Months Ago
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
7 Months Ago
Fix typo, not meant to pass high precision offset to fog, just direct position https://i.imgur.com/EGNuSTA.png
7 Months Ago
Shadow Cache + Time Sliced Shadows (#1535)
7 Months Ago
Make atmospherics on shadingmodel take position with offset directly, recompile terrain with it, fixes volumetric fog on terrain
7 Months Ago
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
7 Months Ago
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
7 Months Ago
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
7 Months Ago
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
7 Months Ago
GPU Shadow Culling (#1523) --------- Co-authored-by: Matt Stevens <matt@mattstevens.co.uk>
8 Months Ago
Fix tiled rendering on multiple viewports, was taking the main viewport from view rather than the actual viewport from layer :S https://i.imgur.com/PCXh3hJ.png
8 Months Ago
Temp hack fix device lost error in NativeRenderingWidget.cs
8 Months Ago
Check if main camera is null for EnvmapProbe dynamic renders
8 Months Ago
Cubemapper (#1504) * Cubemapper tests * Remove all ggx code for now & just copy directly to cubemap array * TextureCube with mipmaps and arrays and mipmaps * Move texture logic from cubemapper to c# * Stub for cubemapper_cs, will calculate both GGX and spherical harmonics all in GPU * Handle all array index stuff in cubemapper * Allow for single sliced cubemap array, needed to be able to render an independent texture in the renderer since it expects a TextureCubeArray, also allow TSPEC_CUBE_CAN_SAMPLE_AS_ARRAY if we want UAV Also fix a problem where CTextureManagerVulkan::GetImageView wouldn't work with a cubemap array as a rwtexture2darray in compute shaders * Fix cube orientation when copying, do texture per envmap probe instead of a singleton array, this will cause headaches with multiple envmaps intersecting but makes it much simpler * GGX filtering * Don't bother with writing cubemap normalization right now (in fact disable it for now!), reuse previous mip so that we have more quality with less samples * Assert isn't valid anymore in ComputeImageViews since we can pass a cube array * Do cubemapper processing of all faces at once without using intermediary copies, 4-8x speedup (~17ms > ~2.5ms), still needs to be faster https://i.imgur.com/b61mX1Y.png * Rendersystemvulkan: Alllow binding specific cubemap [ & arrays ] mips if UAV * Remove unsued, clean up * Dynamic cubemap component settings * Remove the old BuildCubeMaps * Add WidgetUtil.CreateSwapChain * NativeRenderingWidget renders in regular render path * Fix RenderDeviceInfo_t wrong size * Add HandlePendingSwapChainResize for explicitly handling swapchain resize events before doing any work, fixes NativeRenderingWidget.RenderScene rendering on a frame with different window size than the actual swapchain ( and then having invalid color/depth buffers) * CI fails building shaders when machine is coming from a branch that was deleted, full checkout action should be enough for pulling? * If cubemap has no normalization set, don't consider it for NormalizeCubeBrightness * Compiled shaders with normalization brightness fixes for cubes without SH, reenable cube normalization * Wip fast cubemap filtering ( 2.5ms > 0.09ms 😱 ) * Adjust things on fast envmap filtering, major cleanup, rename shader to envmap_filtering * Use high quality GGX filtering if baking cubemap as OnEnabled * Vulkan: Fix image transition layout when binding a mip of a cubemap that's sampleable as Texture2DArray * Don't fetch render attributes from context, that's composited over, fixes a crash * Assert when UAV Index is invalid * Flag hammer maps to always render cubemaps dynamically & always render at least one frame regardless of distance update settings * Ignore cubemap precomputed handshakes, we can add and remove cubemaps at will on scene, those do not have handshakes so the entire thing was already deprecated when we implemented maploader, this cache gets built by m_nCachedEnvMap at runtime This fixes scene cubemaps not showing on static map geometry * ANTLR: Support any dimension arrays * Use fast envmap filtering even for static ones, looks as good if not better than brute forcing if using a few more taps, delete reference_ibl_lighting.fxc (byebye) * Run filtering in two passes to eliminate any fireflies, realtime filtering looks as good as baked filtering now https://files.facepunch.com/sampavlovic/1b2911b1/465thMK9Yq.jpg * Limit number of simultanious cubemap updates on first load to not overflow transform count in large scenes * Remove S_SPECULAR_CUBE_MAP, stupid define, should just be S_SPECULAR * Extra checks on HandlePendingSwapChainResize, should fix device lost issues when trying to draw subsequently * Adjust number of threads on envmap filtering to avoid collision on accessing same source cubemap on per frame cubemap rendering, doesn't really slow this down * Fix missing textures when trying to query cubemaps from skybox, default value for EnvironmentMap should be thrown from lightbinner, not renderingpipeline * Update shaders --------- Co-authored-by: Garry Newman
8 Months Ago
Don't flag SceneObject and SceneModel as ESceneObjectFlags.IS_OPAQUE, the materials should dictate it, fixes translucent materials drawing in opaque passes (& drawing twice)