stride icon indicating copy to clipboard operation
stride copied to clipboard

How to generate shader source from material as text?

Open dawiddyrcz opened this issue 2 years ago • 0 comments

Hello, For educational purposes i want to create material and then generate shader source as text and read this text. How can I do that? I tried to read shader files from repository but it is difficult.

I started with something like that but I failed. This snipper returns null ;/

var context = new MaterialGeneratorContext(material, GraphicsDevice);
 context.Step = MaterialGeneratorStep.GenerateShader;
 context.PushLayer(null);
 context.PopLayer();
 var source = context.ComputeShaderSource(MaterialShaderStage.Vertex);

dawiddyrcz avatar Dec 12 '23 16:12 dawiddyrcz