Custom Material Editor Possible?

Started by fishy 1 post 23 views

Reply on sbox.game
  1. #1
    fishy 1,548
    Hi - I am making a material creation editor tool and I would like to include a custom material editor so users can customize material settings when they preview it etc.

    I have hit a blocker where I am unsure how I can pull the same kind of information the in-built material editor does.

    I am able to read features/combos and variables via the ShaderSchema and filter them - this gives me all the editable properties.

    However I cannot seem to find a way to filter the variables based on selected combos/features.

    As an example, the built-in material editor swaps out a slider with a texture input if you tick the Metalness Texture feature. This is what I am trying to find - what features expose which variables.

    metalness.gif 117.75 KB

    There doesn't seem to be any corresponding data in the ShaderSchema which exposes these kinds of settings. I have also had a look at the Material class also, however I can't seem to find anything exposed that would inform me if a variable should be editable/visible or not.

    Does anyone know if there is something exposed in C# somewhere that can help me?