Repository navigation
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
Draft
SamuelAB-VIM wants to merge 2 commits into
SamuelAB-VIM wants to merge 2 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.materials=realisticormaterials=realistic+textures(absent = default export). The C#, C++ and TS header readers already keep unknownkey=valuelines, so no reader changes.ObjectModelStore.ToDocumentBuilder/ObjectModelBuilder.ToDocumentBuilderget an overload that passes optional header values through.SubdividedMesh.UVs(one per vertex or none) andBigG3dWriterwritesg3d:vertex:uv:0:float32:2only 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/ColorUvOffsetstay (1, 1) / (0, 0). A bump texture with its own size or offset keeps the difference in the existingNormalUvScaling/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,MetalnessandReflectivityhave to be read from theVim.Materialentity table.Used by vimaec/vimaec
sam/exporter-realistic-materials. Othersam/branches also claim 5.8.0; the number will need renumbering on merge.🤖 Generated with Claude Code