Skip to content

feat: base-color texture support for DAE meshes#111

Open
vklemm wants to merge 2 commits intoSimple-Robotics:mainfrom
vklemm:dev/texture-support
Open

feat: base-color texture support for DAE meshes#111
vklemm wants to merge 2 commits intoSimple-Robotics:mainfrom
vklemm:dev/texture-support

Conversation

@vklemm
Copy link
Copy Markdown

@vklemm vklemm commented Mar 30, 2026

Summary

  • Add end-to-end base-color texture loading and rendering for DAE/COLLADA meshes (and other Assimp-supported formats)
  • Vendor stb_image v2.30 for image decoding; add LoadTexture utility for GPU upload
  • Add UV coordinates to DefaultVertex, extract from Assimp with V-flip for Vulkan convention
  • Extract texture paths from Assimp materials (PBR base color, then Phong diffuse fallback)
  • Update PBR shaders (opaque + transparent) to sample baseColorTex — meshes without textures use a 1x1 white fallback (no shader branching)
  • Add TexturedMesh example with checkerboard test asset for visual verification

Test plan

  • TestTextureSupport — 10 test cases covering vertex UVs, texture path extraction, DAE loading, shader metadata
  • TestShaderMetadata — updated for new sampler counts
  • TestMeshData — updated for texCoord field
  • All 4 test suites pass (100%)
  • Visual verification with ANYmal shell DAE mesh — texture renders correctly

🤖 Generated with Claude Code

vklemm and others added 2 commits March 28, 2026 10:56
Add end-to-end support for loading and rendering base-color textures
from mesh files (DAE/COLLADA and other Assimp-supported formats).
Meshes without textures continue to render identically via a 1x1
white fallback texture, avoiding shader branching.

- Vendor stb_image v2.30 for image decoding (PNG/JPEG/BMP/TGA/HDR)
- Add UV coordinates (texCoord) to DefaultVertex and extract from Assimp
- Extract base-color texture paths from Assimp materials (PBR then Phong)
- Add LoadTexture utility: GPU upload, white fallback, material sampler
- Update PBR shaders (opaque + transparent) to sample baseColorTex
- Bind per-view textures in RobotScene render loop
- Add TestTextureSupport with 8 test cases; update existing tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
COLLADA/DAE uses OpenGL convention (V=0 at bottom) while Vulkan and
stb_image use top-left origin. Flip V to 1-v when extracting UVs from
Assimp to get correct texture mapping.

Also adds a self-contained TexturedMesh example with a checkerboard
quad DAE test asset, and a new test verifying DAE texture path
extraction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ManifoldFR
Copy link
Copy Markdown
Member

Thanks for this @vklemm, I wanted to add this feature for a while.

We don't have an AI policy defined. For now I'll just ask if you reviewed the code carefully.

I'll build and run the code locally to see what it looks like. Could you post screenshots in your PR (the new example as well as some models you displayed using this new code)? Also, I'll need you to format your code using pre-commit and update the changelog 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants