Search Unity

Resolved URP set material to semi-transparent at runtime

Discussion in 'SRP Dev Blitz Day 2022 - Q&A' started by optimise, Sep 29, 2022.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    From my testing and understanding, I believe currently URP not able change to set material to semi-transparent at runtime with the same material. You need to create another new semi-transparent material to swap it which is kind of annoying. Will official improve this limitation at least at dots graphics?
     
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,

    Transparent surface are a different shader variant than opaque. More exactly it is a shader feature and not a multi compile. Being a shader feature it mean it can't be change at runtime (only compile can be dynamically change).
    This is setup this way to reduce the number of possible variant generated which is related to the shader variant explosion problem. There is no plan to change this with the builtin / provided unity shader.
     
    phil_lira likes this.