Search Unity

[SOLVED] Can you upload uniforms to the shader itself?

Discussion in 'Shaders' started by VZhelev, Oct 4, 2019.

  1. VZhelev

    VZhelev

    Joined:
    Sep 18, 2019
    Posts:
    1
    I made a shader, and 2 materials using it.
    The shader needs its uniforms to be updated every frame, but its done individually for each material.

    The thing is, can you just upload the uniforms once, for all materials using it?
     
  2. mouurusai

    mouurusai

    Joined:
    Dec 2, 2011
    Posts:
    350
    Shader.SetGlobal(thing)
     
    VZhelev likes this.