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

Question Disable ambient occlusion for certain objects

Discussion in 'Universal Render Pipeline' started by Muchmu, Aug 20, 2022.

  1. Muchmu

    Muchmu

    Joined:
    Oct 16, 2020
    Posts:
    2
    How do I do this?
     
  2. Stormy850

    Stormy850

    Joined:
    Jan 19, 2013
    Posts:
    5
    Unfortunately i have not found a way to do this without changing URPs code. But if you are fine with that, the most minimal change you can do is in the
    "Packages/com.unity.render-pipelines.universal/ShaderLibrary/AmbientOcclusion.hlsl" shader. The method
    GetScreenSpaceAmbientOcclusion(float2 normalizedScreenSpaceUV)
    uses an #ifdef to return the ambient occlusion factor. You could define a shader keyword in your material and add it to the #ifdef.