* Added HasTerrain attribute for buffer overflow safety if reading terrain data before terrain has been initialized on the GPU
* Fix terrain leaking gpu buffer if disabled or deleted
Set HasTerrain flag to false once all terrains are gone
* Exposed more terrain helpers in TerrainCommon.hlsl
- GetWorldHeight
- IsInBounds
- SampleColor
* built shaders
* built terrain shader
* Changed Has() to terrainCount instead
* Make count 0 if disabling the last terrain
* built shaders
- 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
UpdateSlicedFindPath may return InProgress status when pathfinding requires more iterations. Previously the code would only call it once and continue regardless of status, causing incomplete paths in complex scenarios. Now loops until pathfinding completes or fails.
Cuts navmesh memory usage by at least 5 times (about 3GB less in our benchmark scene), enabling much larger scenes to generate successfully.
Small Fish’s MSC scene (~3km x 3km) now generates fine, previously ran out of memory and crashed.
The new theoretical maximum for a navmeshed scene is now ~50km x 50km.
- Packed `CompactCell` data into a single 32-bit field (8 bytes -> 4 bytes).
- Added heightfield serialization + compression so `CompactHeightfield` can be stored/transferred as bytes, and tiles store compressed heightfield data instead of large voxel arrays.
- **Heightfield serialization + compression is a prerequisite for navmesh baking.**
- Tiles are decompressed when generating polymeshes (e.g., to adapt to area changes).
- Compression adds a small overhead during navmesh generation.
- Fixed load sequence, now properly shows "Generating Navmesh..." in scene loading screen
- Reduced allocations during `PolyMesh` generation.
- Reduced the permanent memory usage of `PolyMesh`.
- Improved parallel tile generation; now properly limits the number of in-flight tasks to prevent OOM crashes.
Overall generation will be slower due to the extra compression step, I expect roughly ~30% in our benchmarks.
Basically, we're trading generation speed for drastically lower memory usage.
Some of the slowdown we will see in the benchmark is also due to the increased tile size. The larger tiles don’t actually make generation slower in real use, but they show up as "slower" because of how our benchmarks are designed/measured.
* 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
* Encode DDGI depth properly, use a proper cone instead of tightening the fibonacci and get radial depth correctly, this is the correct way to do this, remove DepthSharpness since we dont need it anymore, adjust contrast back to 1.0f since 2.0f is very opinionated
* Can specify if Indirect Light Probe is indoor or outdoor
* Get rid of these softening stuff for DDGI, the depth algorithm is correct, pass variance directly ( verify if will shit BC6H )
* Store Distance as uncompressed for now, we really need high precision for accurate variance
* Option for high quality bounces, do two passes to make sure that bottom-up rays are accurate, start doing calculation from ray from scene camera like Garry initially wanted if so
* shaders
* Readd DDGIVolume alias to not break prefab
* Accidentally sent wrong variance, corrected
* format
* 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
Environment.Exit triggers DLL unloading which causes native code to callback into managed after CLR shutdown.
Use Plat_ExitProcess instead which terminates immediately without running DLL destructors.
The host can detatch a networked object from networking - which is like network destroying it, except it stops networking and becomes a regular snapshot object (host can set NetworkMode to NetworkMode.Snapshot) even after its network spawned.
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.
* 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.pnghttps://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.pnghttps://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.gifhttps://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.pnghttps://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>
Speculative fix for the EnqueueResourceManifest crash reported on Sentry.
The crash occurs in a thread-interlocked compare-exchange operation:
```
ThreadInterlockedCompareExchange64
ThreadInterlockedCompareExchangePointer
CTSQueue<T>::InterlockedCompareExchangeNode
CTSQueue<T>::Push
CTSQueue<T>::PushItem
CResourceSystem::EnqueueResourceManifest
CResourceSystem::CreateResourceManifestInternal
Exports::g_pRsrcSystm_LoadResourceInManifest
```
The most likely cause of a ThreadInterlock failure is a null pointer. AFAIK the resource queue only becomes null during shutdown, so this crash is probably a race condition where managed code attempts to load a resource while the engine is shutting down.
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.
* 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
- Supports only texture filtering
- Clamp/wrap address mode is set using existing logic (set to `Clamp` only if "Travel" feature is enabled, in all other cases it's set to `Wrap`)
- 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
- 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.
* localize particle velocity properly
same method as localizing position
* localize initial velocity using the 0th delta of `LocalSpace`
This is consistent with what you see in the editor, there's no indication that `LocalSpace` only applies the later movements of the particle and not everything in the movement feature.
* localize `ConstantMovement` as well
---------
Co-authored-by: Fortune <7847372+Fortune117@users.noreply.github.com>
* 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