Skip to content

RenderOptions available in MeshComponent#78

Closed
Remscar wants to merge 428 commits intoFacepunch:masterfrom
Remscar:meshcomponent-renderlayer
Closed

RenderOptions available in MeshComponent#78
Remscar wants to merge 428 commits intoFacepunch:masterfrom
Remscar:meshcomponent-renderlayer

Conversation

@Remscar
Copy link
Copy Markdown
Contributor

@Remscar Remscar commented Dec 1, 2025

This PR adds a RenderOptions member to MeshComponent and applies the options onto the SceneObject.

They are used and operate the same way that ModelRenderer implements them.

This ultimately allows invisible MeshComponent's which cast shadows; before if you selected "Hide in Game" and had rendering to "Shadows Only", no shadows would be cast.

image image

@Remscar Remscar changed the title Renderer.RenderOptions available in MeshComponent RenderOptions available in MeshComponent Dec 1, 2025
@garrynewman
Copy link
Copy Markdown
Member

Something for @aylaylay to think about

@Remscar
Copy link
Copy Markdown
Contributor Author

Remscar commented Dec 5, 2025

@aylaylay My use case for this is I would like to create a shadow casting volume without having the actual mesh be visible to the player, similar to solid block light in hammer

sboxbot and others added 16 commits December 12, 2025 11:04
---------

Co-authored-by: DrakeFruit <foxflowgaming@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…acepunch#3613)

* Fixes GameObject references in GameObjectSystem NetLists and NetDictionaries being null on clients.

* dotnet format

---------

Co-authored-by: Andy <10728824+andy013@users.noreply.github.com>
Tint pause button blue when the game is paused.
- `PolygonMesh.SetFaceTextureCoords()` now properly sets `IsDirty`
- Added `PolygonMesh.GetFaceTextureCoords()`
- Added `FastTextureWindow` (which extends RectEditor.Window) and `FastTextureSettings` classes
- Added `MeshRectangle` which is a RectEditor `Rectangle` that contains faces from a mesh unwrapped within the rectangle, reflecting any transform changes made back to the associated mesh faces
- Added `EdgeAwareFaceUnwrapper` class which handles all UV unwrapping
- Added a "Fast Texturing Tool" button to the Mapping Tool's Texture Mode which opens a FastTextureWindow with the selected faces. This can also be opened with the shortcut CTRL+G (from the Texture Mode OR the Face Mode)
- If a Fast Texturing Tool window is open and the faces are deselected (or the user exits the Mapping Tool) the window will automatically close itself
- Implemented U/V Alignment Settings (+ Horizontal/Vertical Flip)
- Implemented Inset X/Y Settings
- Implemented Square Unwrap, Planar Unwrap, and Use Existing mapping modes
- If the selected material has a rect asset, you can double-click on a rect to automatically fit your UV rectangle to the one you double-clicked. (You can also toggle the visibility of the material's rects)
- Implemented the "Pick Edge" button which allows you to select an edge from the unwrap and automatically orient the UVs so that the selected edge is aligned with the grid.
- Added `Rectangle,CanDelete`, used by MeshRectangles so they cant be deleted
- Fixed `RectView.DragResizeRect` behaviour so that resizing a rect will snap the dragged edges to the grid instead of just increasing/decreasing by the grid size
- Added Panning/Zooming to the Rect Editor
- Disabling the Grid in the RectEditor now disables grid snapping
- Can now resize rects in on themselves to resize in the other direction without making an invalid rect
- Added Tile View to RectView
Co-authored-by: J Shwiizzle <160753124+SwagAccount@users.noreply.github.com>
@aylaylay
Copy link
Copy Markdown
Contributor

Sorry, I didn't get the notification. Yeah this seems ok.

@aylaylay aylaylay added the triaged triaged pull-requests are replicated on the internal sbox repo label Dec 16, 2025
bakscratch and others added 20 commits January 22, 2026 11:56
* Use MathF instead of Math for vector3 math
* Vectorize Sort and Negate
* Skip unnecessary dot products
* Add tests for changed methods
* Add MathX.ExponentialDecay, similar to our C++ version of it
* Replace SmoothDamp usage in audio components with expdecay
* 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
)

That way we actually know how much is uploaded

Also gets rid of verbose per file logging.
Copilot AI review requested due to automatic review settings January 26, 2026 00:01
@Remscar
Copy link
Copy Markdown
Contributor Author

Remscar commented Jan 26, 2026

@handsomematt you got it boss

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 RenderOptions support to MeshComponent, enabling advanced rendering control such as rendering to specific layers (Game, Overlay, Bloom, AfterUI). This allows MeshComponent to have the same rendering flexibility as ModelRenderer, particularly enabling invisible meshes that cast shadows.

Changes:

  • Added RenderOptions property with lazy initialization pattern matching the Renderer base class
  • Added OnRenderOptionsChanged callback that updates the SceneObject when render options change
  • Applied RenderOptions to the SceneObject in UpdateSceneObject()

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

Comment thread engine/Sandbox.Engine/Scene/Components/Mesh/MeshComponent.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@handsomematt handsomematt added triaged triaged pull-requests are replicated on the internal sbox repo and removed triaged triaged pull-requests are replicated on the internal sbox repo labels Jan 26, 2026
@sboxbot sboxbot closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.