userSam Pavloviccancel
branchsbox/mastercancel

645 Commits over 1,461 Days - 0.02cph!

8 Months Ago
Actually set D_MSAA combo on depth_downsample
8 Months Ago
Vulkan: Fix validation errors with MSAA disabled, this should fix a lot of crashing problems for people playing without MSAA
8 Months Ago
Remove last references to lightbinnervr Readd Dynamic/Baked light settings on hammer
9 Months Ago
Fix build
9 Months Ago
Move light culling renderer to scenesystem and remove GetPtrValue hacks from it, we'll call it from lightbinner to pass results from light culling, layers still exist on renderingpipeline for ordering
9 Months Ago
Revert "Move depth prepass to be the first pass of everything, we'll use it on lightbinner for light culling from now on" This reverts commit 65bc314734f0003a9d2dc5c10e5f7da3a11a8db0.
9 Months Ago
Move depth prepass to be the first pass of everything, we'll use it on lightbinner for light culling from now on
9 Months Ago
Hash view ID to FindOrCreateFrameBufferScratchTexture as well to solve collision when we have multiple views with same resolution, eg with splitscreen Fix dynamic reflections and AO in viewported views Add compiled shaders for viewport shading fixes Texture barriers for SSR in multiple viewports
10 Months Ago
Revert "Remove bloom effects layers ("QuarterResEffects"), nothing is really using it, can be better done outside managed if you really want it, was used for the cool HLA ghost effects, did a quarter res depth downsample that was never used" This reverts commit f2ff2e24581df8b38093cce5717420957680fecd.
10 Months Ago
Revert shadow submition refactor, I'll revisit this in a bit
10 Months Ago
Don't actually flag a decal as translucent, makes them render twice since we have a specialized decal layer, on top of that when rendering as translucent it wants a MSAA depth buffer that's missing, so we bind a non-msaa error texture that makes vulkan shit itself
10 Months Ago
Remove atlas resizing, feels overengineered, way we have adaptive shadow render size makes it feel pointless Let shadow frusta be calculated entirely on shadowcache, removes redundant calculations and makes the data flow saner, remove bullshit from LightEntry Add support for clearing rects from shadow atlases properly, queue them, fixes shadows on multicam views and childrens, note that shadow caching will still only happen on children views for now
10 Months Ago
Delete passthrough.vmat
10 Months Ago
Update all shaders for good measure
10 Months Ago
Default rendersystem to Vulkan ;) (#1429)
10 Months Ago
Read back the window size from the main window the OS created, Windows will clip the size to the desktop if it's too big and we will have unmatching resolution between what we specify in the swapchain and the actual hwnd
10 Months Ago
Fix m_bForceEnableDebugUtils running always even when we dont have renderdoc or validation layers enabled, triples your perfomance on vulkan
10 Months Ago
Assume test mode will want rendersystemempty Right now our tests machine doesn't have a GPU attached, for d3d11 it's fine since this runs over D3D11 Warp renderer, but not on Vulkan. Change this if we ever do graphics tests on CI. Running locally our tests pass fine without it
10 Months Ago
Fix Graphics.MipmapGen trying to generate one out of bounds mip
10 Months Ago
SubContext support on RenderContext (#1441) * Add IRenderContext::GetSubContext() to get or create a sub context for a new thread, use it in managedsceneobject Render contexts can never be passed between threads; they can only be used on the thread that created them. The thread index will be set in the constructor and can't change after that. This causes a problem in our current implementation of SceneCustomObject that reuses the threaded render context on the main thread and expects we can add things,modify and render it from there, for D3D11 it is not a problem since the implementation or driver seems to have a mutex for command lists, but on Vulkan that gives validation errors and causes crashes. This implements the concept of SubThreads to RenderContext, a very simple way to pass the render context around and consume it in a timely manner, it creates a new render context with the same characteristics as the parent one in a new thread and submits it when the parent context is released
10 Months Ago
Remove deferred rendering meshes from scenelight We no longer have a hardcoded path for rendering viewmodel shadows, that will be handled with a special component in managed Fix depth normalization on GetWorldPosition, since we are using 3D Skyboxes again we are splicing a bit of the depth range, fixes feathering on sprites again
10 Months Ago
Fix motion blur not working, simplify it, make it use the same reconstruction technique as in dynamic reflections, I still don't like it but this gives correctness to it https://i.imgur.com/YkSiZXY.png
10 Months Ago
gaussian_bloom_blur compiled material to fix bloom on dev builds
10 Months Ago
Write vertexobject on end of scope
10 Months Ago
Softer depth comparison for subsurface scattering Implement Depth::GetWorldPosition properly, document it nicely Recompile sprite with depth feathering
10 Months Ago
Make gizmos use DynamicSceneObject, add CMeshBuilder2::WithInstancedTransforms to flag mesh to use transform system without changing vertex layout, fix transforms on dynamicsceneobject in native
10 Months Ago
Remove Thread_DrawDrawList mutex, seems to cause some issues on testing, working on a proper solution for it anyway
10 Months Ago
Remove planar reflections from scenesystem, remove unused shared shader defs
10 Months Ago
Remove ScenePortal/CMonitorObjectDesc, render a camera to texture for same functionality
10 Months Ago
Compile water shader UI doesn't consume vertex clipping or even skinning
11 Months Ago
Only bitch that vkQueuePresentKHR failed when it's an actual fail condition, some conditions are still considered and enqueued Fix pObjectName in RenderDeviceVulkan::Construct, empty string check was inverted VK Validation: Fix texture transition in CSceneSystem::DownsampleTexture, this is not to use depth stencils but will always assume color Imply console apps want rendersystemempty, maybe revisit this in the future if we want them to do any kind of GPU compute VK: Remove deprecated debug marker in favour of debug utils, should be getting prettier output from GPU profiling tools too Remove a bunch of redundant vulkan render markers, makes gpu debugging finally show up properly nice looking https://i.imgur.com/7Mq0lhv.png Colors that don't melt my eyes Add a temp mutex to DrawDrawList to fix race condition when drawing from main thread Fix glow outline rendering https://i.imgur.com/cK9VbNB.png Renderdoc label colors for managed drawcalls were black Highlight.cs: should be SetCombo not Set Don't change fbstate with the viewport size, can cause it to be bigger than the fbstate size too, viewport offsetting is done just right below Make MultisampleScreen take the MSAA amount from the current context rather than from the main swapchain, fixes validation of effects using the wrong MSAA level as what the layer wants, fixes glow outlines in preview cameras Don't write glow to alpha, makes camera previews and screenshots not be translucent with them, compile shader Simplify water shader removing fog and other components, these would all be in it's own entity component now, much simpler, also the whole shader needs to be thrown away Never expose intermediary MSAA'd depth to the user, you're just opening a can of pain, use Depth::Get() method instead Shaders need removing old MSAA depth ("SceneDepth"/"DepthBuffer") Directional AO depth doesnt use MSAA Keep MSAA depth read for decals only Remove bloom effects layers ("QuarterResEffects"), nothing is really using it, can be better done outside managed if you really want it, was used for the cool HLA ghost effects, did a quarter res depth downsample that was never used Delete viewmodel AO ( Will come back as a reuseable generic component for camera ), ripplecompute ( unused, shit ), fix depth fetching on Glass to use Depth::Get Remove crumbs of viewmodel ao
11 Months Ago
Fix translucents rendering in opaque layer, corretly make shadows-only casting models use game excluded layer, make depth prepass exclude SCENEOBJECTFLAG_EXCLUDE_GAME_LAYER, fixes rendering of translucents being messed
11 Months Ago
Update shaders with SSS and baked lightcookie fixes
11 Months Ago
2D Skybox has inifnite bounds too
11 Months Ago
Meant to upload spritecard not skin
11 Months Ago
ToolsVisHandleTransmissiveLighting just takes two params now
11 Months Ago
Update citizen with per-vertex curvature and update materials to match new shader changes https://i.imgur.com/Dt9X3Vv.mp4
11 Months Ago
Fix directional lights dissapearing after going away a wee bit from origin, set up a bounding box that's big enough to enclose the whole universe
11 Months Ago
Don't try to normalize a black texel for hue/saturation shift on baked light cookies, fixes NaN when using cookies on baked lights
11 Months Ago
CSceneSunLightObject doesnt exist anymore Add transmission debug view Fix subsurface scattering shadowing, let transmissive mask be computed at lighting level, unify transmissive terms from skin and whatever else, should fix transmission in non-shadowd lights as well https://i.imgur.com/3h3yvhH.png Update skin shader
11 Months Ago
Fix complex combos
11 Months Ago
Simplify and fix tiled light culling in corners, makes tiles match mipmapped depth fetch perfectly Fix formatting typo Pass viewport offset to CDepthDownsampleLayerRenderer and offset it in the shader, fixes depth chain in multicamera scenes, always imply we're taking a full res downsample anyway Fix tiled rendering compositing in multicamera scenes https://i.imgur.com/wrqKgCO.png Compile shaders
11 Months Ago
Strip out monitors, viewmodel and 3d skybox rendering paths from renderpipeline, needs to be cleared from the rest of the codebase (cherry pick from renderingpipeline_cleanup ) but if we don't do it now we never will RenderingPipelineVr becomes RenderingPipelineStandard Remove remaining non-VR "VR" references from rendering pipeline, remote retinaburn and env interaction system that have been never used for us, some more of VR stuff could be taken out now that we do it mostly all in managed Don't shrug off scratch render target system errors after a while
11 Months Ago
Clean compile shader with light edge fix
11 Months Ago
lit decal shader
11 Months Ago
Fix tiled rendering on 32x32 tiles https://files.facepunch.com/sam/1b1411b1/wzae5tFco9.png
11 Months Ago
Loop rather than unroll on fog lights, should give worse perf but fixes horrid startup times for now
11 Months Ago
Revert to shaders just before cascade/point light edge fix, needs a full compile which is already queued
11 Months Ago
Lightbinner Refactor (#1266) * Moved tiled rendering buffers to lightbinner, where it should belong * Remove members that have long been deprecated, start adding support for structured buffer lights * Move all cbuffer stuff to legacy, standard will only have structured buffer path * Start implementing structured buffer lights data structure * Remove all code for calculating mixed shadows, that'll be all allocated in the main light shadow function, iterate structured buffers * Iterate on new lightbinner, let all shadows render through a single rendering path, disregard legacy for now * Remove bMixed from LightEntry, it's complete bullshit, let static lights render only dynamic objects when doing shadows * Unified shadow casting, map indexed lights so we can fetch them easily and without needing to order sequentially, remove more deprecated stuff * Get rid of lightbinner_legacy completely * Eliminate legacy per view lighting constants, eliminate mixed shadows, add placeholder to some constants where they should belong * Cut more code from lightbinner light allocs, means only spots will alloc properly for now but cleans a lot of this, align cbuffers, add ComputeDirectLightingForLight to unify lighting calculation on shader * Remove CSunLightManager, used for old pre-hlvr sun rendering, a lot of code that's only used for dynamic sunlight different to everything else in light rendering * Remove more unused parameters from lightbinner * Remove remaining crumbs of old sun shadowing, remove unused shadow functions, add bBaked to ComputeDirectLightingForLight * Lightcookies and point lights * Remove multiview constants from lightbinner, these have been getting in my way, and we need to think a better way to handle instanced viewports, I'm leaving it to a bigger cleanup later * Start Envmap support on new lightbinner, remove unused environment_map.fxc * Start MATERIAL_LIGHT_DIRECTIONAL support for lightbinner, sets up frusta for lights * Fix conflicts from merge that added removed stuff * Fixup for directional lights, add dummy ambient lighting for fully dynamic scenes, implement flags properly * Fix merge ( g_nNumEnvMaps > NumEnvironmentMaps ) * Remove interface definition from Vfx ( It's fucked off from HLSL 2020+ ), add array support to members in classes in Vfx * Store multiple frusta on same light definition rather than using sequential lights, makes this simpler, point light shadows * Ambient light, new strategy for shadow frusta * Disable r_enable_high_precision_lighting, just ends up overcomplicating code, reevaluate if this actually affects much away from world origin, will make vPositionWithOffsetWs just become vPositionWs in shaders if fully removed * Take shadow frustra from BuildShadowFrustaForLight() that matches what's on the shadow map renderer, rather than rebuilding it with twice the code * Test of multiple frusta support for shadow maps on shader 🥳 * Support for cascaded shadow maps on new unified multi-frusta system, needs to backport old code * Backport directional CSM code to unified BuildShadowFrustraForDirectionalLight in lightdesc * Shadow filtering and dummy ambient lighting * Calculate spot light resolution proportionally based on light cone and do a LOD system for light shadows based on distance, both are meant to be perceptual https://files.facepunch.com/sam/1b1211b1/sbox_rl2LTOMdY4.mp4 * CSM Adjustments * Pass envmap data to GPU * Fixups for cubemaps on shader, add test for ambient light IBL support https://files.facepunch.com/sam/1b1311b1/ibl.png * We dont need start indexes for lights anymore, just remap the index for fog and baked, fixup envmap count to shader * Remove refs to CalculatePositionToCameraDirWsMultiview function call in new lightbinner shader code * Cleanup, remove a bunch of unused or deprecated shit, cleaned up a lot of variable in lightbinner structured buffer that ends up not being needed, document things a bit better * Rename lightconstants.hlsl to lightbinner.hlsl and call the data there BinnedLight/BinnedEnvMap, make baked lights only cast shadows if mixed lights are enabled on them * Fix flags on lightbinner gpu include, oops * Refactor tiled rendering builder to be compatible with new lightbinner, make it implicit under lightbinner.hlsl * Fog lights support, remove second buffer that's meant for fog lights, remove bullshit code to support old directional light from it that was just meant to be tools-only, all light types just works now https://files.facepunch.com/sam/1b2111b1/C3pY5Q7jq9.png * Fix directional light farz https://files.facepunch.com/sam/1b2111b1/Jn16Ruj0ub.png * Remove SetShadowCascadeResolution and SetShadowCascadeDistance, both pointless, cascades use shadow resolution, add SetCascadeDistanceScale, make number of cascade count actually work * Add g_vRandomFloats to replace oddly named ScreenSpaceDitherParams, fix reflections and volume fog using that * Rename Tiled Light Builder to Tiled Light Culling, do fixes for the new system and shrink tiles to 32x32 from 48x48, allowing us to just take a single fetch from depth buffer for GPU culling tests * Fix lightcookie support, add support for colors on indexed lights with lightcookies, remove lightcookie index from lightbinner.hlsl, just pass the transform https://files.facepunch.com/sam/1b2711b1/zTwJgEDa7N.jpg * Add unified Subsurface Scattering support for skin shadiing, previously every light type implemented this differently causing shading differences, now baked lights show this correctly too https://files.facepunch.com/sam/1b2711b1/k5L2Punaav.png * Readd SetShadowCascadeResolution and SetShadowCascadeDistance as stub obsolte methods to not break existing games * Finalize things, fix misc warnings, fix SSR and enable directional lightmaps * Unify Two Lobe Specular and normal Specular * Test: do full checkout with clean on shader.yml, delete debug_shaders.yml ( pointless ) * Pass skycolor of multiple lights to renderer, works with multiple lights, fixes skycolor attribute doing nothing, while it'd be nice to just pass envmap diffuse lighting for ambients right now it'd break some workflows * Fix typo on cloth shading combos * Remove references to removed files in shaders * CI: Use git checkout to remove stashed changes, shouldn't error if there are no changes to save & drop * debug_sunshadow_vis is gone, update all_shaders with what's actually there * Add LightSupportsTimeSlicedRendering and filter directional lights out of it, fixes cascades being fucked on hammer * Loop rather than unrolling CalculateLightingAtPoint, sucks for perfomance but this function shouldnt take start and end indexes of the light, focus on correctness first * Fix trunkation warning * Pass correct envmap index * Reenable high precision lighting, it's all fine now (but still considering removing it) * [ Pick ] remove specialized decal rendering path from skin * Fix cascade scale for maps that arent compiled with the new light attributes * Apply indirect transmissive lighting, previously would only be affectted by direct lighting * Migrate light api to new lightbinner system * Get light culling render buffer from rendercontext rather than from layer * Fix compilation of tiled_light_culling on vulkan (wtf?) * Transpose matrices on d3d11 * Support for multiple suns and fog on atmosphere_sky, code for this still sucks since this came from the first days of development * Remove decal references in skin shader, thought I had that sorted :S * Remove decal_renderer from allshaders.txt * Compile shaders * Refactor fog shader to take lights by index rather than by list, unroll loops still * Minor fixes, x.Load(i) and x[i] has different behaviour between vk and d3d11? Compiled lit user shaders * Shader CI: Do git clean before pull * Compile core shaders * Compile user shaders * Compiled light culling material * Add lightData.HasFrustumFeathering() for seamless fading between light cascades * Consider one texel from edge to be considered outside the shadow region so that multiple frusta won't do smooth sampling on edges * Consider cascade to always be squared * Compile shaders --------- Co-authored-by: Matt Stevens <matt@mattstevens.co.uk>
1 Year Ago
Only share parent view's atlas if it has a lightbinner, fixes avatar menu, I'll revisit this tomorrow