Search Unity

[Solved] "Selective" rendering?

Discussion in 'General Graphics' started by RiokuTheSlayer, Jan 20, 2015.

  1. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    So I saw this thread the other day, and I though "Hey, that's pretty cool."
    http://answers.unity3d.com/questions/404637/subtractive-rendering.html

    I was wondering if I could somehow invert this effect? As in, I only want A to be visible when B is over it, and C will be visible unless A is being displayed. I have practically no experience with shaders myself, or the layering system that the cameras use..

    If there's any simple way to do this, I'd appreciate it.
     
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Looks like you need some custom shaders. Otherwise maybe it is simpler to use the stencil buffer in a shader.
     
  3. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    I figured as much, but as I said, I have "practically" no experience using shaders, and wouldn't know how to make one that does what I want.
     
  4. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    I think it's simple, but I wouldn't have several years ago. The perception of simplicity is only achieved through knowledge or ignorance.

    I believe everything you're talking about will be achievable by only via changing render order and whether a shader writes color.

    These videos are old, so I don't remember exactly what I talked about, but I remember thinking that I explained the depth buffer pretty well.
     
  5. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    I'll look into it, thanks
     
  6. RiokuTheSlayer

    RiokuTheSlayer

    Joined:
    Aug 22, 2013
    Posts:
    356
    I got the effect that I'm looking for elsewhere! Thanks for the help regardless