Skip to content

Mutable Materials - #992

Open
bjornbytes wants to merge 1 commit into
devfrom
mutable-materials
Open

Mutable Materials#992
bjornbytes wants to merge 1 commit into
devfrom
mutable-materials

Conversation

@bjornbytes

@bjornbytes bjornbytes commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Adds support for modifying materials after they're created.

  • Material:get/setNumber
  • Material:get/setVector
  • Material:get/setTexture

I'd like to find a way to avoid verbosely converting between MaterialInfo/MaterialData if possible.

Other things to consider:

  • Material:clone?
  • Deprecate Material:getProperties?
  • newMaterial(texture)?
  • Material:setTexture(texture) defaults to color?
  • Explicit Material:get/setColor methods that do sRGB conversion, or just always do sRGB conversion for color/glow vectors?
    • Former would work with custom material properties better.
    • Material:setColor('color', r, g, b, a) is awkward, but could do the same treatment as Material:setTexture(t). Maybe rename color to baseColor?
    • Material:setColor could also accept a hexcode, which would be nice.

@bjornbytes bjornbytes linked an issue Jul 31, 2026 that may be closed by this pull request
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.

Mutable Materials

1 participant