Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question is there any way to add an effect to every shader?

Discussion in 'General Graphics' started by ununion, May 10, 2022.

  1. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    If i have a dissolution effect and how can i add the effect to each shader that i use in project with a simple way?is the only way is manually add the effect code to each shader?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    You can make the effect a function you call that’s in a .cginc or .hlsl file that you include into shaders. But basically, yes, you have to modify every shader.
     
    ununion likes this.
  3. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    thank you bgolus!
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,616
    Depending on what the effect is, you might be able to create a post-processing effect to accomplish it. Post processing applies to everything that is on the screen.