Commit Graph

3175 Commits

Author SHA1 Message Date
Syoyo Fujita
ee72c871cd fix build errors on MSVC
- task-queue.hh: Use mutex fallback on MSVC (no GCC __atomic_* builtins)
- shape-to-mesh.hh: Use kPI/kPI_2 constants instead of M_PI/M_PI_2
- tinyexr_c_impl.c: Use Windows Interlocked functions for MSVC C mode
- unit-task-queue.cc: Fix lambda capture for MSVC

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 01:05:13 +09:00
Syoyo Fujita
598839897a fix build errors on macOS
- Update _POSIX_C_SOURCE from 199309L to 200112L for vsnprintf/snprintf
- Silence unused parameter warning in serializePreviewSurfaceToJson

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:17:49 +09:00
Syoyo Fujita
37ab7b515d Merge branch 'anim-mtlx-phase3' of github.com:lighttransport/tinyusdz into anim-mtlx-phase3 2026-01-07 07:28:34 +09:00
Syoyo Fujita
f7ec005ef1 Merge branch 'release' into dev 2026-01-07 06:58:28 +09:00
Syoyo Fujita
50834c9c14 Merge branch 'dev' of github.com:lighttransport/tinyusdz into dev 2026-01-07 06:55:55 +09:00
Syoyo Fujita
f017d061bd add license term 2026-01-07 06:55:43 +09:00
Syoyo Fujita
3b4bf5a687 update html file.
revert to use fancy-teapot for materialx.js demo.
2026-01-06 08:08:30 +09:00
Syoyo Fujita
abd5d28771 Add delayed texture loading with progress bar for faster initial scene render
- Add TextureLoadingManager class for queuing and progressive texture loading
- Add texture progress bar UI (bottom overlay with green theme)
- Modify buildSceneWithProgress to use delayed texture mode
- Scene renders immediately without textures, then textures load in background
- Support textureLoadingManager option in material conversion functions
- Update TinyUSDZMaterialX.js to support delayed loading for OpenPBR materials
- Textures load with concurrency control (2 at a time) and browser yields

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 07:46:03 +09:00
Syoyo Fujita
4366fdd2f1 Fix HDRI light visibility in envmap mode and improve light transform controls
- Fix lights disappearing from HDRI on refresh in envmap mode by using
  lightData.enabled (user's intention) instead of threeLights.visible
  (rendering state) for HDRI projection filtering
- Update toggleLight() to respect envmap mode - keep lights hidden for
  rendering while still allowing on/off toggling for HDRI purposes
- Fix setLightingMode() to restore lights based on user's enabled state
  when switching back to lights mode
- Fix SpotLight rotation gizmo position by resetting light.position to
  (0,0,0) after creation (Three.js r146+ defaults to (0,1,0))
- Add getAttachTargetForLight() for proper transform control attachment
  based on mode (translate/rotate/scale -> group, target -> target object)
- Add minHdriRadius (0.3) for HDRI projection to ensure lights are visible
- Improve light picking to skip disabled/invisible helpers
- Add drag state management to prevent picking different object after drag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 06:58:19 +09:00
Syoyo Fujita
dc6dc91c85 Update Env Intensity GUI from DomeLight settings
- Add envIntensityController to guiState for GUI updates
- Update Env Intensity display when loading DomeLight from USD
- Update Env Intensity display when switching to usd_dome environment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 04:13:33 +09:00
Syoyo Fujita
7ba445a9cb Add normal map support for UsdPreviewSurface and enhance Show Normals feature
- Export normalTextureId, occlusionTextureId, displacementTextureId in
  material-serializer.cc for UsdPreviewSurface materials
- Fix TinyUSDZLoaderUtils.js to properly extract surfaceShader from
  nested JSON structure
- Add Normal Mode selector (geometry/mapped) to Show Normals feature
- Add createViewNormalMaterial() shader for view-space normals with
  normal map support
- Add extractNormalMapFromMaterial() to extract normal maps from both
  OpenPBR/MaterialX and UsdPreviewSurface materials
- Make Env Color and Env Colorspace controls disabled when Environment
  is not constant_color

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 04:03:01 +09:00
Syoyo Fujita
73d7a8aa69 Add CLI test for EM_JS progress callbacks
- Add test-progress-cli.js with synthetic USD generation and file tests
- Tests verify EM_JS onTydraProgress callbacks work in Node.js
- Generates USDA on-the-fly (3 meshes, 10 meshes, mixed geometry)
- Loads real USD files (usda, usdc, usdz) with progress tracking
- Add npm script: npm run test:progress

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 23:59:46 +09:00
Syoyo Fujita
d04efdf8d3 Add EM_JS synchronous progress callbacks for Tydra conversion
- Add EM_JS functions in binding.cc for direct C++ to JS progress reporting
  - reportTydraProgress: mesh conversion progress (current/total, stage, name)
  - reportTydraStage: conversion stage changes
  - reportTydraComplete: conversion completion with counts
- Update TinyUSDZLoader.js with callback options:
  - onTydraProgress, onTydraStage, onTydraComplete
  - setTydraProgressCallback/setTydraStageCallback/setTydraCompleteCallback methods
- Integrate callbacks in progress-demo.js for real-time UI updates
- Add design document for JS/WASM synchronous event update patterns

This enables real-time progress updates during Tydra scene conversion
without requiring ASYNCIFY, using Emscripten's EM_JS for synchronous
JavaScript calls from C++.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 22:41:47 +09:00
Syoyo Fujita
bb39395f3f filename fix. 2026-01-04 07:28:12 +09:00
Syoyo Fujita
fbeb15e62f uncomment debug logging. 2026-01-04 07:27:36 +09:00
Syoyo Fujita
c1913a6a69 Add detailed mesh progress logging and memory cleanup for progress demo
- Add DetailedProgressInfo struct with mesh/material counts and stage tracking
- Add printf progress logging during Tydra mesh conversion (visible in console)
- Count GeomMesh, GeomCube, and GeomSphere for accurate total mesh count
- Add cleanupScene() function to free Three.js and WASM memory before loading
- Add Fit to Scene button for camera adjustment
- Add multi-mesh test model for progress testing

Console output shows real-time progress:
[Tydra] Found N meshes (X mesh, Y cube, Z sphere), M materials
[Tydra] Mesh 1/N: /path/to/mesh
[Tydra] Conversion complete: N meshes, M materials, T textures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 07:26:45 +09:00
Syoyo Fujita
4eb8912457 Add texture loading patterns and OpenPBRMaterial support
- Add sync/Loaded variants for material conversion functions:
  - convertOpenPBRToMeshPhysicalMaterial (immediate return)
  - convertOpenPBRToMeshPhysicalMaterialLoaded (waits for textures)
  - convertToOpenPBRMaterial (immediate return)
  - convertToOpenPBRMaterialLoaded (waits for textures)

- Add full texture support for OpenPBRMaterial custom shader:
  - map, roughnessMap, metalnessMap, emissiveMap, normalMap, aoMap

- Add HDR/EXR texture format detection and decoding:
  - Magic byte detection in getMimeType()
  - TinyUSDZ HDR decoder (faster) with Three.js fallback
  - Three.js EXR decoder with TinyUSDZ fallback

- Update MaterialX documentation:
  - Three.js/WebGL integration section
  - Supported parameters and texture maps tables
  - MaterialX NodeGraph and node shader documentation
  - Complete USDA examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 02:08:24 +09:00
Syoyo Fujita
e4400c53d6 clean-up documents 2026-01-03 06:08:10 +09:00
Syoyo Fujita
054578ed8e Add EXRDecoder with Three.js primary + TinyUSDZ fallback
EXRDecoder.js:
- Uses Three.js EXRLoader by default (faster, more compression support)
- Falls back to TinyUSDZ for unsupported formats (deep EXR, tiled, etc.)
- Exports: decodeEXR(), decodeEXRAsync(), checkEXRSupport()
- Supports float16/float32 output formats
- Verbose mode for debugging decoder selection

Three.js EXRLoader supports:
- NO_COMPRESSION, RLE, ZIPS, ZIP, PIZ, PXR24, B44, B44A, DWAA, DWAB

TinyUSDZ fallback supports:
- NO_COMPRESSION, RLE, ZIPS, ZIP, PIZ

Usage:
  import { decodeEXR } from 'tinyusdz/EXRDecoder.js';
  const result = decodeEXR(buffer, tinyusdz, { outputFormat: 'float16' });

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 05:56:52 +09:00
Syoyo Fujita
6a810eacf2 Add synthetic EXR generator for benchmark testing
- generate-test-exr.js: Creates uncompressed EXR files with various patterns
  (gradient, checker, noise, solid, hdr)
- Supports half (fp16) and float (fp32) pixel types
- Generates 256x256, 512x512, and 1024x512 test files by default
- Add npm script: npm run generate:exr

EXR benchmark results (uncompressed):
- 256x256: TinyUSDZ 1.4x faster than Three.js
- 512x512+: Both decoders perform similarly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 05:51:16 +09:00
Syoyo Fujita
141501ec22 Add HDR (Radiance RGBE) image loading support and benchmark
Core image-loader:
- Add DecodeImageHDR using stbi_loadf_from_memory for float32 RGBA output
- Add IsHDRFromMemory and GetImageInfoHDR functions
- HDR detection runs before STB fallback to ensure float output

WASM binding:
- Update decodeHDR to use stbi_loadf_from_memory instead of image-loader
- Default output format changed to float16 (Uint16Array) for memory savings
- Add TINYUSDZ_WITH_EXR compile definition to binding target

Benchmark (web/js/benchmark-exr.js):
- Compare TinyUSDZ vs Three.js HDRLoader/EXRLoader performance
- Support float32 and float16 output formats
- JSON output mode for automation
- TinyUSDZ is 2.7-3x faster than Three.js for HDR decoding

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 05:43:45 +09:00
Syoyo Fujita
e64c409a97 Add FP16 support and SIMD for WASM image decoding
- Add IEEE 754 half-precision float conversion utilities (float32ToFloat16, float16ToFloat32)
- Update decodeEXR/decodeHDR/decodeImage to accept outputFormat parameter ("float32", "float16", "auto")
- Add convertFloat32ToFloat16Array and convertFloat16ToFloat32Array utility functions
- Enable WebAssembly SIMD (-msimd128) by default for better performance
- Add optional Relaxed SIMD support via TINYUSDZ_WASM_RELAXED_SIMD flag
- FP16 output returns Uint16Array for direct WebGL HALF_FLOAT texture upload
- 50% memory savings when using FP16 format for HDR/EXR textures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 12:58:26 +09:00
Syoyo Fujita
7ac01267d4 Add TinyEXR v3 API with backward compatible v1 fallback
- Copy TinyEXR v3 source files from upstream tinyexr repository
- Add new CMake option TINYUSDZ_USE_TINYEXR_V3 (default ON)
- V3 provides modern C17/C++17 API with Vulkan-style interface
- V1 API functions remain available for backward compatibility
- Backup original v1 header as tinyexr_v1.h

New files:
- tinyexr_c.h, tinyexr_c_impl.c: Pure C API
- tinyexr_v3.hh: C++17 RAII wrapper
- tinyexr_v2.hh, tinyexr_v2_impl.hh: V2 implementation
- tinyexr_huffman.hh, tinyexr_piz.hh: Compression codecs
- tinyexr_simd*.{hh,h,cc}: SIMD optimizations
- exr_reader.hh, streamreader.hh, streamwriter.hh: Utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 08:38:01 +09:00
Syoyo Fujita
51b3eeb2c5 Remove test-results-usdlux.json from repository
Test result files should not be tracked in version control
as they are generated output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 08:12:53 +09:00
Syoyo Fujita
60352623de Move batch runner to separate directory web/batch-runner
Reorganize to avoid vite dev server interference with batch testing:

New structure:
- web/batch-runner/          # Batch testing tool (isolated)
  - batch-runner.js          # Visual regression runner
  - test.js                  # WebGPU/headless Chrome test
  - headless-chrome-setup.md # Setup documentation
  - package.json             # Own dependencies
  - .gitignore               # Ignore batch-results/

Changes to web/js/:
- materialx.js: Add URL params for batch rendering (usd, autoRender, renderTimeout)
- package.json: Remove batch:* scripts and glob dependency
- vite.config.ts: Ignore node_modules in watch

The batch-runner now references web/js/ for vite server:
  const webJsDir = path.join(__dirname, '..', 'js');

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 07:50:27 +09:00
Syoyo Fujita
f048b9cd29 Add WebGL2 setup section to headless Chrome documentation
- Update title to include WebGL2
- Add comprehensive Quick Start table comparing WebGPU vs WebGL2
- Add WebGL2 with Hardware GPU example (NVIDIA/Vulkan)
- Add WebGL2 with SwiftShader example (software, no GPU)
- Add WebGL2 vs WebGPU comparison table
- Add WebGL2 renderer detection utility function
- Add --use-angle=swiftshader flag to reference table

Key findings:
- WebGL2 works on any origin (no HTTPS requirement unlike WebGPU)
- WebGL2 still requires xvfb (true headless mode doesn't work)
- SwiftShader WebGL2 uses Vulkan 1.3.0 backend

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 07:27:55 +09:00
Syoyo Fujita
853d0a4f12 Add WebGPU headless Chrome setup documentation and test script
- Add headless-chrome-setup.md with comprehensive guide for:
  - Hardware GPU acceleration with NVIDIA/Vulkan
  - Software rendering with SwiftShader (no GPU required)
  - Docker/CI environment setup examples
  - Troubleshooting common issues

- Add test.js for WebGPU verification with Puppeteer
  - Requires xvfb-run for X11 display
  - NVIDIA env vars to select real GPU over llvmpipe
  - HTTPS origin required for secure context

Key findings:
- ANGLE Vulkan requires X11 (xcb_connect), solved with xvfb
- True --headless=new mode doesn't work for WebGPU
- SwiftShader works but still needs xvfb

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 07:19:53 +09:00
Syoyo Fujita
acb5be7777 Add mesh dump CLI option and MaterialX enhancements
JS changes:
- dump-materialx-cli.js: Add --mesh option for dumping vertex data with
  winding order analysis (faceVertexIndices, computed face normals)
- materialx.js: Various MaterialX demo improvements
- OpenPBRMaterial.js: OpenPBR material refinements
- TinyUSDZMaterialX.js: MaterialX parsing enhancements

C++ changes:
- render-data.cc/hh: Add MaterialX config and UV handling improvements
- material-serializer.cc: Material serialization updates
- render-scene-dump.cc: Scene dump enhancements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 09:01:58 +09:00
Syoyo Fujita
9720b0bc07 Fix quad winding order in MaterialX normal map test files
- mtlx-normalmap-plane.usda: Changed faceVertexIndices from [0,1,2,3] to [0,3,2,1]
- mtlx-normalmap-multi.usda: Fixed plane meshes winding order (cubes were already correct)

The CCW winding [0,3,2,1] produces face normals pointing UP (+Y) matching
the declared vertex normals, ensuring correct front-face rendering.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 09:00:05 +09:00
Syoyo Fujita
c922926ca8 Refactor usdlux.js: add DEBUG flag and clean up logging
- Add DEBUG flag (default false) and debugLog() wrapper function
- Convert ~50+ console.log debug statements to use debugLog()
- Keep console.warn/error for important messages
- Remove unused RectAreaLightHelper import

Set DEBUG = true to re-enable debug output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 00:39:58 +09:00
Syoyo Fujita
d795fdd02d Fix ACES 2.0 tonemapping shader compilation and color rendering
- Fix duplicate CustomToneMapping function definition error by stripping
  existing definition from original shader chunk before appending
- Replace broken CAM-based Hellwig 2022 implementation with simpler
  working approximation using ACES filmic curve with luminance-based
  blending for hue preservation and highlight desaturation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:01:06 +09:00
Syoyo Fujita
8de680ac29 aces 1.3 and 2.0 2025-12-31 08:20:56 +09:00
Syoyo Fujita
73def407a8 Add event-driven Blender bridge with remote support
Replace polling with lightweight event-driven mechanisms:
- bpy.msgbus subscriptions for material/light property changes
- depsgraph_update_post handler for transform changes
- Timer only for viewport camera (100ms, unavoidable)

Add remote Blender support via HTTP endpoints:
- GET /blender/bridge.py - Full Python script
- GET /blender/bootstrap - Auto-connect one-liner

Remote Blender can now connect with single command:
  import urllib.request; exec(urllib.request.urlopen("http://SERVER:8090/blender/bootstrap").read().decode())

Files:
- blender/bridge_simple.py - Standalone script (MCP compatible)
- blender/bridge_addon.py - Full Blender addon with UI panel
- server.js - Added HTTP endpoints for script serving
- SETUP.md - Updated with event architecture and remote setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 02:13:08 +09:00
Syoyo Fujita
b02434e826 Add Blender Bridge for real-time USD scene streaming to browser
WebSocket-based bridge for streaming USD scenes from Blender to a
Three.js browser viewer with live parameter synchronization.

Features:
- WebSocket server (port 8090) for Blender-to-browser communication
- Scene upload with binary USDZ payload support
- Real-time parameter updates (materials, lights, camera, transforms)
- Blender viewport camera sync to browser
- Fit to Scene button in viewer UI
- TinyUSDZ WASM integration for USD parsing in browser
- Delta detection to minimize network traffic

Components:
- server.js: WebSocket server with session management
- lib/: Message protocol, connection manager, scene state
- client/: Browser WebSocket client and parameter sync
- viewer/: Three.js viewer with TinyUSDZ integration
- send-camera.js: Helper to send Blender camera to browser
- test-client.js: Test client for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 13:59:04 +09:00
Syoyo Fujita
64b909a8d3 Add Three.js GLTFLoader-compatible progress callback support
- Fix load() method to use onProgress parameter with streaming download
- Add _createProgressEvent() helper for GLTFLoader-compatible events
- Add _fetchWithProgress() for streaming download with progress
- Add loadWithFullProgress() for unified progress across download/parse/build
- Add loadWithFullProgressAsync() Promise wrapper
- Add progress callback support to buildThreeNode() in TinyUSDZLoaderUtils
- Add _countNodes() helper for progress estimation
- Document progress callback API in README.md

Progress event object: {loaded, total, stage, percentage, message}
Stages: 'downloading' (0-50%) | 'parsing' (50-80%) | 'building' (80-100%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:24:59 +09:00
Syoyo Fujita
031abe440d Revert default USD filename 2025-12-26 07:13:29 +09:00
Syoyo Fujita
35c841debb Fix DomeLight texture loading error handling for unresolvable asset paths
- Add pre-fetch check to verify file accessibility before loading EXR/HDR
- Check content-type header to detect HTML 404 pages served with 200 status
- Add proper null checks for texture.image before PMREM processing
- Wrap EXR/HDR loader calls in individual try-catch blocks
- Return null with descriptive warnings instead of throwing errors

This prevents "Cannot read properties of undefined (reading 'image')"
errors when USD files reference DomeLight textures that cannot be
resolved by the web server's asset resolver.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 07:12:19 +09:00
Syoyo Fujita
2ad0c8f331 Add OpenPBR validation framework and enhanced Material UI controls
- Add OpenPBRValidation.js with GPU-based BRDF validation tests:
  - Fresnel Schlick, GGX NDF, Smith G geometry function tests
  - Full BRDF integration test
  - Multi-resolution testing (256/512/1024)
  - Layer mixing validation per OpenPBR Section 3
  - Energy conservation validation

- Add OpenPBRMaterial.js custom ShaderMaterial skeleton

- Enhance Material UI with OpenPBR parameter controls:
  - Base layer: Diffuse Roughness
  - Specular layer: Weight, Color, IOR, Roughness
  - Coat layer: Weight, Roughness, IOR, Color
  - Fuzz/Sheen layer: Weight, Roughness, Color
  - Organized controls by OpenPBR layer groups

- Add validation GUI buttons: Run BRDF Tests, Multi-Res Tests, Run Layer Tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 07:02:21 +09:00
Syoyo Fujita
c614e1688f Add MtlxConfig for configurable primary UV name in MaterialX parsing
Add MtlxConfig struct similar to OpenUSD's USDMTLX_PRIMARY_UV_NAME
environment variable for configuring the primary UV set name when
parsing MaterialX ND_texcoord_vector2 nodes.

Changes:
- Add MtlxConfig struct in usdMtlx.hh with primary_uv_name and
  secondary_uv_name_prefix fields
- Update ConvertTexCoord to use MtlxConfig instead of hardcoded "st"
- Thread MtlxConfig through ConvertSingleNode, ConvertNodeGraphIterative,
  ConvertNodeGraphRec, ReadMaterialXFromString, and ReadMaterialXFromFile
- Update Tydra's GetConnectedMtlxTexture to use
  mesh_config.default_texcoords_primvar_name for MaterialX texcoord nodes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 02:15:47 +09:00
Syoyo Fujita
2e6fb59df2 Merge branch 'anim-mtlx-phase3' of github.com:lighttransport/tinyusdz into anim-mtlx-phase3 2025-12-26 01:06:31 +09:00
Syoyo Fujita
f244e492a7 Fix scene graph UI performance and polish animation.js
Performance improvements:
- Limit scene graph UI to 100 objects (was causing 50k+ DOM elements)
- Show simplified UI with object counts for large scenes
- Improved FPS from ~1 to ~50 with large USD scenes

Animation behavior changes:
- Start animation paused by default (isPlaying=false)
- Show "Scene ready!" message when loading completes
- Add animation toggle to selected object info panel

Code cleanup:
- Comment out verbose debug console.log statements
- Remove debug helper exposures (window.profileFrame, etc.)
- Keep essential status logs for user feedback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 01:06:12 +09:00
Syoyo Fujita
b83bf44366 cosmetics. 2025-12-26 00:04:01 +09:00
Syoyo Fujita
dbec308bd1 add note on OpenUSD's MaterialX node parser behavior. 2025-12-25 01:31:53 +09:00
Syoyo Fujita
0011b4ea8f Clarify next release features in README
Updated the README to clarify planned features for the next release.
2025-12-25 00:09:21 +09:00
Syoyo Fujita
b6c8bb095d Merge branch 'anim-mtlx-phase2' into anim-mtlx-phase3 2025-12-25 00:00:50 +09:00
Syoyo Fujita
e411e3ccac Fix texture coordinates not being filled for MaterialX materials
Two issues were fixed:
1. GetConnectedMtlxTexture() now recognizes ND_image_vector4, ND_image_vector3,
   and ND_image_float nodes in addition to ND_image_color4/color3
2. ListUVNames() now extracts UV primvar names from OpenPBR shader parameters
   in addition to UsdPreviewSurface parameters

This ensures texture coordinates are properly populated in RenderMesh when
using MaterialX materials with texture-mapped parameters.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 11:53:13 +09:00
Syoyo Fujita
54042c25c7 Add GC-free direct animation system for zero-allocation updates
- Implement direct animation system that bypasses Three.js AnimationMixer
- Add binary search keyframe lookup and direct lerp/slerp interpolation
- Store animation data in Float32Arrays for cache-friendly access
- Add UI toggle "Direct Anim (GC-free)" in Info folder (default: ON)
- Add mixer update throttling with configurable skip frames
- Cache animation clip actions to prevent duplicate Interpolant allocations
- Pre-allocate Quaternion temporaries for slerp operations

This eliminates GC pauses during animation playback by avoiding
AnimationMixer's internal object allocations with many animation clips.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 07:17:18 +09:00
Syoyo Fujita
acd2edbdfc Add mesh selection, lighting mode toggle, and HDRI envmap features
- Add mesh selection with transform gizmo support
- Add selection mode toggle (All/Meshes/Lights) with M/L keyboard shortcuts
- Add lighting mode toggle to switch between direct lights and HDRI envmap
- Add option to show HDRI envmap as scene background
- Fix HDRI vertical flip for correct lighting orientation
- Add light position/rotation property editing UI
- Copy world transform to lights in render-data.cc
- Add PointLight support in HDRI projection
- Fix HDRI coordinate system for sphere/disk lights
- Add dev:lux npm script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 04:00:29 +09:00
Syoyo Fujita
77dd2d8fb3 Add light property editing, transform gizmos, and live HDRI update
- Add UI controls for editing selected light color, intensity, and exposure
- Add transform controls for lights (w=translate, e=rotate, r=scale)
- Fix SpotLight helper sphere/cone position alignment
- Fix RectAreaLight shadow warning (skip shadow config for unsupported light types)
- Fix TransformControls API compatibility for newer Three.js versions
- Add live HDRI update feature with debouncing:
  - Automatically refresh HDRI when lights move, properties change, or toggle on/off
  - Refresh when HDRI center position or max distance changes
- Fix HDRI preview Refresh button to re-project lights

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 08:42:12 +09:00
Syoyo Fujita
64bfb27c02 Add Lab project section to README 2025-12-23 00:18:05 +09:00