Skip to content

Fix DebugOverlay.Text not rendering#82

Closed
andy013 wants to merge 3 commits intoFacepunch:masterfrom
andy013:debug_overlay_fix
Closed

Fix DebugOverlay.Text not rendering#82
andy013 wants to merge 3 commits intoFacepunch:masterfrom
andy013:debug_overlay_fix

Conversation

@andy013
Copy link
Copy Markdown
Contributor

@andy013 andy013 commented Dec 2, 2025

I think the native renderer culls objects with uninitialised transform data. Even though DebugOverlay.Text doesn't need a transform, it still has to be set to zero explicitly to get it to render.

[EDIT] Actually, looking at it again, I think it's setting LocalBounds here that's causing the issue:

Add( duration, new DebugTextSceneObject( Scene.SceneWorld, position, scope, flags )
{
RenderLayer = overlay ? SceneRenderLayer.OverlayWithoutDepth : SceneRenderLayer.OverlayWithDepth,
LocalBounds = BBox.FromPositionAndSize( 0, 256 )
} );

It uses Transform in it's setter:

set => Bounds = value.Transform( Transform );

If the Transform isn't initialised then I think the scale will default to 0 and so nothing will render.

I'm not sure if I'm initialising the Transform in the right place. I guess it's easy enough for you to move now you know what's causing the bug.

@handsomematt handsomematt added the triaged triaged pull-requests are replicated on the internal sbox repo label Dec 4, 2025
@sboxbot sboxbot added the accepted this pull request was accepted, hurrah! label Dec 4, 2025
@sboxbot
Copy link
Copy Markdown
Contributor

sboxbot commented Dec 4, 2025

This PR has been merged upstream.

@sboxbot sboxbot closed this Dec 4, 2025
@andy013 andy013 deleted the debug_overlay_fix branch December 11, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted this pull request was accepted, hurrah! triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants