Hi everyone, I hope this is not a dumb question.
Let's suppose I have a row of semitransparent walls and I'm looking through them. The further I look, the more opaque the walls appear. You all know this is the normal behaviour of semitransparent textures.
Then I export the scene for using it on my Nintendo DS. When I look through the walls, an annoying bug happens and it looks like the second wall is 100% opaque, having only the first wall correctly semitransparent.
I know this is quite usual, and obviusly I can't expect much from a DS, but I'm sure I haven't seen this issue in certain games. Is there a particular texture compresion I need to use to avoid this problem or it's only a matter of coding?
Thanks for the help!
Replies
Left: Alpha Sort.
Very hard to calculate, the more you stack the worse it gets.
What % of this pixel is transparent?
Wait there's another transparent texture... oh gawd... how much can you see? What is its relationship to the camera and other textures. Ok we can do this its only two. Lets figure out how much you can see at the deepest level then figure out how much of that you can see with the next.
Wait there's another.
Tiny DS brain exploding!
Right: Alpha Test.
Pretty simple test, is it transparent y/n?
There are ways to blur alpha test maps on the hardware to soften them up, but those methods are very hardware dependent.
CrazyButcher had a great post about this stuff about a year ago... can't seem to find it.
Poor DS! I already made some similar tests in the past, but what I tried to achieve wasn't edge smoothing (Alpha Test is enough for simple borders). I wanted to create a series of alligned white-yellow translucent planes and put them at the end of a dark tunnel, in order to simulate a fake blinding effect.
In MAX it worked wonderfully, in the DS obviusly it didn't... My face turned from to in a second, hehe... But I expected it in some way.
Maybe I can try to use a 100% opaque texture and then set the transparency for the object directly from code...
The NDS handles alpha maps very poorly. When I worked on a DS game just I avoided them at all costs. Go with alpha test textures instead, they work fine 99% of the time.
What about using a cone the camera flies through, instead of stacked planes? It would cover the walls in light and make it look like its getting brighter.
It was juggled with a mix of code and art, manually setting in what order to draw each bit. Bit of a pain to get right, and helped a lot by the fact it was sort of top down so there was always a "bottom" layer. But quite possible to do. Light a fire under a coder
@danr: There should be more games on the DS like GTA CW! It's technically excellent, and I remember that shadows were almost impeccable. Having them work correctly via coding it's quite difficult, and I'm sure that the coder of the Software House I'm working with is way too lazy to try that... -_-'
What do you mean, precisely? I'm not sure to understand well... What pixels should I turn transparent (100% transparent)?
This sounds like a great solution (man, I feel so stupid), but... It would only work for the walls of the tunnel. Look at this short video renders I posted on the Lowpoly thread: at 0:13 you can see exactly what I wanted to achieve.
[ame]http://www.metacafe.com/watch/4219943/nds_futuristic_racing_project_teaser/[/ame]
The effect is beautiful, because the more you drive closer to the exit, the more the light fades out. Unfortunately DS doesn't stand it...
Uhm, I just had an idea. What if I make a simple object that varies its opacity depending on how much you are close to it? Think about that tunnel in the video: when you are far, the fake light object it's 100% opaque (still having some transparent shades to cover the wall), then, approaching it, the object fades to be completely insivible. I think it's the best way to do it without juggling too much with the code!
For everyone willing to know, that project in the video were abandoned because no publishers were interested in it (I want to cry)... Hehe, I'm selling myself to the first one interested in making it... Seriously!
Anyway I'm asking for this transparency issue because it could be useful for later projects. You all are very helpful, thanks! :poly121:
Some info in the wiki.
http://wiki.polycount.net/Mip_Map