Search Unity

Change color in the overlap of two 3D objects

Discussion in 'Shaders' started by anisthya, May 20, 2017.

  1. anisthya

    anisthya

    Joined:
    May 20, 2017
    Posts:
    3
    I'm doing an x-ray shader, I got this code, but for what I want it's incomplete. Here's the shader website:
    http://www.photonworkshop.com/index.php/blog/x-ray-shader/

    My knowledge in shader is pretty basic, I'm studying weeks in Unity documentation and in various tutorials, but nothing comes close to what I need.

    I need to make if one object is on top of the other the color turns green, in addition to having a density control of the material that makes it darker or lighter, and the same with the color intersected.
    And to finish the possibility of putting a texture in black and white and have an individual control the internal with these same characteristics. If you can help me, thank you.
    I tried via C # to change the color, but there remained a wagon hehehehhehehe.
    This is what I have.

    This is what I want to do.



    I tried to use overlay, but it did not work. I needed to know how to get pixel rendering from the scene and compare with conditionals, or if someone has a better idea, merge or anything else will be welcome. Thank you.
     
  2. anisthya

    anisthya

    Joined:
    May 20, 2017
    Posts:
    3
    Detail, my intention is to be able to rotate the objects and have more details of them when they are hidden behind objects with great density.
     
  3. zerotech15

    zerotech15

    Joined:
    Jan 28, 2016
    Posts:
    94
    What you are looking for is probably a shader with additive blending.