Search Unity

Membrane, translucent and phosphorescent material?

Discussion in 'Shaders' started by webphone, Mar 20, 2010.

  1. webphone

    webphone

    Joined:
    Mar 13, 2010
    Posts:
    315
  2. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Assuming that by translucent and phosphorescent, you mean transparent and self-illuminating, then Unity has built-in shaders which will do that. I'm not sure what you mean by "membrane" as an adjective, though.
     
  3. webphone

    webphone

    Joined:
    Mar 13, 2010
    Posts:
    315

    Attached Files:

  4. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    It looks like the answer is right there in your screen shot. Does your texture have an alpha channel? This is what controls opacity, and it will be completely opaque if you use an RGB image rather than RGBA.

    Alternatively, you can change the alpha channel of the main colour property if you want uniform opacity.
     
  5. webphone

    webphone

    Joined:
    Mar 13, 2010
    Posts:
    315
    Does your texture have an alpha channel? This is what controls opacity, and it will be completely opaque if you use an RGB image rather than RGBA.

    Alternatively, you can change the alpha channel of the main colour property if you want uniform opacity.

    1. RGB - Yes, it is RGB image from photoshop with alpha channel

    2. RGB Base Trans A - it is default in unity and i cannot change it

    3. Alpha - I have AlphaUtility in photoshop and there is alpha channel in the image

    I attached the photoshop image

    How can I change the alpha channel of the main colour in unity?

    The image color in unity is solid and not transparent (unable see through)
     

    Attached Files:

  6. webphone

    webphone

    Joined:
    Mar 13, 2010
    Posts:
    315
    sorry, this forum does not allow upload psd file

    And, I think I may be wrong to create the alpha image and so unity does not display it properly

    I would like to ask do you know any tutorial or threads about it?
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    did you check the manual about that specific shader. all builtin shaders have documentation in the references - shaderlab so you can learn about how it works so you can use it the right way.


    as for psd and alpha: go to the image color channels and add an alpha channel
     
  8. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Your colour picker should have a slider for alpha in it, allowing you to adjust the alpha of the main colour.

    As far as the alpha channel of the image, if Unity won't let you import as RGBA then Photoshop is not saving your alpha channel. Photoshop is pretty finicky about how it saves alpha depending on what file format you use, and whether you are using explicit or pre-multiplied alpha channels.
     
  9. webphone

    webphone

    Joined:
    Mar 13, 2010
    Posts:
    315
    I can change alpha in main color picker, but the effect seems still not ok

    May I ask how should I set the alpha channel properly in photoshop?

    I go to the channel besides layer properties and add a new channel.

    Is it the proper step?

    I cannot capture the screen in photoshop
     

    Attached Files:

  10. webphone

    webphone

    Joined:
    Mar 13, 2010
    Posts:
    315
    I tried to use rar to zip the psd file to upload

    I tried the whole day and the object still not transparent.

    Anyone could help?

    I need the whole imported object to be transparent and there is only one mesh and single material.

    I searched this forum and cannot find any solution to create a transparent imported object.
     

    Attached Files:

  11. webphone

    webphone

    Joined:
    Mar 13, 2010
    Posts:
    315
    I tried to use external shader

    http://www.unifycommunity.com/wiki/index.php?title=BlendedFlatColor

    is the closest what i want

    http://www.unifycommunity.com/wiki/index.php?title=BlendedDecal

    can apply texture

    However, both of them are not luminescent like
    http://www.tradebit.com/usr/videofuel/pub/9002/5673946_0012LuminescentFlowers.jpg

    http://www.luminescent-studio.com/luminescent mushroom.jpg

    So, is the problem related to shader?

    How should I custom the shader code of Blended Flat Color

    to have luminescent effect?

    Code (csharp):
    1.  
    2. Shader "BlendedFlatColor" {
    3.     Properties {
    4.         _Color ("Main Color, Alpha", Color) = (1,1,1,1)
    5.     }
    6.     Category {
    7.         ZWrite Off
    8.         Lighting Off
    9.         Tags {Queue=Transparent}
    10.         Blend SrcAlpha OneMinusSrcAlpha
    11.         Color [_Color]
    12.         SubShader {
    13.             Pass {
    14.                 Cull Off
    15.             }
    16.         }
    17.     }
    18. }
    19.  
     

    Attached Files: