Home Technical Talk

[Maya CGFX] Photoshop psd file loses alpha channel

For one of our 3D artists I've ported and extended a shader from Unity3D to Maya. The shader in Unity3D uses PSD files as input for textures and makes use of the alpha channel of one of the textures as a heightmap.

In Maya it seems as if the alpha channel is lost, because it's always 1. We tested this with PSD and PNG files. However, when using a TGA file, the heightmap could be used as intended and the shader functioned correctly.

Below some Cg code to illustrate what I mean:
float4 bottomColor = tex2D(RGBA_Texture2, IN.TexCoord.xy);
float4 height = float4(1.0f) - bottomColor.aaaa;
In the above code, bottomColor.aaaa is always (1.0, 1.0, 1.0, 1.0) when using a PSD texture, but not when using a TGA texture.

Note: Converting all textures to TGA is (unfortunately) NOT an option.

Replies

  • warby
    Offline / Send Message
    warby polycounter lvl 18
    this is what michael "zacker" schmidt and i found out (which will get you a bit further but not entirely there)

    1) Double click the psd file node in the hypershader

    2) In the attribute editor below the path to the psd file you will see an option called "alpha to use".

    3) Open the dropdown where it says "default" and choose "Alpha 1" or what ever you called it in photoshop.

    unfortunately that will only make the alpha channel show up within the standard maya shaders and only within the transparency slot there !

    we still have trouble hooking the psd alpha or any alpha into a cg fx shader...

    if you figure something out please let us know
Sign In or Register to comment.