How to generate shader source from material as text?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
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);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided MaterialGeneratorContext snippet and inspect MaterialGeneratorStep.GenerateShader, PushLayer, PopLayer, and ComputeShaderSource(MaterialShaderStage.Vertex). Read the shader files in the repository to understand the expected generation flow. Done means documenting a working way to obtain the generated shader text, or clearly explaining why the snippet returns null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics, game-dev
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100