Skip to content

3.0: Move PBR scalars from properties.pbr to .vis #40

Closed

Description

@gerchowl

Context

PBR scalars (roughness, metallic, base_color, ior, transmission,
clearcoat, emissive) are rendering parameters derived from
MaterialX source graphs. By our design principle, all
visual/rendering state belongs under .vis.

Current (2.x)

steel.properties.pbr.roughness        # rendering scalar (wrong namespace)
steel.properties.pbr.normal_map       # legacy texture path
steel.vis.textures["normal"]          # mat-vis texture bytes
steel.vis.source_id                   # mat-vis pointer

Target (3.0)

# PBR is the primary interface — flattened on .vis
steel.vis.roughness                   # scalar
steel.vis.metallic                    # scalar
steel.vis.base_color                  # (r, g, b, a)
steel.vis.ior                         # derived from optical.refractive_index
steel.vis.textures["normal"]          # baked PNG bytes

# MaterialX is the source/provenance — tucked under .vis.source
steel.vis.source                      # MaterialX graph (raw)
steel.vis.source.export(path)         # write .mtlx + PNGs to disk
steel.vis.source.xml                  # raw XML string

# mat-vis pointers
steel.vis.source_id                   # "ambientcg/Metal032"
steel.vis.finishes                    # {"brushed": "...", ...}
steel.vis.discover()                  # search mat-vis index

Why PBR flat on .vis, MaterialX under .vis.source

PBR metallic-roughness is a subset of what MaterialX can describe
(MaterialX also covers Phong, Disney BSDF, subsurface, volume,
procedural nodes, etc.). So PBR is derived FROM MaterialX, not a
sibling.

But 99% of consumers want PBR scalars + textures — that's the
common access path. Flattening PBR onto .vis directly keeps
the API simple. The MaterialX graph is provenance (where did this
come from), not the primary interface.

MaterialX source graph (in mat-vis git)
    │
    ▼ bake (CI runner)
PBR scalars + flat PNG textures (in Parquet)
    │
    ▼ fetch (vis client)
material.vis.roughness / .textures["normal"]

Physics → rendering bridge

ior derived from properties.optical.refractive_index,
transmission from properties.optical.transparency — these
derivations move into Vis initialization.

Breaking changes

  • material.properties.pbr.* → material.vis.*
  • PBRProperties class removed from properties
  • pbr.*_map fields removed (textures are vis.textures[...])
  • TOML [material.pbr] → [material.vis]
  • ocp_vscode is_pymat path reads from .vis

Migration path

  • 2.2.0: ship both namespaces, adapters read from both
  • 2.3.0: DeprecationWarning on properties.pbr access
  • 3.0.0: remove properties.pbr, .vis is the single source

Related

  • mat-vis mtlx/ directory — MaterialX source files in git
  • export_mtlx() adapter — becomes vis.source.export()
  • mat-vis#36 — reference client + adapters migration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions