Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Post-processing overlay effects

Discussion in 'Image Effects' started by jessee03, May 28, 2021.

  1. jessee03

    jessee03

    Joined:
    Apr 27, 2011
    Posts:
    700
    Is there a way to make image overlay effects similar to what Photoshop uses? I want to be able to duplicate the current camera view and then use a screen overlay effect. I found this tutorial and got it working but am unsure how to alter the shader to process this kind of image effect that I'm trying to create.

    https://docs.unity3d.com/Packages/com.unity.postprocessing@2.1/manual/Writing-Custom-Effects.html

    Here's some code I found for possibly creating the screen effect, not sure how to use this to calculate though


    Code (CSharp):
    1. fixed4 Screen (fixed4 a, fixed4 b)
    2. {
    3.     fixed4 r = 1.0 - (1.0 - a) * (1.0 - b);
    4.     r.a = b.a;
    5.     return r;
    6. }
    7.  
     
  2. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    843
    By "screen overlay effect", do you mean a texture overlay? Because technically, any image effect is a "screen overlay effect".

    The code you posted will do that, if you feed it the screen colour and the texture pixel colour as inputs.
     
  3. jessee03

    jessee03

    Joined:
    Apr 27, 2011
    Posts:
    700
    I guess when I say "Screen" I mean the drop down effect in photoshop