You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Materials can be made vastly more dynamic and interactive through the use of dynamic material attributes. This has many applications in custom games, such as composing an entire interface out of custom materials that players can then interact with, and changing the appearance of a material based on some state.
Currently, the only way to manipulate the dynamic material attributes on entities is by firing the "SetRenderAttribute" and "ClearRenderAttribute" inputs on the entity directly through i/o:
There are also the inputs "SetRenderAttributeFloat", "SetRenderAttributeVector", and "SetRenderAttribute4Floats", but I haven't tested these.
Proposal
Additional methods on the base Entity class that serve as ways to get, set, clear, and check for the existance of dynamic material attributes by operating directly on the Entity handle itself.
Here's a rough example implementation:
exportclassEntity{/** * @param {string} attributeName * @returns {any} * * Checks the entity for the specified attribute and returns its value if it exists. */GetRenderAttribute(attributeName: string): any;/** * @param {string} attributeName * @param {any} value * * Set an attribute on the entity to the specified value. */SetRenderAttribute(attributeName: string,value: any): void;/** * @param {string} attributeName * * Returns true if the specified attribute exists on the entity. */HasRenderAttribute(attributeName: string): boolean;/** * @param {string} attributeName * * Clears the specified attribute from the entity. */ClearRenderAttribute(attributeName: string): void;}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Materials can be made vastly more dynamic and interactive through the use of dynamic material attributes. This has many applications in custom games, such as composing an entire interface out of custom materials that players can then interact with, and changing the appearance of a material based on some state.
Currently, the only way to manipulate the dynamic material attributes on entities is by firing the "SetRenderAttribute" and "ClearRenderAttribute" inputs on the entity directly through i/o:
There are also the inputs "SetRenderAttributeFloat", "SetRenderAttributeVector", and "SetRenderAttribute4Floats", but I haven't tested these.
Proposal
Additional methods on the base
Entityclass that serve as ways to get, set, clear, and check for the existance of dynamic material attributes by operating directly on the Entity handle itself.Here's a rough example implementation:
Beta Was this translation helpful? Give feedback.
All reactions