Hello,
I’m working on editor tool which would go thru all scenes and graphics settings and collected all USED shader variants. These variants would be saved to shader variant collection later.
So far, I can collect all materials with attached shader in scene. I can get shader shared keywords in material class, but i’m missing shader PassType. I’m at my wits’ end. I tried everything I could find in documentation, but it seems Unity doesn’t support such actions from outside tool. I can detect correctly number of passes in shader, but Material.GetPassName will not return anything. Material.GetTag will only retrieve tags from subshader, but not from its pass.
It has to be possible to do this as Unity is able to do it (Edit->Project Settings->Graphics->save to asset), but that is too much of manual work (there are a lot of scenes), there has to be way how to automate this.
Can anyone help me or at least point me to the right direction? Thank you! ![]()