Skip to content

Realistic materials: Material appearance columns, materials= header value, per-vertex UVs (schema 5.8.0) - #67

Draft
SamuelAB-VIM wants to merge 2 commits into
developfrom
sam/realistic-materials
Draft

SamuelAB-VIM wants to merge 2 commits into
developfrom
sam/realistic-materials

Conversation

@SamuelAB-VIM

Copy link
Copy Markdown

Why: the Revit exporter gets an optional "Realistic materials" export (with a "Textures" sub-option). The file needs a place for the render appearance values, the texture coordinates, and one marker so a reader knows which material strategy the file carries.

What changes (schema 5.7.0 -> 5.8.0):

  • Vim.Material: three new columns, AppearanceColor (X/Y/Z), Metalness, Reflectivity. Only filled by exports with the option on; 0 otherwise.
  • Header: optional value materials=realistic or materials=realistic+textures (absent = default export). The C#, C++ and TS header readers already keep unknown key=value lines, so no reader changes. ObjectModelStore.ToDocumentBuilder / ObjectModelBuilder.ToDocumentBuilder get an overload that passes optional header values through.
  • Geometry: SubdividedMesh.UVs (one per vertex or none) and BigG3dWriter writes g3d:vertex:uv:0:float32:2 only when some mesh has UVs. Files without UVs keep the same buffer layout as before.

Contract for the UVs: they are image coordinates. The exporter has already applied the texture's real-world size, offset and rotation, so ColorUvScaling / ColorUvOffset stay (1, 1) / (0, 0). A bump texture with its own size or offset keeps the difference in the existing NormalUvScaling / NormalUvOffset: bump image coordinate = (uv - NormalUvOffset) / NormalUvScaling.

The g3d material buffer is unchanged (color, glossiness, smoothness). Today's renderer loader reads only that, so AppearanceColor, Metalness and Reflectivity have to be read from the Vim.Material entity table.

Used by vimaec/vimaec sam/exporter-realistic-materials. Other sam/ branches also claim 5.8.0; the number will need renumbering on merge.

🤖 Generated with Claude Code

SamuelAB-VIM and others added 2 commits October 26, 2026 10:57
…en only when the exporter sends them)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y (schema 5.8.0); optional header value materials=realistic | realistic+textures; header values through ObjectModelStore.ToDocumentBuilder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant