I’ve gone a little bit back to basics now, with the goal of improving these three areas:
- Composability
- Reusability
- Readability
The biggest thing I think that can contribute to all three at the same time is to break down the various elements into frames, similarly to how the original shader uses different functions to organize the shader code neatly.
(Note – the NME seems to have a bit of trouble displaying the inputs on the collapsed frame despite instructions to do so, doesn’t look like it’s calculating correct collapsed dimensions for the frame maybe).
Here is the CircleShape frame that can be dropped into any fragment shader in the NME and be immediately useful (I’m not sure how to share JSON files on the forum, so Gist it is for now…).
This has been an incredibly useful journey into learning both shaders and NME!
Ed: Here is an example NME procedural texture that uses the circle frame to draw multiple concentric circles