Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Is there a shader for this?

Discussion in 'Shaders' started by bigkahuna, Jul 16, 2007.

  1. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    For the life of me I thought there was a built-in shader for this, but I can't find it. Want to combine a: diffuse map, bump map and specular map, then have an "alpha" map (cookie cutter) to determine what on the object is opaque and what is transparent. Where is it or does anyone have one?
     
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I think I found it: "Alpha/BumpedSpecular". But this shader uses the same alpha channel for specular and transparency. Is there a reason for this? Is it a huge performance hit to have a separate transparency map? Anyone have a shader with separate specular and transparency already?
     
  3. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    The reason for this is that otherwise Alpha/BumpedSpecular would not fit into limitations of Radeon 8500-9250 hardware (PPC MacMinis and so on). If you can live with that, then a separate texture for alpha surely can be done.
     
  4. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Ahhh... that's the reason...

    Ok, then how does one use the same map for both specular and transparency. It would seem to me that you can really only use it for transparency, since the dark areas are invisible anyways... right?
     
  5. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
    Do I understand this right:
    Because of GFX card limtiations, Unity use alfa channel to control spec. instead of having a "spec map" slot (like base map and bump map)
    We use the alfa channel for "transparency";) -but then we cant use a pre made spec map like the pre made bumpmap. ??
    (or lets say we dont know how to work in a spec map and still have the use of the alfa chanel for transparency)

    Case ex.: a shader for hair that includes bump, alfa sorting (not "cut out"), and spec.
    or big "Hip Hop chain" ;)

    Cheers for any elaborating thoughts.
     
  6. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Because of limitations of some old hardware (shader model 1.4), yes. And because it is faster to read from one texture instead of two textures.

    Nowadays that old hardware seems to be going away at rapid speed. People either have even older hardware (something that can't do bumpmapping), and the ones that did use shader model 1.4 cards back then mostly moved onto more recent cards already.

    Well, if you need separate alpha map and specular/gloss map, then of course there's no way to sensibly put both into the same alpha channel. Then a custom shader would do, with a separate specular texture or by putting specular map into alpha channel of some other texture (again, for efficiency).
     
  7. holmeren

    holmeren

    Joined:
    Dec 12, 2006
    Posts:
    300
    Ok we thoght so ;)

    Good to hear it is so old GFX cards that cant handle it. Then there is hope.....

    Thanx Aras