Home Technical Talk

Can Maya do transparency in the viewport?

polycounter lvl 18
Offline / Send Message
Conor polycounter lvl 18
Maya's realtime display of textures with transparency seems to be broken (or the way I'm doing it is wrong). Below is an example. If I map a 32bit tga onto a box and sphere in max, and set transparency to the alpha chanel I get nice transparent objects, with the texture on the outside, as I would expect. In maya, if I apply the same texture, and put the texture's alpha channel into the transparency I get a black/flickery mess. The sorting on the polygons gets messed up, the texture is drawn on the backfaces and the texture flickers when I rotate the view. In max this works fine with direct 3D or openGL - surely this can't be a bug in maya can it? Any maya users out there care to enlighten me?

transparency_example.jpg

Replies

  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Well, yeah it can do transparency in the viewport.
    Make sure that If your alpha isnt showing up, under the hardware texturing tab in the shader properties, that texture channel is set to 'combined textures'.

    The bad news is that If you are displaying multiple alphas overlapping each other in the viewport, it wont sort them properly no. Its a weakness that you learn to work around Im afraid.
  • Conor
    Offline / Send Message
    Conor polycounter lvl 18
    Thanks Daz - I tried switching the hardware shading properties from color to transparency and to combined and it doesn't appear to have any effect. Surely there are people who use Maya for games and need to display transparency in the viewport correctly? I can't believe a major 3D app can't sort alpha polygons and nobody's ever complained about it.
  • SouL
    Offline / Send Message
    SouL polycounter lvl 18
    It depends on what version of Maya you're using. In 4.5 the alpha's should show up automatically if they're in a 32-bit TGA. In 5.0 (and above, I think) you have to connect your texture to the transparency channel. Just drag/drop and you should be set to go.

    Transparency sorting has improved a bit in the later version... but you have to be careful how you set it up. You'll get the best results if you seperate each group of polies into their own PolySurface node.

    So let's say you have 3 plane strips for hair. Seperate each piece into their own nodes and they should render much better. For some reason the transparency crashes on itself if everything is one piece.
    If you want to select each piece quickly... simply group them.

    Also... if they're showing inside out, simply flip the face normals. This sometimes happens on instanced/duplicated geo that have a -1 scale value for X.
  • Conor
    Offline / Send Message
    Conor polycounter lvl 18
    Sorry, I should have mentioned that this Maya 6. Here's what the scene looks like with all the normals flipped...

    transparency_example2.jpg

    I can't think of an easy way to divide up a sphere into seperate parts so that it will sort correctly from all angles. Realistically, I shouldn't have to - a tool for creating game art content should show your art in the viewport correctly without having to 'work around' the quirks in the program. This is very disappointing - even Alias haven't responded with a decent answer to this.
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Hang on a sec here. Maybe Im not clear on what youre wanting to do. So both of these objects have alpha channels. Youre wanting to just display them both using the alpha even somewhat normally and its not even close? Or theres just a bit of alpha flickering going on?

    Youre not on an ATI card are you? Can you send me the files or is it work stuff?
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Well, no need to send me the files for something so simple I guess. Well, this alpha sorts perfectly fine for me. No flicker. Two objects with alpha overlapping each other in the viweport. Is that all youre trying to do? Or have I misunderstood?

    conor.jpg
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Have you got shading>shade options>transparency shading ticked in the viewport?
  • Conor
    Offline / Send Message
    Conor polycounter lvl 18
    Daz - thanks for the tips, I tried it again and this time it automatically wired the transparency as well as the color when I loaded the image into hypershade - and when I applied it I got exactly the same result as you have above - which is good! I don't know what went wrong the first time, but it seems like if you wire in the transparency afterwards it doesn't work right.
  • Conor
    Offline / Send Message
    Conor polycounter lvl 18
    Well we got a response from Alias's QA department wich wasn't very promising...

    [ QUOTE ]

    I got the following answer from our dev. But currently there is no clear solution for this.
    "Only suggestion for this is to put the transparent part in a separate texture since this is the only part
    that seems to require transparency."

    Sorry about that.
    -Girish

    [/ QUOTE ]

    How can anyone seriously use Maya as a game development environment when it can't sort transparent polygons?
  • Scott Ruggels
    Offline / Send Message
    Scott Ruggels polycounter lvl 18
    Easy, we export to the game engine to test Transparency.

    Scott
  • Conor
    Offline / Send Message
    Conor polycounter lvl 18
    Well that's all well and good if your game engine works, but with most projects I work on the art is way ahead of the engine until near the end of the project. Besides, when you're texturing your model you have to be able to view that texture in your 3D app for quick feedback. I'm surprised that such a fundamental feature has been overlooked by Maya developers (and users) for so long.
  • Steve Schulze
    Offline / Send Message
    Steve Schulze polycounter lvl 18
    Well theres something for the Max crew to crow about. They may have an unwieldy animation system, a complicated programming language and an intrerface that usually only caters to do things one way instead of a dozen, but at least the goddamn alpha sorting works.
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Ok now I am confused. Conor, I thought you achieved what you wanted to? Or no?

    The alpha sorting is crappy with many layers. With a scene like this its fine. Mayas roots are in film. Not much cause for the use of tons of alpha there. Maya has alot of catching up to do for functionality geared toward games, its a relatively new thing that its use is so widepread in games. Its a weakness I know.
    JB: Stop turning every oppurtunity you find into a software war. The more unconstructive bashing of their chosen tool ( often not chosen by them ) folks see, the less theyre going to be inclined to help out.
  • Steve Schulze
    Offline / Send Message
    Steve Schulze polycounter lvl 18
    Ah yeah, sorry about that. I had meant to write more in that post, but I got called away for a meeting and just posted what I had... its rather harsher than I intended. The fact that I ran into the same problem this morning left me as frustrated as my esteemed colleague Conor here.

    I am really trying to like Maya. Theres a lot of it which is pretty nice. Just every time I think I'm enjoying it, something like this pops up.

  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Im not saying 'ooh dont say mean things about my 3D app! ' heh. Maya definitely is far from perfect and heck bring up the issues as you see fit. Im just sayin' you'll find people more inclined to help If its done a bit more constructively.
  • Snowfly
    Offline / Send Message
    Snowfly polycounter lvl 18
    somewhat connected to this topic, is it standard practice to assign transparent objects their own texture?
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    you mean for a game engine? If so, it kind of depends on the engine. For the last game I worked on, we did, because the alpha would remove some bit depth from the texture and produce banding.
  • Steve Schulze
    Offline / Send Message
    Steve Schulze polycounter lvl 18
    Hm, so let me just clarify... we'd be better to use a seperate black and white alpha map than a combined colour and alpha targa, correct?
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Thats what I do for pre-rendered work yes. I dont embed the alpha. I paint the transparency map as its own black and white tga. For game engine stuff I suspect that for the most part you would want to embed the alpha ( assuming your engine supports 32 bit targas ) . However, I put areas of a character that use alpha ( e.g eyelash ) onto a seperate, smaller map, not the character main map, so's not to take any colour out of the .tga If that makes sense.
  • FatAssasin
    Offline / Send Message
    FatAssasin polycounter lvl 18
    I've never worked at a game developer that used a seperate file for the alpha, it's alway a 32-bit tga. But I wouldn't be surprised if there's a company somewhere that does. It just doesn't seem very effecient for the artist or the engine.

    For prerendered stuff, I use layered psd files and have the bump, spec, diffuse, and whatever else each on their own layer. Then you specify which layer to use from within Maya (or Max).
  • Scott Ruggels
    Offline / Send Message
    Scott Ruggels polycounter lvl 18
    Gamebryo uses separate Alphas, because, the Alphas can animate (All the textures can Animate). Gamebryo also uses 24 bit Specularity masks. So you can get some nice looking glass if you work at it. but the problem of 1 shader per material is being addressed, for the Next Rev.

    Scott
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    On the game I am currently working on we save 32bit .tga with alpha channel included these get converted to 8bit colour in the pipe, or 4bit if you want. I'm an environment artist though not a character artist so I could imagine the process would be quite different depending on your render engine and what pipe makes sense for you. I agree the alpha sorting in Maya is ghetto but it doesn't look like it will ever get fixed so I gave up caring about it, most game engines don't even self sort objects with alpha on them. The only way I have seen it in a game working correctly is if there is some flag that tells the object to be drawn before every thing else and will only be seen from one camera direction, or if your pipe supports it you can use 1bit alphas which are great and will self sort and sort with other objects perfectly.
  • Steve Schulze
    Offline / Send Message
    Steve Schulze polycounter lvl 18
    It seems like such an obvious thing though, its bizarre that that it even made it into the final release...
  • Snowfly
    Offline / Send Message
    Snowfly polycounter lvl 18
    I remember my first human model in Maya 4.5, a likeness of the actress Zhao Wei. Workflow was great, modeling, UV, skeleton setup, skinning.. everything felt slicker than my previous modeling package.

    Imagine my shock when I got to texturing her hair.... Gaahhhh.... it looked like somebody bashed her skull in and turned her head inside out.
  • Darksun
    Offline / Send Message
    Darksun polycounter lvl 18
    Yeah, I have to say this is pretty silly. Alpha sorting should be considered a baseline rendering issue. It should be on the same level of "can I see a texture". There are WAY too many uses for alpha channels in game modeling & design for it to be considered a "work around" issue. I'm shocked really.
Sign In or Register to comment.