Thanks for the quick response!
I’ve looked at custom expressions already, and they appear to be more designed for the case where you want to inject a small amount of custom shader code, as opposed to allowing to re-purpose existing shaders.
My 2 main blockers to this approach appear to be:
- I’d have to convert all of my uniform buffer declarations and textures into material parameters collections (which, ironically, appear to be implemented using uniform buffers) to pass in the various bits of state into the material.
- The material editor doesn’t appear to support operations on matrices, and it doesn’t seem possible to have a matrix parameter in a Material Parameter Collection.
As I understand it, materials appear to be, (on the gpu side, at least) an interface used by the pass-specific shader code in conjunction with a similar interface exposed by the ( mesh-specific ) vertex factory, allowing the pass-specific code to only need to implement the functionality required for its corresponding drawing policy.
What I’m curious about is if I take my existing shader code and make it conform to that material shader interface, shouldn’t I be able to refer to that code as a “material”, and use it in places instead of a standard node-graph material?