Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 6 min read How-to mediumAdept

Converting Vertex-Colored Meshes to Textured Meshes

Vertex-colored meshes, as produced by generative 3D models like InstantMesh, can be converted to UV-mapped textured meshes by generating a UV atlas with xatlas, rasterizing each face into an upscaled texture buffer via point-in-triangle tests and barycentric color interpolation, then cleaning holes with OpenCV inpainting, median filtering, Gaussian blur and LANCZOS downsampling. The result is exported as a glb with a PBR material via trimesh, and the steps are packaged in a small InstantTexture Python library. The output still has visible artifacts and falls short of production-quality UVs and textures, so it suits quick conversions rather than final assets.

Assumes: 3D mesh basicsUV mappingNumPy

Related posts

  • Practical 3D Asset Generation: A Step-by-Step Guide

    Hugging Face mediumAdept

    A low-effort pipeline turns a text prompt into a usable game asset by leaning into the forgiving PS1 aesthetic. Shap-E on a Hugging Face Space generates the mesh, and Blender's Decimate modifier cuts it to a low poly count (ratio around 0.02). The Dream Textures addon with the texture-diffusion model then creates a seamless Stable Diffusion texture, which is applied via Smart UV Project. The result is exported as FBX into Unity, where vertex-lit shading, fog and glitchy post-processing complete the retro look.

  • 3D Asset Generation: AI for Game Development #3

    Hugging Face easyNovice

    As of early 2023, text-to-3D generation is not yet practical for game development. Approaches like DreamFusion, CLIP-Mesh, CLIP-Forge, CLIP-NeRF and Point-E mostly rely on view synthesis via NeRFs rather than producing meshes. NeRF-to-mesh conversion, as in NVIDIA's instant-ngp, yields assets that, like photogrammetry output, need heavy manual cleanup before they are game-ready, so a five-day farming game uses colored cubes instead. Two likely paths forward are better mesh generation and rendering NeRFs directly in-engine.

  • Introduction to 3D Gaussian Splatting

    Hugging Face mediumAdept

    3D Gaussian Splatting renders photorealistic scenes in real time by rasterizing millions of gaussians, each with a position, covariance, color and alpha, instead of triangles. The pipeline runs Structure from Motion (e.g. COLMAP) to get a point cloud and turns each point into a gaussian. It then trains the parameters with SGD through a differentiable rasterizer that projects gaussians to 2D, depth-sorts them and alpha-blends front to back, splitting, cloning and pruning gaussians along the way. Tradeoffs include high VRAM use (4GB to view, 12GB to train), scene files of 1GB+, static scenes and incompatibility with existing pipelines. The main porting bottleneck is the CUDA-only CUB radix sort used to sort the gaussians.

  • How did we build 3D animations in mobile apps?

    Wise Engineering mediumAdept

    Wise renders its brand 3D illustrations interactively in its iOS and Android apps by building three.js/WebGL scenes as standalone local HTML files shown in web views, which it chose over native or Filament for cross-platform reuse and documentation, and which hit 60–120 FPS. An automated pipeline cut the assets from 324 MB to 3.7 MB in three steps: deduplicating textures shared across glTF files (to 98.4 MB), compressing textures (to 5.2 MB) and Draco geometry compression (to 3.7 MB). Draco decompression made scenes slow to load, so the apps pre-load scenes and keep them in memory with rendering paused. Native gyroscope data is passed into the HTML to drive scene rotation.

  • How We Built the BFCM 2023 Globe

    Shopify Engineering mediumAdept

    Shopify's BFCM 2023 live-orders globe was built with Three.js and React-three-fiber, and most of its effects are drawn in single instanced draw calls. Order arcs are cubic Bézier curves evaluated in the vertex shader from per-instance attributes stored in an interleaved buffer. They are billboarded using the cross product of the curve tangent and the camera direction, and dissolve via UV-driven noise. Instancing let the team render tens of thousands of arcs, and up to a million on an M1 laptop, where earlier per-mesh arcs struggled past 1000 on mobile. The same approach covers fireworks, city dots and orbiting airplanes, along with fixes for a camera flip caused by the lookAt up vector, Hermite-spline 'loopy arcs', and working around WebGL's 255-byte attribute stride limit.

The quest for software engineering knowledge.

Look:
Layout: