Search Unity

transparancy of psd

Discussion in 'Immediate Mode GUI (IMGUI)' started by DaFame, Jun 24, 2009.

  1. DaFame

    DaFame

    Joined:
    Apr 24, 2009
    Posts:
    41
    Good morning,

    guys i got a question.
    I got a psd with a semi transparent background vor example 70%. And everytime i Draw sth. else in this section its darken.
    GUI.depth doesnt work in this Case.

    some one know something about this ?
     
  2. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    What texture compression settings are you using? Make sure you have one selected that allows for alpha channel information to be displayed.
     
  3. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    Also keep in mind if you're using a material, it may have a shader, which has a color attached to it. If the alpha channel is set to something less than 100%, your texture will be altered.

    Though I believe that the problem is probably what HiggyB mentioned, the import settings.

    GUI.depth is used for sorting GUI elements for proper displaying order.
     
  4. DaFame

    DaFame

    Joined:
    Apr 24, 2009
    Posts:
    41
    here u can see what i mean.
    The arrow shows the object, which should be drawn infront of the transparent background. It doesnt matter where i put the object everytime there is st. with a bit of transparancy its look like this... its darken

    Screen as attachment
     

    Attached Files:

  5. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    My apologies but I'm having a hard time understanding what you're writing. Are you concerned that you're using UnityGUI and it's appearing in front of in-scene objects? If that's the case then I'll note that UnityGUI will always draw on top of your scene, you cannot have in-scene objects appear in front of UnityGUI interfaces. If you want to do this sort of thing look at GUIText/GUITextures or use your PSD texture on a plane or other in-scene object.
     
  6. DaFame

    DaFame

    Joined:
    Apr 24, 2009
    Posts:
    41
    yes im usin UnityGUI.
    I draw a backgroudn texture and in front of this texture i draw several textures again. And those should be in the front and not behind the background.

    For example u Draw a Big texture as background with a transparancy of maybe 70%.

    On this background u draw some pictures.

    These pictures are darken, because of the background...
     
  7. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Thanks for clarifying, I just wasn't getting it the first time. In this case that shouldn't happen, items you draw first should fall behind those you draw later. Are the ones you're drawing in front opaque or semi-transparent in some way? Are you drawing them all in one OnGUI function or are these spread across multiple scripts? Can you share your UnityGUI code? Can you post a larger screen shot that that tiny thumb image above?

    I ask all this as I'm easily able to draw something as a background, then lots of other stuff on top and I don't see any such issues. As such I'm left to wonder what exactly you're doing so we can offer advice from there.
     
  8. DaFame

    DaFame

    Joined:
    Apr 24, 2009
    Posts:
    41
    Good Morning :)

    i call different draw methods from different scripts.

    The background is a psd file, whith a background of 70% transparancy.

    This in a script called with GUI.DrawTexture.

    And i got one script where i draw the small image again with GUI.DrawTexture.

    Those two scripts would be called in a single class.

    I try to post a bigger image and code as soon as posible.
     
  9. DaFame

    DaFame

    Joined:
    Apr 24, 2009
    Posts:
    41
    i got the problem... its the z-index which wont work ( i know there is no z-index in unity...) i use GUI.depth but this wont work... the image is still behind
     
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    how many scripts which handle gui drawing do you have?
     
  11. DaFame

    DaFame

    Joined:
    Apr 24, 2009
    Posts:
    41
    ähmm in this case...
    2

    One GUI.DrawTexture ( is the first one)
    and then i call a method from another class where another picture would be drawn.
     
  12. DaFame

    DaFame

    Joined:
    Apr 24, 2009
    Posts:
    41
    i solved it... :)