Skip to content

Add Go to coordinates#94

Closed
766974616c79 wants to merge 454 commits intoFacepunch:masterfrom
766974616c79:add-go-to-coordinates
Closed

Add Go to coordinates#94
766974616c79 wants to merge 454 commits intoFacepunch:masterfrom
766974616c79:add-go-to-coordinates

Conversation

@766974616c79
Copy link
Copy Markdown
Contributor

My PR adds a "Go to coordinates" button in the "View" category. After clicking it, a dialog opens where the user can enter coordinates. I use Vector3 to parse the input vector and then update the camera's target position accordingly.

Resolves #1361

@766974616c79 766974616c79 force-pushed the add-go-to-coordinates branch from bee3947 to 383261c Compare December 5, 2025 09:00
aylaylay and others added 29 commits December 17, 2025 12:47
…ditor (#3619)

- Only download packages from the current project when opening in the editor
- Make sure to download packages referenced within any libraries in the current project
- Remove static LastSelected SceneViewportWidget. It should be scoped to the last selected viewport within a particular Scene view
- Add LastSelectedViewportWidget to SceneViewWidget
- Re-add focusing the last selected widget that was hotfixed in #114

---------

Co-authored-by: aidencurtis <109600275+aidencurtis@users.noreply.github.com>
Co-authored-by: Carson Kompon <carsokompo@gmail.com>
Match bevel tool closer to hammer
-Steps more accurate
-Smooth normal option
* Cleanup SkinnedModelRendererSetBoneMerge

* Proper bookkeeping for SkinnedModelRenderer Hierarchy

* Use ConcurrentQueue instead of Channel to reduce lock contention

* Limit animation update parallelism to Environment.ProcessorCount - 1

* BoneMerge in parallel

* Speed up native anim decompression using (lock-free) LRU posecache

* Remove some unused debug counters
https://files.facepunch.com/louie/1b1811b1/sbox-dev_wPVinlJTtE.png

-Support Tiling in the fast texture tool.
-Shortcuts.
-Escaping out resets to orignal uv.
-Unwrap Square better.
-World Mapping.
-Apply active material when entering fast texturing.
-Clicking in the rect view with no rect file fills to the full uv.
-Snapping toggle.
-Reset uv and focus buttons.
-New cleaner UI.
…es" (#3643)

Apply navmesh overrides from additive scenes, only ignore overrides from system scenes.

For some reason our startup scenes load as additive, so the navmesh settings of the startup scene would have been ignored.

Partially reverts Facepunch/sbox#3555

We could also fully revert it if we want system scenes to be able to override navmesh settings.
* Citizen/animgraph: optimise the skid layer by cutting it out completely if there has been no wish movement for the past 3 seconds. ~10% performance gain for players who are standing still.

* Citizen/animgraph: optimise the locomotion wish layer by cutting it out if wish values have been equal to 0 for the past 3 seconds. ~5% performance gain for players who are standing still.

* Citizen/animgraph: optimise the "turn poses / rotation lean" layer by cutting it out if move_rotationspeed has been 0 for the past 3 seconds. ~5-10% performance gain for players who are standing still or moving in a straight line.

* Citizen/animgraph: optimise the "standing shuffle" layer by cutting it out when move_rotationspeed has been 0 for the past 3 seconds. ~2-4% performance gain for players who are standing still and not turning.

* Citizen/animgraph: optimise the height scaling layer by cutting out scale_heel completely if you're not wearing high heels, and bypassing the entire layer if your height is default. ~3% performance gain for players with default height; unmeasurable if different height while without heels.

* Citizen/animgraph: oops, the skid layer optimisation should be checking against the skid values, not wish

* Citizen/animgraph: optimise the facial animation subgraph by cutting out the voice lipsync bone mask & blend nodes if the voice level has been 0 for more than 3 seconds, and by replacing the random blink machine, previously based on a Choice node that effectively rolled a 85/15 dice every second (but relied on 2 constantly playing sequences) by a state machine with the new "random time between" feature. The add node is now only active during a blink. Time between blinks is now random between 0.1 and 5.0 seconds.

* Humans: derive animgraphs from Citizen updates
…ield return (#3644)

yield return creates a lot of garbage and is easily avoidable here, by using recusing instead.
* AddPoseOperation skip work when added transform is equal to identity

* SubtractPoseOperation skip work when added transform is equal to identity

* Fast path for BlendUpdateNode when weights are 1

Don't emit expensive pose op just forward the pose with weight 1

* Fast path for Blend2DUpdateNode when weights are 1

Don't emit expensive pose op just forward the pose with weight 1

* Avoid allocation of Actions in MergeDescendants
* Only show property-prefab options on prefab instances, simplify names a bit

* Tweak these to match

* Transform

* Order

* Guessing this meant to pick the shortest source location path

* dotnet format
…ith modifier (allows things like tool switching while modifier is down) (#3653)
Corrected the property name from 'GradientValye' to 'GradientValue' in ControlsTest to fix a typo.

Co-authored-by: Austin <austin@austin.codes>
* start sound preview playback at scrubber position instead of 0, only increment time if playing

* Fix SceneRect calculation so that there isnt 4 pixels of extra scroll when zoomed all the way out, only show scroll bar if there's anything to scroll

* clamp scrubber position so it cant be visually dragged outside normal bounds

* use correct offset when setting scrubber position during playback

* update VisibleRect before redrawing waveform, waveform was previously drawing in wrong position (view from last frame)

* clamp on scrubber should be using SceneRect not ContentRect

* no need to update VisibleRect twice

* use correct offset for scrubber in DoLayout too

* update scrubber so it stays nice and stable while playing+zoomed in or scrubbing, use correct offset when manipulating scrubber

* offsetting by 4 everywhere is dumb just set HandlePosition on scrubber

* fix drift on scrubber while zoomed in

---------

Co-authored-by: boxrocket <splatterbiker@gmail.com>
Co-authored-by: boxrocket <splatterbiker@gmail.com>
handsomematt and others added 24 commits January 26, 2026 13:31
Added a `ChildNode` field to `TrackedObject` to enable O(1) LinkedList operations instead of O(n) Find/Remove calls.

### Isolated worst-case benchmark (reverse dependency chain):

| Objects | Before | After | Speedup |
|---------|--------|-------|---------|
| 100 | 2.2ms | 183µs | **12x** |
| 500 | 197ms | 3.8ms | **51x** |
| 1000 | 1.6s | 11ms | **152x** |

Also uses 50% less memory.

### Full ApplyPatch benchmark:

| Size | Before | After | Change |
|------|--------|-------|--------|
| Medium | 962µs | 821µs | **+15%** |
| Large | 20.5ms | 13.2ms | **+36%** |
* Clean up stale file entries from old package revisions to prevent validation failures on restart
* Fix ValidatePackage to only validate files matching the current package revision
* Associate file with package/revision even if it's already on disk

---------

Co-authored-by: trende2001 <68961063+trende2001@users.noreply.github.com>
Co-authored-by: Sol Williams <7689429+solwllms@users.noreply.github.com>
* Fix uv's going off screen when using existing uv's

* Make world scale better

* Remove the rect box, only show uv, block all actions related to scaling

* Block more stuff in world scale

* Don't keep flipping each time doing transform

* Fix alignment and flipping not working in world scale
* Grow and Shrink selection

* Add convert selection

Will convert selection from one to another example; Selecting a face then holding alt and switching to edge mode will select the edges of that face.

* Add selection shortest path

find the shortest path between 2 selections (face and edge)

* Make open edges easier to read
… shutdown (#3904)

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.
* 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>
* Select face by normal

* Fixed alt stomping other processing

* Select by material + flood select mesh

* Match texturetool to facetool selections

* Match more with the facetool

* Formatting

* Overlay selection toggle

* Set the cookie cleaner
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.
* Improved foliage shader

- Added rim lighting
- Cheap transmissivenes
- Grazing cards fade out
- Wrapped lighting
- Backface darkening
- Backface shading
- Distance fade of shading features
https://files.facepunch.com/antopilo/1b2611b1/sbox-dev_CNoLJhw3ms.mp4

* Tweaked some stuff

https://files.facepunch.com/antopilo/1b2611b1/sbox-dev_C9EcKZCojJ.mp4

* use precompueted dist

* Made warp lighting ignore shadow

* Improved trunk rendering

- Specular Occlusion
- Trunk bending animation
- Syncs with foliage animation

https://files.facepunch.com/antopilo/1b2711b1/sbox-dev_WoM5FlFzSn.mp4
PhysiscsTrace.UseRenderMeshes is now editor only
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.
@766974616c79 766974616c79 force-pushed the add-go-to-coordinates branch from a72ab2b to d36cb46 Compare January 27, 2026 21:18
Copilot AI review requested due to automatic review settings January 27, 2026 21:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an editor “Go to coordinates” action that opens a dialog, parses a Vector3 from the user’s input, and uses it to move the scene view camera smoothly to the specified position.

Changes:

  • Exposes SceneViewportWidget.cameraTargetPosition as internal so it can be set from outside the class.
  • Adds a “Go to coordinates” entry to the View menu via MainAssetBrowser.AddViewMenuButtons, which shows a Dialog.AskString prompt and, on submit, parses the input into a Vector3 and assigns it to the selected scene viewport’s cameraTargetPosition.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
game/addons/tools/Code/Scene/SceneView/SceneViewportWidget.cs Makes cameraTargetPosition internal so external code (like menu actions) can trigger camera moves by setting a target position.
game/addons/tools/Code/Editor/AssetBrowser/MainAssetBrowser.cs Adds the “Go to coordinates” View menu option, opens an input dialog, parses a Vector3 from the entered string, and attempts to set the selected viewport’s cameraTargetPosition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

static void GoToCoordinates( string coordinates )
{
var parsedCoordinates = Vector3.Parse( coordinates );
SceneViewportWidget.LastSelected?.cameraTargetPosition = parsedCoordinates;
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SceneViewportWidget.LastSelected is referenced here but there is no corresponding static LastSelected property or field defined on SceneViewportWidget, so this will not compile. It looks like you intended to use the existing SceneViewWidget.Current?.LastSelectedViewportWidget instead to access the active viewport before setting cameraTargetPosition.

Suggested change
SceneViewportWidget.LastSelected?.cameraTargetPosition = parsedCoordinates;
var viewport = SceneViewWidget.Current?.LastSelectedViewportWidget;
if ( viewport != null )
{
viewport.cameraTargetPosition = parsedCoordinates;
}

Copilot uses AI. Check for mistakes.
Comment on lines +91 to +92
var parsedCoordinates = Vector3.Parse( coordinates );
SceneViewportWidget.LastSelected?.cameraTargetPosition = parsedCoordinates;
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vector3.Parse(coordinates) is called directly on user input from Dialog.AskString without any validation or error handling, so entering an invalid coordinate string (e.g. a typo or wrong format) will throw and likely surface as an unhandled exception in the editor. Consider validating the input format and handling parse failures (e.g. by rejecting the dialog input with a message) instead of letting the parse exception propagate.

Suggested change
var parsedCoordinates = Vector3.Parse( coordinates );
SceneViewportWidget.LastSelected?.cameraTargetPosition = parsedCoordinates;
try
{
var parsedCoordinates = Vector3.Parse( coordinates );
SceneViewportWidget.LastSelected?.cameraTargetPosition = parsedCoordinates;
}
catch
{
// Invalid coordinates entered; ignore and avoid crashing the editor.
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Go to coordinates" in editor