StableProjectorz is a tool for texturing 3D models using StableDiffusion.
It also supports generating 3D models from 2D images.
Official page: StableProjectorz
Our Discord server: here
- Requirements: Unity 6000.
- Codebase: Located entirely in
Assets/_gm. - Build: Press
Ctrl + Shift + B-> Build and Run. - Note: Keep "Development Build" unchecked for performance.
- Nested Prefabs: Keep UI separated in Prefabs. Don't modify prefabs externally. Save your work directly inside a deepest prefab itself, to prevent merge conflicts.
- Communication: Prefer singleton-pattern, to talk between scripts. For example
MyCoolScript.instance; Avoid drag-and-drop references. Initialize Singletons inAwake(). - Folders: keep prefabs, scenes, scripts inside subfolders of
Features. Do not use separatePrefabs,Scenes,Scriptsfolders. - Memory: If you spawned a
RenderTexturemake sure to release it, to aviod memory leaks. - Variables: Use
[SerializeField] privateinstead ofpublic. - Naming:
_underscoreForMemberVariables.
Watch the video about the codebase (as of Jan 2026) for a quick-start:
- Scene Management: We use Additive Loading.
Start_Scene_Globalscene loads UI and manager-scenes separately to prevent merge conflicts. - Update Loop:
Update_callbacks_MGRdispatches events (Navigation, Depth, Rendering) in a strict order. UsingUpdate()for other things. - Workflow: Use Nested Prefabs. Avoid editing Scene files directly; edit the Prefab to keep Git diffs clean.
- Access:
ModelsHandler_3D.instanceis the singleton entry point for all 3D data. - Structure:
Objs3D_Container: Maps every sub-mesh to a unique ID for later retrieval.UDIMs_Helper: Scans UVs to detect tiles (1001, 1002, etc.).
- Importer:
ModelsHandler3D_ImportHelperuses AssimpNet to load OBJ/FBX/GLB at runtime.
Managed by UserCameras_MGR. Culling Planes are fixed (0.25–1000) for float precision.
- View Camera: Renders high-res image for user to see. Also renders a viewport depth texture, for mesh-clicking, etc.
- Depth Camera: Renders black and white image to send to StableDiffusion (not an exact viewport depth).
- Content Camera: Renders the square resolution to send to StableDiffusion (e.g., 512x512).
- Normals Camera: Renders View-Space normals to send to StableDiffusion (Red=Right, Green=Up).
- Vertex-Colors Camera: Renders Colors encoded in mesh-vertexes to send to StableDiffusion.
- Multi-View Logic: We use Perspective Shift (via UI Pins) to arrange multiple cameras in one viewport.
- ProjectorCamera: Spawns at the user's viewpoint. "Shines" the AI image inside the
_accumulation_uv_RTtexture. - Target:
Objects_Renderer_MGRrenders into_accumulation_uv_RT. - Texture Arrays: The target is a RenderUDIMs object (Texture Array). Each slice represents one UDIM tile.
- The Loop: Clear Black → Bake Projections (respecting depth) → Dilate (Anti-Seam) → Display on Mesh.
- Pipeline:
StableDiffusion_Hub→SD_Generate_PayloadMaker→SD_Generate_NetworkSender(Talks to A1111/Forge via JSON). - Storage:
GenData2D_Archivestores Information Objects, not loose files.GenData2D: Remembers the Camera-params (POV), Prompts, Result Textures, and User Masks.- This allows "Reloading" the exact state of a generation later.
Managed by Gen3D_MGR.
- Handshake: Queries external WebUI (Trellis/Hunyuan) for required parameters.
- Dynamic UI: Parses response to spawn sliders/inputs automatically (
Gen3D_InputPanelBuilder_UI). - Generates: Submits a request to the Webui, with the inputs as JSON.
- Import: waits for resulting GLB mesh and feeds it to
ModelsHandler_3D.
KeyMousePenInput: Static helper class.- Abstraction: Unifies Mouse clicks and Tablet Pen pressure into a single API.
- Coords: Tracks cursor in Screen Pixels and Viewport Space (0–1).

