1 Commits

Author SHA1 Message Date
Syoyo Fujita
483787e54b Add OpenPBR material serialization for JavaScript/WASM binding
Implement comprehensive serialization system to extract OpenPBR material
properties from Tydra RenderMaterial and convert to JSON or XML format
for use in JavaScript/Three.js applications.

New files:
- web/openpbr-serializer.hh: Core serialization implementation
  - JSON serialization for all OpenPBR parameters
  - XML (MaterialX 1.38) output for MaterialX tools/renderers
  - Support for UsdPreviewSurface materials
- web/test-openpbr-material.js: Usage examples and Three.js integration
- web/BUILD_STATUS.md: Build documentation and API reference

Modified files:
- web/binding.cc: Updated getMaterial() method
  - New getMaterialWithFormat(id, format) method for "json"/"xml" output
  - Legacy getMaterial(id) maintained for backward compatibility
  - Proper error handling and format validation

Features:
- Complete OpenPBR support: base, specular, transmission, subsurface,
  sheen, coat, emission, and geometry modifiers
- Handles both value and texture parameters
- Dual format output (JSON for JS, XML for MaterialX)
- C++14/17/20 compatible implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 02:49:52 +09:00