Commit Graph

95 Commits

Author SHA1 Message Date
wheatleymf
d751b0451d Hi-res screenshots use global antialiasing setting
- Instead of hardcoded 16x multisampling, `screenshot_highres` will capture the screen with current MSAA value set by user
- Might be useful when user needs to take a hi-res screenshot with no antialiasing at all
2026-01-29 13:07:31 +01:00
Lorenz Junglas
997db6d283 Scene.PreCameraRender fixes (#3931)
* Readd ScenePanel hack I remove, turns out it's needed
* Don't create material every frame for bloom layer
Fixes main thread assert for mirrors
2026-01-28 16:09:03 +00:00
Tony Ferguson
5a9c566730 Configurable GameObjectSystems (#3871)
* Project Settings moved to a window (child of main editor window)
* Can configure [Property] marked GameObjectSystem properties in Project Settings
* Moved Project menu options to the top right of the editor, added quick-access Project Settings button
2026-01-28 15:30:52 +00:00
Lorenz Junglas
ffd6e074dd Fix crash when rendering envmaps during an active render pass (#3919)
* Fix crash in ScenePanel.DrawContent

Remove redundant `PreCameraRender()` call in `ScenePanel.DrawContent`.

It was crashing when nested inside another render pass, and `CameraComponent.RenderToTexture()` already handles it correctly.

* Never RenderEnvmaps if already in a render pass
2026-01-28 12:27:35 +00:00
Conna Wiles
2f8d00a7ed Networking: Local Instance Id (#3912)
Every time we Join via New Instance, the new instance is given an new id - that id is used locally to determine the SteamId it gives the server (from some base SteamId for bots). This means you can properly test stuff like persistent data per SteamId rather than local instances using the same SteamId as the editor host. This is safe from spoofing though, because real servers and lobbies verify the SteamId the user provides.
2026-01-27 17:28:02 +00:00
Conna Wiles
70435c6cd5 Fixed Missing Large Network Files on Local Instance (#3907) 2026-01-27 16:37:57 +00:00
Sam Pavlovic
1fcec6a92e Indirect Baked Lighting - DDGI (#3420)
* DDGI stub with rasterized path

* Debug probes and fix stuff

* Simplify all of this, add system later

* Iterate, start integrate

* Integrate depth, allow copying depth to another format

* Iterate, fix depth, send ddgi volume data to gpu, start integrating on lighting compositing, almost there

* DDGIVolume gets bake button, doesnt bake automatically, correct transformation

* DDGI Visibility Tests wip

* DDGI Volumetric Fog
https://files.facepunch.com/sampavlovic/1b2911b1/sbox-dev_UCziuQjdTQ.mp4

* Fix ddgi depth integration, iterate

* Simplify this and correct octahedral coordinates seams

* Iterate

* Probe is 8x8, do normalization directly,  cleanup

* Bias probe position, visibility adjustments, make eveyrthing smoother

* Unify integration in SampleProbeData, still need to clean it further

* Unify integrate passes

* Add view bias and use border as per papers, fixes most distortion when using visibility at the same time
https://files.facepunch.com/sampavlovic/1b0411b1/sbox-dev_laDCpwFxk5.png

* Cleanup and fixes for border, cleanup sampling code too

* Proper compositing for DDGI for maps that have baked lighting already, could still have more thought to avoid uncessesary branching

* DDGI System, allow for multiple volumes in scene, cleanup
https://files.facepunch.com/sampavlovic/1b0711b1/sbox-dev_xcJUeit2s4.png
https://files.facepunch.com/sampavlovic/1b0711b1/sbox-dev_c59O7Bea6p.png

* Rebase fixes, the way to do this sucks

* Caching tests, Texture.GetPixels3D seems a bit messed

* ddgi.texturecache texturegenerator, much simpler, caches texture nicely and doesnt lead residues on ram after uploaded

* Add LPVDebugGrid on managed, make DDGIVolume use it, dont save cache texture on disable, works way faster than gizmos

* Update volume only if it's enabled

* DDGI on AmbientLight.hlsl

* Simplify and fixes

* ExtendToSceneBounds, rebake envmaps when bake finished, normalbias

* RENDER_DEFAULT_STATE_RASTERIZER probably shouldnt remove override of rasterizer state

* Cleanup

* [Pick] Fix TextureCompiler not compiling 3D textures properly, make Texture.GetBitmap work with 3D textures

* Add NoPrepassCulling, avoids "rays" from probes that are inside geometry from leaking light

https://files.facepunch.com/sampavlovic/1b1611b1/sbox-dev_bQfsZlWwop.png

* Final adjustments and cleanupj, name this Indirect Light Volume

* Indirect Light Volume prefab

* Remove log infos, adjust sliders

* Whoops

* format

* Rebase fix

* Re-apply the currently tracked cull mode so the override state binds immediately, makes sure that SetLayerNoCull works as intended

* Enqueue probes that affect geometry first, this gives quicker iteration results
https://files.facepunch.com/sampavlovic/1b1911b1/Screen_Recording_2026-01-19_at_16.16.36.mov

* float16 guards for ddgi_integrate, avoid NaNs

* Texture.Save supports volume textures

* DDGIVolume saves using the super nice Texture.Save api instead of texutre generator

* Do the same color punchy look thing we do for envmap probes in ddgi probes
https://files.facepunch.com/sampavlovic/1b1911b1/ezgif-13a1dd53fc7688fe.gif

* Don't save ddgi async, just do it directly

* DDGI editor icon
https://files.facepunch.com/sampavlovic/1b2011b1/F1I0KaZt5j.png

* Shaders

* Format

* Add EditorSystem.Camera

* Move texture creation to DDGIProbeUpdaterCubemapper, build probes in order from the camera, use async instead of an update

* Dont multiply DDGI diffuse by AO, that's done on the shadingmodel, this gives accurate multibounce as well

* Update probes sequentially again, makes sure results are consistent, if we do near camera again, should do it with same logic to keep probes that affect geometry first too

* Move NoPrepassCulling to RenderToCubeTexture, can't figure out why behaviour is different between these but solves light leak issue

* Fix overriding array not working for depth textures, make this clearer

* Overriden rasterizer state actually overrides when doing SetCullMode

* Rework border logic, should be seamless now

* Experiment with shadow sharpness being soft, with borders being fine the variance shadow map stuff from DDGI paper looks correct
https://files.facepunch.com/sampavlovic/1b2211b1/sbox-dev_UNTiRmJ7Fw.png

* Make Depth Sharpness a Property instead

* Delete copy_border shader, do everything within the same shader with groupshared memory, actually sample borders correctly, this reduces octahedral border aliasing to a minimum
https://files.facepunch.com/sampavlovic/1b2311b1/sbox-dev_FqPPpRZ6MD.png
https://files.facepunch.com/sampavlovic/1b2311b1/Source2Viewer_TiqGxdYWwX.png

* Distance calculations use unbiased probe-space position so when we move ddgi transform it doesnt fuck visibility up

* Make DDGI Debug Grid use gizmo pooling so it follows gizmo visibility rules (hidden when gizmos disabled, not in cubemaps)

* DDGI Relocation proto, Moves probes out of geometry to unfuck artifacts
https://files.facepunch.com/sampavlovic/1b2311b1/ezgif-1afaed4e1c2ac9a5.gif
https://files.facepunch.com/sampavlovic/1b2311b1/ezgif-11a3e64fd2952590.gif

* DDGI less contrasty

* Parallelize relocation

* More resilient tracing tests & give option to deactivate if probe is fully inside of geometry instead of relocating those fully occluded

* Simplify LPVDebugGrid, remove all the fucking mess from it

* Simplify DDGIVolume, hide all the bullshit

* VTexWriter allows to save as uncompressed, make Relocation texture uncompressed since we want alpha to be flags

* Add Graphics.FlushGPU
Forces the GPU to flush all pending commands and wait for completion.
Useful when you need to ensure GPU work is finished before proceeding.
Can be called outside of a render block.

* DDGIVolume uses Graphics.FlushGPU instead of dumb Task.Await, density goes up to 10, Debug Grid updates if we change probes

* Format

* Doubt we are going to use flags, just store alpha as active state directly, makes it more resilient to eventual compression

* Sprite was calculating offset incorrectly and causing ambient lighting to be fucked, fog was fucked too
https://files.facepunch.com/sampavlovic/1b2611b1/sbox-dev_i3h4RcWncI.png

* DDGI should really be under Light not Misc

* Keep LPVDebugGrid render bounds infinite, SceneCusotmObject shouldnt change it from there

* Move RelocationTexture to same Generated behaviour so we dont override the property it while we are rendering, make probes default visible

* Remove shitty hack from scenecamera and make DDGIVolumeUpdater take scene renderattributes, makes DDGI bounces retrofeed from itself

Should fix terrain rendering being fucked in DDGI too

Will see to make this more generic

https://files.facepunch.com/sampavlovic/1b2611b1/sbox-dev_uzXYN0Qzw6.png

* Make Energy Loss an attribute for DDGI, I prefer a more contrasty look but there are scenes where you'd want more accurate energy conservation, first picture is an example where energy loss contrast makes it look worse

https://files.facepunch.com/sampavlovic/1b2611b1/sbox-dev_kdTH1qhEwR.png

https://files.facepunch.com/sampavlovic/1b2611b1/sbox-dev_gMoRxorzV0.png

* Progress system can be toasts

* Clean up progress system, always available now via Application.Editor.

* Added Scene/Bake DDGI Volumes

* Changed DDGIVolume to IndirectLightVolume

* Refinement steps for probe relocation

* Kill existing bake if disabled or ticking bake again

* EnergyLoss is Contrast and increase max density, keep default contrast to the value I'm happy with

* Don't call it the implementation name to the user

* formet

* Build shaders

* Bind dummy DDGI_Volumes buffer as default on high level

---------

Co-authored-by: Garry Newman <garrynewman@users.noreply.github.com>
2026-01-27 12:07:21 -03:00
nixx quality
3f5d3adef8 Update sbox-issues links 2026-01-27 13:23:43 +00:00
Lorenz Junglas
75b5bd85c0 Fix ScreenRecorder not respecting framerate cvar (#3895)
I think this broke when porting the recording to managed. Fixed by adding a simple condition that drops frames if they arrive too fast.

Since we are recording at variable frame rate the resulting video will never match the exact framerate in the cvar, but it will also never exceed it.
2026-01-26 10:50:29 +01:00
Conna Wiles
9b93481d19 Use SendMessages API for Dedicated Servers (#3867) 2026-01-23 05:22:24 -08:00
James King
84bca30fa5 Movie Maker Maintenance (#3775)
* Add Ctrl+A select all shortcut for track list
* Simplify how raw sample data is stored in movie projects
* Add Create Missing References track context menu option
  * Creates GameObjects / Components for the track to target if they don't exist
* Support .movie resources that only contain compiled data
* Default to only root tracks being expanded
* Support List<T> in movies
* Clean up timeline view transform code, get vertical scroll bar working again
* Fix reversed focused check when clicking on a timeline track
* Timeline tick tweaks
2026-01-23 13:24:36 +01:00
Lorenz Junglas
ac6e176a0d Reduce smoothdamp usage in audio components (#3881)
* Add MathX.ExponentialDecay, similar to our C++ version of it
* Replace SmoothDamp usage in audio components with expdecay
2026-01-23 10:30:00 +01:00
ryleigh
074263fddb Add Snap To Frame option for particle sheet sequences (#3821) 2026-01-21 10:06:51 -08:00
wheatleymf
96b2f0c9cc Custom filtering/address mode for line renderers
- Allows artists to control texture filtering (point/bilinear/trilinear/anisotropic) on line and trail renderers
- Obsoletes "Clamp" in SceneTrailObject's `TrailTextureConfig` struct, use `FilterMode` and `TextureAddressMode` properties instead. Default config will set anisotropic filtering with "wrap" UV address mode.
- No changes in line.shader, it still uses bindless sampler state. It is assigned from SceneLineObject.cs in `SamplerState` property's setter
2026-01-21 10:53:14 +01:00
Lorenz Junglas
9d072e6d89 Audio Optimizations (#3847)
- Auto-cleanup idle voice handles: Voice sound handles are now killed when player hasn't been talking for a while
- Audio Occlusion refactor: Moved occlusion calculation to a dedicated SoundOcclusionSystem GameObjectSystem for better organization
  - This now performs really well, so we could look into improving our occlusion calculation: proper damping when sound is transferred via wall, path tracing for occlusion etc. (will open a separate issue)
- Fix mixer early return bug: Fixed issue where mixer could return early, potentially skipping sounds
- Voice Component lipsync toggle: Added option to enable/disable lipsync processing on VoiceComponent
- Cheaper HRTF for voice audio: Disabled expensive bilinear interpolation for voice and certain other sounds in Steam Audio
- Editor MixerDetail perf: Skip frame updates on MixerDetail widget when not visible
- Reduced allocations in audio systems: Optimized away List and LINQ allocations in SoundOcclusionSystem, Listener, and SoundHandle.Source
- MP3 decoder buffer optimization: Improved buffer handling in native CAudioMixerWaveMP3 to reduce overhead

Depending on scenario can reduces audio frame time by up to 30%.
This should also drastically improve performance for games that use VOIP.
2026-01-20 18:48:09 +01:00
Conna Wiles
e4a3941aa7 Dedicated Server Improvements 2026-01-20 13:54:17 +00:00
sboxbot
4896eece62 Restrict client object destroying option (Networking) (#3816) 2026-01-19 15:35:13 +00:00
Conna Wiles
967e9b6808 SCSS Mixin Support (#3815) 2026-01-19 11:58:24 +00:00
Sam Pavlovic
9066f38917 Added baking to EnvmapProbe
* Added ability to bake envmap textures
* Added Scene.Editor.GetSceneFolder() - allows saving baked resources for scene
* Envmaps are represented with a shiny sphere now instead of a handle
* Fixed Enum Dropdown being the wrong color
* Added [EnumButtonGroup]
* Added GroupButtonControlWidget
* Added Editor.EditorSystem (accessible via Application.Editor)
* Can place [Menu] attributes in game code (was previously in tools only)
* Added "Scene/Bake Envmaps" option
2026-01-19 08:09:13 +00:00
Sam Pavlovic
391db61627 Clustered Fixes (#3806)
* AmbientLight and Decals dont need ScreenPosition

* Clustered Culling can be done early since no longer depends on depth

* Update shaders

* Double depth slice count for clustered
2026-01-16 10:18:00 -03:00
Conna Wiles
59e26d3d6f Fixed Join via New Instance Disconnection Crash (#3799) 2026-01-15 17:01:51 +00:00
Sam Pavlovic
c8a483ed6f Clustered Culling (#3755)
* Clustered prototype

* Cleanup

* Cleanup, clustered culling uses switch case for readability, put generic math classes in math folder,

* Decals evaluate as a sphere, simpler, API for envmaps and lights dont take positionSs anymore

* Revert this shit on complex

* TiledCullingLayer > ClusteredCullingLayer

* Remove references to UseClusteredLighting/UseTiledLighting, just make it work everywhere

* Remove old tiled culling files

* Remove ClusterFrustum.hlsl since we have a generic one

* Remove OBB as we just test simple bounds for decal

* Final cleanups

* Remove references to tiled culling from native engine

* Adjust toolsvis for clustered

* Rename tiled culling references to clustered culling in render pipeline and tools visualization

* Build shaders

* Format

* Fix fog's near frustum cull plane and clustered warning from Mr. Copilot

* remove the last crumbs from tiled rendering

* Update shaders

* skybox rendering  use ClusteredCullingLayer instead of TiledCullingLayer

* Volume fog still referencing MAX_LIGHTS_PER_TILE, should have it using clusters but slower for now
2026-01-15 13:56:11 -03:00
Sam Pavlovic
88e82c5287 Managed Skybox Pipeline + Skybox Tiled Rendering (#3780)
* Managed skybox pipeline

* Format

* Update engine/Sandbox.Engine/Systems/Render/RenderPipeline/Skybox3DPipeline.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-15 12:57:47 -03:00
Antoine Pilote
d28a62c1f3 BinarySerializable (#3725)
Added BlobData API which will serialize as a binary file blob.
> Useful for large data structure

```csharp
class MyBinaryData : BlobData
{
    public override void Serialize( ref Writer writer )
    {
        writer.Stream.Write( 1337 );
    }

    public override void Deserialize( ref Reader reader )
    {
        int val = reader.Stream.Read<int>();
    }
}
```
2026-01-15 05:57:30 -08:00
Sol Williams
6b21137b0d BuiltIn game projects (menu) aren't dependent on libraries (#3767) 2026-01-14 11:58:30 +00:00
Lorenz Junglas
12affe5ccb Reduce material creations/allocations (#3766)
* Make SpriteBatchSceneObject shaders static, so we don't create them per instance

* Avoid per frame shader/material creation in PostProcessing

* Avoid per frame shader/material creation in HudPainter

* Move a few more compute shaders into static members

* Reduce allocations in NormalizeFilename

* Reduce string allocations in Material.FromShader
2026-01-14 08:40:37 +01:00
Matt Stevens
5de450abcd Don't write .vscode files from Sandbox.SolutionGenerator, simplifies it all (#3770) 2026-01-13 23:16:31 +00:00
Conna Wiles
e657d878a6 Scene Change Improvements (#3740) 2026-01-13 13:43:58 +00:00
Garry Newman
69479701cb Add workshop category (#3759) 2026-01-13 13:11:15 +00:00
Lorenz Junglas
236b95e0ed Disposable diagnostic (#3693)
* Enable CA2000 in editorconfig

* Remove unused CaptureStdOut class

* Add missing dispose calls in Sandbox.Tools

* Add missing dispose calls in tests

* Add missing dispose calls in launchers

* Add missing dispose calls in Topten.RichtTextKit

* Add missing dispose calls in Engine

* Add missing dispose calls in SboxBuild

* Add nullchecks to a few dispose calls

* Fix more missing disposal calls and leaks

* Disable CA2000 for Textures

* Fix disposing too early in ImageFileTextureGenerator

* Fix disposing codec, ownership is transferred to animation

* Add missing using in ByteStream benchmark
2026-01-12 21:59:15 +01:00
Conna Wiles
06222ffdc4 INetworkSnapshot Support for GameObjectSystem (#3743) 2026-01-12 16:01:53 +00:00
Lorenz Junglas
07af8e03f9 Console links open files (#3742)
* Open all valid URIs when clicking on a console anchor

* Emit clickable link to video after screen recording

https://files.facepunch.com/lolleko/2026/January/12_07-03-ComplicatedQuadrisectus.mp4
2026-01-12 16:07:13 +01:00
Lorenz Junglas
3f98609d0d ! Validate urls for media loads (#3735)
* ! Check if uri is allowed in VideoPlayer

* ! Check if uri is allowed in VideoTextureLoader

* ! Check if uri is allowed in HttpImageLoader

* ! Use Sandbox.Http instead of Net.Http to ensure urls are checked
2026-01-09 14:27:54 +01:00
Carson Kompon
dbc7cc1c3c Add GetCurrentModifiers() which doesnt return stale keyboard modifier states (#3730)
Fixes F3 and other shortcuts not working under certain conditions (since it would attempt CTRL+F3 under-the-hood instead)
2026-01-09 08:23:12 -05:00
Tony Ferguson
2b56f28a3b Make DEBUG define constant controlled by ReleaseMode (#3715)
* if it's put in DefineConstants, it will get stripped
* ReleaseMode is always set to Release outside of the editor
2026-01-09 10:02:00 +00:00
Garry Newman
1f140c786c Fixed IsRich label not applying font size, scaling properly 2026-01-08 15:06:31 +00:00
Tony Ferguson
9837bc156f Game Controller Vendor Fix (#3726)
* Update GameControllerType_t to reflect SDL3's new enum ordering, fixes controller type for PS5 being malformed
* Improve controller_debug usefulness, output glyph vendor, controller type, some readings
2026-01-08 11:37:52 +00:00
sboxbot
c9e0a5b7a6 Fix lobby data not being added to steam tags when starting a dedicated server. (#3656)
* Update steam tags when starting a dedicated server. Log warning if too long.

* Some tidy up

---------

Co-authored-by: Andy <10728824+andy013@users.noreply.github.com>
Co-authored-by: kurozael <kurozael@gmail.com>
2026-01-07 11:40:32 +00:00
Conna Wiles
31f2175ff0 Connection Crash Fixes (#3706) 2026-01-07 10:35:01 +00:00
James King
0059d6bc7a Compiler: get rid of "library" assembly prefix when publishing (#3708)
We were only adding that prefix when publishing, so people joining servers would load both the published "package.library.x" and "package.x" assemblies.
2026-01-07 09:29:47 +01:00
sboxbot
ee304b982a format volume tooltip in settings as a percentage (#3704)
this change also removes the max volume from volume settings, there's not really a reason to have one

Co-authored-by: DrakeFruit <foxflowgaming@gmail.com>
2026-01-07 08:29:22 +00:00
Sam Pavlovic
dc5e045862 Managed Tiled Culling Renderer (#3641)
* Managed Tiled Culling Renderer

Moving everything to C#, nothing cleaned up but all constrained to the layer, just keeping same implementation making sure everything is fine

Stop gap for implementing Clustered Culling with a cleaner API, Tiled Culling API was made in a way that existing shaders dont break lighting when we upgrade versions

https://files.facepunch.com/sampavlovic/1b1811b1/sbox-dev_afOQK5V1Ux.mp4

* Clean up, remove statics even though this could be shared among views

* Format
2026-01-06 11:53:51 -03:00
Lorenz Junglas
88442544c4 Use static Material & ComputeShader for SceneLineObject (#3703)
Use static default material if Material is not overridden.

Use static compute shader and dispatch with per instance attributes
2026-01-06 15:29:23 +01:00
sboxbot
c678425c9e Fix transition background-image-tint (#3570)
* Fix transition background-image-tint

* Convert all CSS property aliases in one function to prevent code re-use elsewhere

* Make sure aliases are accepted when using `Panel.Style.Set()`

* Do this in Styles instead of PanelStyle so it also works with normal `Styles` class

---------

Co-authored-by: 766974616c79 <100430077+766974616c79@users.noreply.github.com>
Co-authored-by: Carson Kompon <carsokompo@gmail.com>
2026-01-06 10:38:38 +00:00
Layla
b9893bb773 Fix WorldInput state being stomped, refactor how they're done and remove old shit way
* UISystem ticks over WorldPanel and WorldInput components
* Obsolete WorldInput class (it does nothing now)
* Add basic VR support by default to WorldInput component
* Remove VRWorldInput from menu
* Remove dead VROverlayInput

---------

Co-authored-by: Matt Stevens <matt@mattstevens.co.uk>
2026-01-06 10:32:44 +00:00
Matt Stevens
8063b0e000 LargeNetworkFiles: Check RequestFile exists before reading it, fixing crash 2026-01-06 09:38:09 +00:00
Antoine Pilote
924bbb3fa9 Added sprite alpha cutout (#3667)
* Added AlphaCutout setting to opaque sprite

* Just store as uint and cast back to float when necessary, simpler that way

https://files.facepunch.com/antopilo/1b2311b1/sbox-dev_wEBQHQosGe.mp4

* Rename fogStrength var to packedFogAndAlpha

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix typo by copilot preventing from compiling

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-05 07:50:31 -08:00
Lorenz Junglas
43c09d34f1 Fix ByteStream leaks (#3686) 2026-01-05 13:17:05 +01:00
James King
839c60100c Fix action graph editor regressions (#3590)
* Fix scene reference gizmos not showing up
* Fix links not pulsing when viewing a graph in play mode
* Fix undo system error when action graph gizmos are selected in scene view
* Fix warning about when a graph can be saved or not
* Fix some SerializedObject.IsValid / SerializedProperty.IsValid implementations
* Fixed errors in console when opening the node creation menu
* Fix possible error when dragging links during play mode
* Fix errors when opening some graphs that reference removed component types
* Strip action graph editor code from engine projects
2026-01-05 10:34:52 +01:00
Layla
7ab2f3d351 Obsolete vertex attribute array (#3683) 2026-01-01 07:55:17 +00:00