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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Curving world shader - apply to every object on scene

Discussion in 'Scripting' started by krzysiu818, May 28, 2020.

  1. krzysiu818

    krzysiu818

    Joined:
    Dec 4, 2019
    Posts:
    10
    Hello Everyone,

    I have an issue with shader that curves the world,
    I got one and it works mechanically perfectly but I must add it to every object separetly.
    (And I can't add shine material to this object too, but it isn't that important.)

    Is there an option that allows me to apply shader to every object that exist on the scene?

    Thank You, and have a nice day.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    Are you using a scriptable render pipeline (URP or HDRP)?
     
  3. krzysiu818

    krzysiu818

    Joined:
    Dec 4, 2019
    Posts:
    10
    I am using URP
     
  4. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    Find your renderer asset (I think I renamed mine to ForwardRenderer):
    upload_2020-5-28_9-43-40.png

    Add a "RenderObjects" feature:

    upload_2020-5-28_9-44-7.png

    Set the Layer Mask to "Everything" and use your Material:

    upload_2020-5-28_9-45-27.png

    That should override all of your materials with your "curved" material... but that might be overkill now that I'm thinking through it :p
     
  5. krzysiu818

    krzysiu818

    Joined:
    Dec 4, 2019
    Posts:
    10
    It might be working but every object will be the same color, right? :D
     
  6. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    Haha yeah I started realizing this as I typed that out... Theoretically you could do it layer by layer but you'd run out of layers really quick so maybe my solution is not so great :D
     
  7. krzysiu818

    krzysiu818

    Joined:
    Dec 4, 2019
    Posts:
    10
    anyway thank You even for trying