I would like to create an educational game, part of which involves allowing the user to modify code for procedurally generating geometry on the CPU and modify shader code and see the changes they make reflected in real-time.
Unlike How can I create a shader at runtime in Unity, I can't use a workaround with if statements, since one of the learning goals is to learn how to code shaders/procedural geometry, and I want users to be able to enter genuinely arbitrary code (ideally sandboxed) to explore the space of possibilities.
My current workflow uses javascript, THREE.js, and GLSL (through webGL), which can certainly manage this kind of process, but I'm considering learning to use a large game engine (such as Unity or Unreal) to take advantage of the conveniences they offer (and so I can learn how to use a large game engine).
How can I allow runtime shader authoring in the context of a larger game engine?