How sebasvcx/viewportstencil works
ViewportStencil is a client-side Roblox library for making a model appear through an opening in a surface, without cutting the surface geometry. The documented workflow is for a LocalScript to derive a surface CFrame with Utils, then create a stencil from a prepared model; the stencil displays that model in a ViewportFrame with perspective aligned to the player’s camera. The README also documents stencil lifecycle and lighting/display options. Source excerpts were unavailable, so internal implementation links are omitted where the README does not establish them.
Main entry points: Renderer.lua Viewport renderer · init.lua ViewportStencil API · Stencil.lua Stencil lifecycle · Projection.lua Off-axis projection
Components 11
Public API
- ViewportStencil API
src/init.lua - Stencil lifecycle
src/Stencil.lua
Stencil Rendering
- Viewport renderer
src/Renderer.lua - Off-axis projection
src/Projection.lua - Surface mask
src/Stencil.lua
Utilities And Types
- Surface utilities
src/Utils.lua - Rig pool
src/RigPool.lua - API types
src/Types.lua
Other components
- LocalScript developer
- Prepared model
- Player camera
Connections 7
- LocalScript developer → Surface utilities: gets surface CFrame
README.md - LocalScript developer → ViewportStencil API: creates stencil
README.md - ViewportStencil API → Stencil lifecycle: creates object
README.md - Prepared model → Stencil lifecycle: supplied for rendering
README.md - Player camera → Viewport renderer: provides viewpoint
README.md - Viewport renderer → Off-axis projection: uses projection
README.md - Viewport renderer → Surface mask: displays through mask
README.md