Araewin Posted July 13, 2025 Report Posted July 13, 2025 Hi! I'm working on a Vintage Story mod that displays items from the player's hotbar as 3D models on their back (like a backpack visual effect). The server-side detection and network communication work perfectly, but I'm having crashes when trying to implement the 3D renderer on the client side." Here are my specific questions about the rendering system: What's the correct way to render 3D item models attached to a player entity in Vintage Story? Should I use a custom IRenderer implementation or attach models directly to the player entity? I'm getting NullReferenceException crashes when using MultiTextureMeshRef in my renderer. What's the proper initialization sequence for MultiTextureMeshRef? Do I need to validate the meshrefs array before using it? "When should I register my renderer with api.Event.RegisterRenderer()? I've tried LevelFinalize event, but it still crashes. What's the safest timing for renderer registration?" For rendering item models on player backs, should I: Use RenderMultiTextureMesh() in OnRenderFrame() Create attachments to the player entity Use a different rendering approach entirely? What texture parameters should I use when calling RenderMultiTextureMesh()? I tried both 'tex' and 'entityTex' but still get crashes. Are there any working examples of mods that render 3D models attached to players that I could reference? The crash seems to happen specifically when entering the game world with the renderer active. Without the renderer, everything works fine (item detection, network packets, etc.). Any guidance on the proper Vintage Story rendering patterns would be hugely appreciated!
Recommended Posts