15 Commits

Author SHA1 Message Date
Sam Pavlovic
f3d860a340 Bloom 3 (#5384)
* Re-do Bloom based how Jimenez, SIGGRAPH 2014 did, remove gamma shit, biquadratic shit, add bloom tint

* Compile shaders

* Format

* Adjust bloom tests, these are no longer relevant

* Mark obsolete properties for Gamma and Filter in Bloom effect

* Blend with rgb only
2026-07-30 17:12:33 +00:00
Lorenz Junglas
070179f75a Fix default baked hammer lights casting dynamic shadows (#5464)
Hammer lights default to DirectLight=Baked (lighting burned into the lightmap) + CastShadows=Yes.
2388933716 started reading that pair as "baked AND give it a realtime shadow map", so every light in every lightmapped map got one.

Now baked mean baked again and no real-time shadow map will be allocated for hammer lights with default settings.

Fixes https://github.com/Facepunch/sbox-public/issues/11551
2026-07-27 10:27:19 +02:00
Lorenz Junglas
f934e502ff Bump MaxFixedUpdates default back to 5
We already had this at 5 pre 8a9c4575 which claims to be a pure refactor so idk why the value was lowered to 2 in that refactor.

5 is more in-line with other engine, but still on the lower end. (Godot has ~7, Unity ~16, Bevy ~12-16, Unreal 6)

Fixes https://github.com/Facepunch/sbox-public/issues/11373
2026-07-15 13:38:23 +02:00
Antoine Pilote
e8eb99a218 Terrain Culling (#5240)
- Optimizes terrain shading
- Improved terrain heightblending
- Terrain Clipmap frustum culling
2026-07-14 08:44:57 -07:00
Garry Newman
f1d84c19f0 Rename new inventory/weapon classes to avoid conflicts (#5291) 2026-07-08 13:47:22 +01:00
Garry Newman
ca96c2a945 Make Inventory, BaseWeapon, AmmoResource, Screenshake first party (#5245)
https://sbox.game/dev/doc/gameplay/inventory-weapons/

Added

InventoryComponent - a slot based inventory, hotbar or shared bucket slots, with a starting loadout
BaseInventoryItem - base class for inventory items, with hooks to veto switching, holstering and dropping
BaseWeapon - a GMod style base weapon - fire modes, magazines and reserve ammo, reloading, dry fire, ballistics, spread, crosshair and HUD
BaseWeaponModel - view/world model base with muzzle flash, brass ejection, tracers and animation hooks
Ammo types are resources (.ammo) - weapons share reserve pools by type, clamped to a max reserve
BaseWeapon.ShootBullets / ShootBullet - bullet tracing with damage, impulse and hitbox tags
Weapon hold types editor
Animgraph enum parameters can be set by option name - Renderer.Set( "holdtype", "pistol" )
NpcUsage on BaseWeapon - engagement range and burst behaviour so NPCs can use any weapon
ICameraModifier - cameras compose their view through an ordered modifier chain, read the result from CameraComponent.View
CameraEffectSystem - screen shake, directional punches and tilts, with world epicenter falloff - camera.AddShake / AddPunch / AddTilt
EnvShake component - shakes the view, rumbles controllers, kicks physics
TracerEffect - an animated tracer line, ITargetedEffect for effects that fly at a target
SceneAnchor - a world position that can follow an object or bone
SkinnedModelRenderer.GetClosestBone( worldPosition )
Vector3.WithAimCone can take a custom Random for reproducible spread
Improve/Fix

PlayerController searches parents for IPressable when pressing
PlayerController camera runs through the modifier chain - IEvents.PostCameraSetup is obsolete
SoundPlayer preview uses shortcuts - Space toggles playback, Ctrl+Space restarts
Fixed Radius( 0 ) traces missing everything
Fixed NRE in AssetPreviewWidget
Removed

Removed CameraComponent.ISceneCameraSetup (obsolete since October, nothing uses)
2026-07-04 12:46:59 +01:00
Layla
a23e302df7 serialize polygonmesh to binary blobs (#5233) 2026-07-04 12:43:48 +01:00
Lorenz Junglas
19179890b8 Fix occluded sounds playing full volume on start (#5183)
* Hide Obsolete Sound Flags

* Fix occluded sounds playing full volume on start
2026-07-02 11:20:32 +01:00
Matt Stevens
c8e838d05d Revert "Depth of Field 3 (#5086)"
This reverts commit 27d012d833.
2026-06-24 10:07:19 +01:00
Sam Pavlovic
27d012d833 Depth of Field 3 (#5086)
* Depth of field rewrite with tile classification, indirect dispatches, remove focal range (bullshit)

* Clear Vertical/Diagonal DoF blurs across passes so we dont have artifacts from previous one across tile boundaries

* Dont waste more memory than we need for tiles

* Command list texture clears were being deferred to it's own context, do it on the same context immediately

* Do DoF after viewmodel & AfterViewmodel hook actually runs after viewmodel

* Since we precalculate the DoF max range per tile we dont really need this weird logic for optimization

* Fix shitty 1px line for dof when it intersects geometry
https://files.facepunch.com/sampavlovic/1b1411b1/sbox-dev_3p4zfSfTDx.mp4

* update shaders

* Readd focus range but make it almost as far as FarZ by default

* format

* Adjust tests for new behaviour for DoF, reset buffer data on command list
2026-06-24 05:41:22 +02:00
Layla
827d910a05 Closest point on heightfield (#5144) 2026-06-22 20:10:56 +01:00
Antoine Pilote
842203fb27 GTAO optimization (#4979)
* gtao atrous optimisation  - cache texture taps into groupshare tile buffer. before: https://files.facepunch.com/antopilo/1b0111b1/ngfx-ui_HB5GFcF66Z.png  after: https://files.facepunch.com/antopilo/1b0111b1/ngfx-ui_AeqfjvzQSr.png

* make working edge texture A8 instead of R16F

* sample texture closer together to limit staling

* remove third pass of denoising

* depth chain is now R16F instead of R32

* add safety

* move early out

* make number of atrous pass configurable

* Remove temporal denoise from AO, our spatial denoiser already kicks ass

* Early out was fucking grouopread on Spatial Denoise & remove unused Working Edges

* Denoise Normal is invariant of coordinate system

* Denoise passes in quality profiles

Co-authored-by: Sam Pavlovic <sam@sampavlovic.com>
2026-06-17 06:17:06 -07:00
Layla
27a70bbd1a Fix disabled bone objects bind pose (#5091) 2026-06-16 11:03:59 +01:00
Layla
c8fbe9f51b Terrain editor trace (#5080) 2026-06-13 18:12:30 +01:00
Garry Newman
d95169d8fa Unit Test Cleanup (#5064)
* Move all unit tests to Engine/Tests
* Fix Margin.EdgeSubtract
* Fix Capsule.Contains
* EnvironmentVariables.Remove if it's null
* Fixed ray trace never returning startedsolid
* Fix HistoryList.Navigate on empty list
* Fix GameObject.WorldPosition accepting NaNs
* Fix flex: initial expanding to the wrong grow/shrink
* Translation.TryConvert shouldn't throw on invalid enum strings
* Skip sound file tests on machines with no audio device
2026-06-12 13:23:50 +01:00