ContentTools on both OSes #28

Open
UnflavoredMeson/Primal_Plus_Plus
opened 2026-11-24 20:15:56 +00:00 by UnflavoredMeson · 0 comments
Owner

Why

Meshes and textures have to be imported on Linux too, and nothing else makes test content once the WPF editor is frozen. In the fork, the importer's dependencies were swapped one by one (FBX SDK, vcpkg, D3D11, a vendored MikkTSpace). Here they are chosen once.

Decided

  • FBX import with ufbx 0.23.1 (downloaded, hash-pinned). Compared with the FBX SDK on 9 files: the same output up to n-gon triangulation, 10-20x faster.
  • MikkTSpace downloaded, pinned to commit 3e895b4.
  • DirectXTex stays on both OSes, downloaded from source and pinned; Linux adds DirectX-Headers and stb_image (no WIC there). No vcpkg.
  • No D3D11: BC6H/BC7 use DirectXTex's CPU encoders, run in strips on the job system; BC7 uses TEX_COMPRESS_BC7_QUICK until S9-05.
  • IBL (environment map processing) runs on ContentTools' own Vulkan compute device from the existing HLSL, on both OSes. The Vulkan SDK is needed for ContentTools on Windows.
  • CMake builds a static ContentTools (for tests) and a shared libContentTools.so with only its exports.

Read first

  • ContentTools, sections 2, 3 and 5.
  • ContentTools/FbxImporter.cpp, TextureImporter.cpp, EnvMapProcessing.cpp on master.

Steps

  • 1. Build geometry processing and primitive meshes on Linux; add UnitTests "primitive meshes".
  • 2. Replace the FBX SDK with ufbx; write the FBX import tests against a small ASCII FBX in UnitTests/Data/.
  • 3. Build DirectXTex from source on both OSes, with stb_image on Linux; add "texture import" tests.
  • 4. Write the Vulkan compute device (VulkanCompute.*) and run the IBL shaders on it; add a GraphicsTests case "image based lighting".
  • 5. Add benchmark: cases for import and compression.

Done when

  • ContentTools builds on both OSes; its unit and graphics tests pass; 0 warnings; tidy 0.

Claude can help with

  • Comparing ufbx's output with the expected numbers when a test disagrees.
  • The Vulkan compute boilerplate.

Learn

  • What a tangent space is and why MikkTSpace exists.
  • Why BC7 encoding is slow and what quick mode gives up.
## Why Meshes and textures have to be imported on Linux too, and nothing else makes test content once the WPF editor is frozen. In the fork, the importer's dependencies were swapped one by one (FBX SDK, vcpkg, D3D11, a vendored MikkTSpace). Here they are chosen once. ## Decided - FBX import with ufbx 0.23.1 (downloaded, hash-pinned). Compared with the FBX SDK on 9 files: the same output up to n-gon triangulation, 10-20x faster. - MikkTSpace downloaded, pinned to commit `3e895b4`. - DirectXTex stays on both OSes, downloaded from source and pinned; Linux adds DirectX-Headers and stb_image (no WIC there). No vcpkg. - No D3D11: BC6H/BC7 use DirectXTex's CPU encoders, run in strips on the job system; BC7 uses `TEX_COMPRESS_BC7_QUICK` until S9-05. - IBL (environment map processing) runs on ContentTools' own Vulkan compute device from the existing HLSL, on both OSes. The Vulkan SDK is needed for ContentTools on Windows. - CMake builds a static `ContentTools` (for tests) and a shared `libContentTools.so` with only its exports. ## Read first - [ContentTools](https://forgejo.unflavoredmeson.com/UnflavoredMeson/Primal_Plus_Plus/wiki/ContentTools), sections 2, 3 and 5. - `ContentTools/FbxImporter.cpp`, `TextureImporter.cpp`, `EnvMapProcessing.cpp` on `master`. ## Steps - [ ] 1. Build geometry processing and primitive meshes on Linux; add `UnitTests` "primitive meshes". - [ ] 2. Replace the FBX SDK with ufbx; write the FBX import tests against a small ASCII FBX in `UnitTests/Data/`. - [ ] 3. Build DirectXTex from source on both OSes, with stb_image on Linux; add "texture import" tests. - [ ] 4. Write the Vulkan compute device (`VulkanCompute.*`) and run the IBL shaders on it; add a GraphicsTests case "image based lighting". - [ ] 5. Add `benchmark:` cases for import and compression. ## Done when - [ ] ContentTools builds on both OSes; its unit and graphics tests pass; 0 warnings; tidy 0. ## Claude can help with - Comparing ufbx's output with the expected numbers when a test disagrees. - The Vulkan compute boilerplate. ## Learn - What a tangent space is and why MikkTSpace exists. - Why BC7 encoding is slow and what quick mode gives up.
Sign in to join this conversation.
No assignees
No project
No milestone
Blocks
#29 PrimalImport command-line importer
UnflavoredMeson/Primal_Plus_Plus
#49 Ambient light actors
UnflavoredMeson/Primal_Plus_Plus
#51 Content browser and import in the editor
UnflavoredMeson/Primal_Plus_Plus
#54 glTF 2.0 import with fastgltf
UnflavoredMeson/Primal_Plus_Plus
#55 Replace DirectXTex's BC7/BC6H encoders
UnflavoredMeson/Primal_Plus_Plus
Depends on
#16 Job system module primal.jobs
UnflavoredMeson/Primal_Plus_Plus
#24 ShaderCompilerTool at build time
UnflavoredMeson/Primal_Plus_Plus
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
UnflavoredMeson/Primal_Plus_Plus#28
No description provided.