microsoft / mixed-reality-extension-sdk

The Mixed Reality Extension SDK enables developers to build 3D world extensions for AltspaceVR, using Node.JS.
MIT License
142 stars 61 forks source link

ability to control shader parameters of existing object? (feature request) #738

Open djzielin opened 3 years ago

djzielin commented 3 years ago

Might be nice to allow control of parameters of advanced shaders. That way can just send one piece of data, and have big graphical changes.

GoogolHz commented 3 years ago

There is a hackish way to do this: An MRE could manipulate colors and positions of elements in special layer that also includes a camera that culls all other layers, and only sees this special layer. The camera renders to a render texture that is referenced in the shader. The shader can 'walk through' (analyse) the texture and modify its values based on what it finds: THink of it this way: The mre may have a UI 'slider' that also moves the x position of an MRE element in ~layer20, and camera renders this change to a texture, the shader reads the x position of the element representing the modified slider, and this drives a property of the shader.