Uriel Cain Posted December 11, 2025 Report Posted December 11, 2025 (edited) I'm trying to figure out how to apply selected textures to a mesh for rendering. The textures are selected from other objects, so not known in advance, but they are game assets, not custom (yet). I have no problem grabbing the texture IDs and can get the asset locations, too. My entity renders without issue as well. I'm just unable to figure out how to create or modify the ITexPositionSource object being fed into TesselateShape(). I've tried using Tesselator.GetTextureSource(sourceBlock) and new ShapeTextureSource(capi, shape, "shape") where shape is the shape I'm tessellating and I've modified the Textures attribute with the desired AssetLocations. Is there a different, better way to do this? Do I need to perform some additional operation, like perhaps call a method on the texture source object to load or parse the textures? EDIT: I also wanted to ask if maybe I'm using the wrong method for tessellating? It seems odd that the texture information is in the shape object, yet TesselateShape() wants a separate texture source object in addition to the shape object itself. Oh, and here's basically what I have: modTexSource = new ShapeTextureSource(capi, modShape, "ModTexSource"); capi.Tesselator.TesselateShape("modEntity", modShape, out modMesh, modTexSource); modMeshRef = capi.Render.UploadMesh(modMesh); capi.Render.RenderMesh(modMeshRef); Edited December 11, 2025 by Uriel Cain Weird formatting
Solution Uriel Cain Posted December 14, 2025 Author Solution Report Posted December 14, 2025 Nevermind, I figured it out. I had an erroneous character in my texture keys. The above code was fine. >.>
Recommended Posts