700 Commits over 1,553 Days - 0.02cph!
Add albedo absorption parameter to glass
https://files.facepunch.com/sampavlovic/1b1811b1/GpgOqFCTvs.png
Remove duplicate nvpatch postbuild event
Avoid using parallax for diffuse IBLs, it's causing issues with non-uniform scaled envmaps for minimal actual gains
https://files.facepunch.com/sampavlovic/1b1711b1/SMr1GfypB3.png
Feathering from legacy maps should point outwards rather than innards, still approximate with current behavior of world units
Readd IndirectLightScale property to lighting entities for enhanced control over light bounce brightness, values beyond 1.0f are not energy conserving
https://files.facepunch.com/sampavlovic/1b1311b1/sbox-dev_6TJvtGnbXi.png
Revert "Use Unix trailing paths for codegen"
This reverts commit eb86cb41a20dc2d3b57a0b5a67b2be5563d4d513.
Mac/Linux build scripts
Mac: Add Makefile for VPC so we can actually build it without actually having vpc
Rename some IOSALL flags to just PLATFORM_APPLE, we always imply arm64
SDL_config doesnt always imply windows
Update gitignore
Mac: Managed Build Scripts, no need for nvpatch for non-windows targets
Use Unix trailing paths for codegen
We aren't using m_pTransformBufferPrevData and probably won't need to with compute transforms, also remove m_hTransformTexture which has been deprecated for years
Add support for custom I16F color format, a generic grayscale 16-bpp float texture, unlike R16F it'll sample all channels to gray (#1813)
Update shaders
Fix implicit truncation
Mode fallback / VrForward > Forward (#1805)
* Add Mode fallback, used for both using Depth() as a fallback if shader doesn't have DepthNormal() and to move VrForward() to just Forward()
* VrForward > Forward, reverse fallback so that old shaders with VrForward use that still
* Remove duplicate Forward() and remove DepthNormal fallback
* Put mode fallbacks on materialsystem init instead of gameinfo
GrabFrameTexture/GrabDepthTexture returns grabbed render target instead of void
Use BC7 for default material input, higher precision than DXT5, this whole material input stuff feels like bogus now
Make sure we don't composite SSAO/SSR to glass, this can handled better
https://files.facepunch.com/sampavlovic/1b2911b1/rcWAoleK3t.png
Make shaders compile with Vulkan 1.2, allows for wave ops instructions used in new SSR, etc
Microsoft/DirectXShaderCompiler/wiki/Wave-Intrinsics
Bitch when variables are uninitialized in HLSL, can cause all sorts of weird undefined behavior in certain drivers
Fix warnings on all shaders, remove D_EYE_WHITE (bullshit?)
Avoid sampling diffuse cubemap for fog at lod0 to not have fireflies like in Eagle One Rain Demo
Reapply "Bindless lightmaps/Lightmap Combo Removal (#1765)"
This reverts commit de7b93d17c7a036a567347794ca51163132ef42a.
Reapply BATCH_FLAGS_CONTROLLING_COMBO_CHANGES for legacy shaders, accidentally removed binding lightmap for legacy shaders
Initialize vertex output of lightmap uv when lightmapping is disabled
Update drivers with bindless lightmaps & amd fix
Bindless lightmaps/Lightmap Combo Removal (#1765)
Overlay is considered a game layer since it draws to color, fixes depth prepass for overlays, remove overlay prepass from renderpipeline_standard
CommandList.GetRenderTarget with SizeFactor, don't allocate DepthTexture for it since it's not being used anywhere yet
Up TEXTURE_COMPILER_VERSION_MIP_GGXCUBEMAPBLUR version ( Negative cubemap color check )
Some float skyboxes have negative color, don't sample negative values when doing GGX filtering
https://files.facepunch.com/sampavlovic/1b1411b1/mspaint_YDO07zEdFf.png
Remove ToolsVis Mode (#1763)
* Remove ToolsVis from RenderingPipeline, remove ToolsVis combo, make it toggle through the integer only
* Remove ToolsVis() MODES from all shaders 🙏🏻
* Remove ToolsWireframe and ToolsVis from shadergraph template
* Legacy ToolsVis isn't even supported, any legacy variable refs to it can go
* Compiled shaders with branched ToolsVis
Accidentally yanked Src/DstBlend from Spritecard, also bring back shading complexity to it even if it makes code awful for now
Add EnvironmentMap class for EnvMap.hlsl, allows you to fetch contribution of all environment map lighting, fixes CubemapReflections toolsvis, move stuff out of lighting.fxc
Init ToolsVis color to gray if mode is not supported, same behaviour as before
Remove vr_tools_vis.fxc, have it all in ToolsVis.hlsl as a class, remove all dangling S_MODE_TOOLS_VIS combos
ToolsVis for Material lives in ShadingModel, custom shadingmodels implement their own
Rest of shaders that do custom toolsvis behavior with new api
Remove any #if S_MODE_TOOLS_VIS, makes it able to slide smoothly into new system
Let toolsvis combo live where it was before (we're removing it right after) and remove S_MODE_TOOLS_VIS reference on spritecard, baked light vis on shadingmodel
Add GetFirstTextureParam() to get first declared texture from shader, used to fetch the convoluted RepresentativeTexture/LightSim_DiffuseAlbedoTexture attributes without explicit declaration
Allow material representative texture for VRAD be infered by the first texture parameter on shader if DiffuseAlbedoTexture is not set, allows to clean up all this material api & lets shadergraph shaders be rendered properly on vrad
https://files.facepunch.com/sampavlovic/1b0611b1/aocrkIAnQN.png
Remove configdefaults.PLAT.vcfg, completely bullshit for us
PerViewLightingConstantBuffer_t completely unused
VRAD3 (& it's resourcecompiler) explicitly uses rendersystem, our tools can omit it but we need to read back textures from the GPU for map compilation
Launch ToolAppSystem pretending to be a dedicated server so it doesn't use rendersystem for CI, revert me soon
Reenable rendersystem for console apps for map compilation
Invert logic of bSupportsLightmapping, make explicit flag of "NoLightmapping", doesn't feel right to apply that flag in every shader when it all should just support it
Fix indirect IBL fog not working
https://files.facepunch.com/sampavlovic/1b1911b1/jVWTMafLaa.png
Do view vector TAA jitter for fog on native instead off shader, proper way to handle this specially on thin surfaces
https://files.facepunch.com/sampavlovic/1b1911b1/B2DSaqPTHe.jpg
Be able to fetch all light information with Light::Count() and Light::From(), while doing all optimization from tiled lighting etc
Move light.hlsl to common/classes/Light.hlsl, start unfucking it, make it have same structure as everything else
DynamicLight refactor
Refactor StaticLight class, can do Light::From() to get all lights (static/dynamic) at once
https://i.imgur.com/jqko5ON.mp4
Fuck of with light.environment, light.dynamic and light.static are just in Light.hlsl instead of own internal files
Move shadow functions to Shadow.hlsl, much like BRDF.hlsl, will make it easy for us to upgrade, move LightMap definitions to Light.hlsl
Vr_lighting never directly referenced from any of our hlsls now, tonemaps in lighting.fxc never used and even if used shouldn't be there
Untangle this stuff
Use ProbeLight::UsesProbes() and LightmappedLight::UsesLightmaps() to see if drawcall is using these instead of insane combo ifdefs directly, makes it easy to remove a combo too
Remove lightmapping combos from sbox_pixel (should fuck that file off entirely), move to shadingmodel.hlsl, keep D_BAKED_LIGHTING_FROM_LIGHTMAP for vertex.hlsl, SupportsLightmapping attribute seems unused
Revert "Lightmapping combos go on shadingmodel, Lightmapping definiton should be in shadingmodel.hlsl not Material.hlsl, material should be only a contract to shadingmodels"
Fucked, need to get rid of this stupid SupportsLightmapping attribute and just do it directly
Rewrite AmbientLight into a class, stub
Handle AmbientLightKind::LightMapProbeVolume and AmbientLightKind::EnvMap
Move BRDF stuff to BRDF.hlsl, organizes it and makes it easier to move to CS2's one with multiscatter
Adjustments for AmbientLight, disable subsurface scattering for this class for now
ToolsVis ambient occlusion doesn't take AmbientLight
Lightmapping combos go on shadingmodel, Lightmapping definiton should be in shadingmodel.hlsl not Material.hlsl, material should be only a contract to shadingmodels
Add namespace_name to antlr grammar so that we can do "type Class::Function()" definition instead of defining all in class itself, we should just let it accept any HLSL
Allow for inner feathering for EnvmapProbe in UI, same defaults for hammer equivalents of this
ggxcubemaphelper (cpu) is equivalent to cubemapper (gpu), increase sample count but use faster sampling and sample from first mip always
https://i.imgur.com/5UuaG0b.mp4
Sample from mips again and decrease sample count to not be absurd for our budget
Use custom mip filter that samples from neighbors for cubemapper
https://i.imgur.com/nn23dRG.png
Remove HighlightDeprecated from shaders, seems was never used?
Remove long unused shit from pixelinput and vertexinput and clean it up
Remove D_ENABLE_USER_CLIP_PLANE, complete bullshit, we use oblique projection matrices now
Use multi-bounce ambient occlusion
Feathering goes outer rather than center, allow to have inner (negative) feathering again, fixes light leaks in maps
SQRTRoughness was correct behavior for sampling envmaps
Initialize SSR to null on 3d skybox
Revert "Include ReflectionTextureColor in all the layers", it's unlikely we can manage to do SSR with roughness fast on translucents, and this causes the issue that SSR reflections from opaques will be drawn over smoke or translucents
This reverts commit 8cce50baf03cd7f93e7c89c75dde46319412aff9.
Add ScreenSpaceTrace as a generic, simpler class for doing screen space ray tracing, move reflections.hlsl to use it
Fix overriding SSR with a black texture when it should be initialized with a translucent one
Remove unused shit from lightbinner and make everything enums
Adjustments to cubemap normalization, make cubemap feathering happen from center of cubemap, and in world units, rather than inner, math is much simpler
Clamp cube box parallax projection to actual bounds box the box, cleanup
Our both our envmap filters uses linear roughness instead of sqrt roughness
Gizmo for scale in envmaps, adjust default for feathering in world units
Sort envmaps also by size, giving higher priority to smaller ones if it's in a draw condition
tiled light culling with edge feathering additions
vLevel isn't const
Update path of build-shaders, upload all shaders as artifacts
Fix EnvironmentMapLight::GetEnvMapColor using deprecated variable
Gamma correct samples during accumulated ggx, makes highlight less blown out and makes the cubemap more vibrant
Reenable MSAA fetching for SSAO compositing, don't use loops
Depthresolve takes first MSAA sample rather than doing min/max calculation, if we want depth::get we'd want the proper sample to compare perfectly on the screen
GTAO temporal filter uses edge detection to filter out edge ghosting
https://i.imgur.com/EzfclG7.mp4
Ao proxies removal (#1678)
* 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
* Remove sdf.hlsl (until we meet again 🫡 )
Compiled shaders with ao viewporting changes