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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Objects cast shadows, recieve shadows, but not recieve self shadows.

Discussion in 'Shaders' started by atsonic, Nov 5, 2019.

  1. atsonic

    atsonic

    Joined:
    Mar 28, 2014
    Posts:
    4
    Hi.
    I want to create objetcts that cast shadows, recieve shadows but not recieve self shadows.
    Further,those objects' surface unaffected from lightings (just like unlit shader).
    Is it possible?
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Hi and welcome,

    When you say "receives shadows but not receive self shadows", that sounds a bit complicated to to me. So you want other objects shadows cast on the object, but the object can't cast shadows on itself and it also has to be unlit so that no shading is happening except a flat color?

    I can't quickly suggest any ideas, and as far as I know disabled self-shadowing isn't easy to do. You can find some discussions on the topic in threads such as this:
    https://forum.unity.com/threads/having-a-gameobject-not-receiving-is-own-shadow.488498/

    But if you need a flat/unlit material that just casts a shadow, you can find a few examples on the web, like this:
    https://styly.cc/tips/unlitcastshadow-go-shader/
     
  3. atsonic

    atsonic

    Joined:
    Mar 28, 2014
    Posts:
    4
    Hi, Olmi.
    Thank you for your reply!

    Yes, I know It's complicated...
    I read both of references but these aren't suit for my situation.

    I would be happy if you could tell me when you came up with a new idea.

    Thanks.