Search Unity

Shader on 3D model not seen over 2D sprites

Discussion in 'Getting Started' started by LZakhar, Jan 12, 2017.

  1. LZakhar

    LZakhar

    Joined:
    Aug 1, 2016
    Posts:
    14
    Hello!!

    I have a question about shader coding.
    I'm only begginer in this thing, so anyone can tell me is it possible to 3D models with alpha shders to be seen over 2D sprites?
    Example:
    There is a sphere on scene and beyond it some sprites
    while in sphere shader setting are
    **#pragma surface surf Lambert**
    it seen ok:

    but I need it to bet transparent, so i change shader to
    **#pragma surface surf Lambert alpha** and then I got this:

    my sphere is visible only over free space. Looks like it rendering behind all sprites now.
    Is there a way to render it as it does on first pic, but with alpha transparency on?

    Shader is included. Alpha on line 22-23
     

    Attached Files: