Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Strange Graphic Glitch with Texture Alpha Channel  (Read 6549 times)

0 Members and 1 Guest are viewing this topic.

Eshaktaar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Strange Graphic Glitch with Texture Alpha Channel
« on: March 25, 2008, 07:20:08 PM »

Here's something rather puzzling: I've got a low-poly character whose hair makes use of the texture's alpha channel. The problem is that the transparency seems to be bugged on one side of the character:


Looking okay. Don't mind the floating strands of hair, I pulled them out for testing.


On this side, the transparency only works with fully transparent parts (i.e. black pixels in the alpha channel) of the texture.


As you can see, the glitch is only on one side.

At first I thought it had something to do with the polygons being mirrored, put by pulling out strands and simply rotating them by 180° I could make the glitch appear/disappear (as you can see with the hair above the character's head), and it didn't matter on what side (left or right of the character's symmetry axis) the polys were (the floating hair in the second image is behind the character, on his right side where all the "good" hair is).

I suspect it's got something to do with the polygons' normals. All the hair polygons on the left side of the character's head have normals which point to the left, and those are the ones affected. I made a small example 3d actor to test this, which you can download here: AlphaTest.zip
Just copy the zip's content into the actors folder of one of your projects and look at the preview. The actor consists of two pairs of quadratic planes which got a texture with alpha channel on them. One pair faces forwards, the other one backwards. One of the pairs shows the same glitch, at least on my machine:



I could reproduce the glitch on two computers (one with an ATI and one with a GeForce card), so I guess it's not a problem with my PC. I tried both TGAs and PNGs, with no difference. I'm using 3ds Max with the Panda DX exporter, by the way. Can anybody else reproduce this?
« Last Edit: March 25, 2008, 07:23:21 PM by Eshaktaar »
Logged

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 350
    • View Profile
    • Jyujinkai's WME Development Blog
Re: Strange Graphic Glitch with Texture Alpha Channel
« Reply #1 on: March 25, 2008, 08:34:48 PM »

you should nvr mirror anything in 3D is makes all sorts of problems. Load up your file and make sure the normals is all working as you expect. Then before export to wme reset the tranforms of the mirrored stuff. So you have 0,0,0 on all transforms and all vertexes have no position information .. remember everytig is stored if you mirror something you are in fact gatting a real mirror. as in the vertex order is reversed, normal are flipped.. etc etc.

Most 3D apps now have advanced mirroring functions to avoid thse problems. Like the Symmetry modifier or the mirror modifier in Max. Still even in these cases you will need to collpace everything to a zeroed out mesh.
Logged
<Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
<Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

Eshaktaar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: Strange Graphic Glitch with Texture Alpha Channel
« Reply #2 on: March 25, 2008, 08:53:15 PM »

I also thought it was the mirroring at first, but just pulling out correct hair polys and turning them by 180° makes the glitch appear. The character is already one editable poly (meaning the hair strands aren't separate objects) in 3ds Max and I reset all transformations via Reset XForm.

In the zip file is an example where I just created two planes, then copied and turned them by 180°.
Logged

Eshaktaar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: Strange Graphic Glitch with Texture Alpha Channel
« Reply #3 on: March 28, 2008, 08:19:04 PM »

So... am I the only one having this problem? Did anyone successfully create/import a character with hair planes without getting these glitches? Does the 3d actor from AlphaTest.zip look all right on someone's system?

I'm asking because I'm at a point where I have to decide how to model my 3d character's hair, and I'd rather not rely on sculpted polys.
Logged

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: Strange Graphic Glitch with Texture Alpha Channel
« Reply #4 on: March 28, 2008, 09:14:32 PM »

i have the same problem with my chars.
i am using stencil shadows .. maybe its because of shadow casting.....

Eshaktaar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: Strange Graphic Glitch with Texture Alpha Channel
« Reply #5 on: March 28, 2008, 09:37:44 PM »

Thanks for the reply! I was getting the feeling I was imagining things. ::slug
The screenshots above were made with stencil shadows disabled. I did notice some additional oddities when they were enabled, though (like shadows appearing on the planes).

I know alpha textures are a fiddly topic, as almost any engine has its own problems with rendering them.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5677
    • View Profile
    • Dead:Code Site
Re: Strange Graphic Glitch with Texture Alpha Channel
« Reply #6 on: April 05, 2008, 05:07:28 PM »

I know alpha textures are a fiddly topic, as almost any engine has its own problems with rendering them.
Yes, because unfortunately this seems to be a generic problem with no good solution... The issue isn't caused by normals, but by z-buffer. Basically the polygons painted first will "win". Now depending on how your actor is rotated, either the right transparent polygons win (are painted earlier) or they don't. Sadly, I can't offer you a workaround other than "don't use layered semi-transparent polygons".
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Eshaktaar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: Strange Graphic Glitch with Texture Alpha Channel
« Reply #7 on: April 05, 2008, 10:33:38 PM »

Thanks for your reply. To stay on the safe side I made the character without "alpha hair", so it's okay.
Logged
 

Page created in 0.209 seconds with 22 queries.