Transparency

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Reiyn
Posts: 23
Joined: Sat Mar 05, 2005 7:51 pm
Location: Canada

Post by Reiyn »

Niko seems to have altered the way EMT_TRANSPARENT_ALPHA_CHANNEL works to be basically the same as EMT_TRANSPARENT_ALPHA_CHANNEL_REF except with the addition of being able to alter the threshold value..

This is a quick bandaid fix to a bug spawned in version 11 =/ (Which I've made a post about on the BUGS forum)

Even if you do move the threshold back to where it should be to achieve the ACTUAL blending result... There is still a ZBUFFER bug, where your alpha'd objects will overlap and occlude eachother in aweful ways... Making for a real ugly result. =/ So really nothing was fixed?

There are some huge bugs with transparency and the only attempted fix so far is to force a _REF style of 1 or 0 transparency instead of fixing the actual blending operations under directX....

/sigh =(

So basically, I am in the same boat as you, and I don't know any way for us to fix it. (And evidently no one else seems to have a solution either) Transparency is sorta' an integral thing =(
Reiyn
Creating "Chimera", an Online RPG
DAoC - Guinevere - Druid rr11
WoW - Gorgonnash - Druid 55
DaMathew
Posts: 9
Joined: Sun Jul 10, 2005 2:25 pm

Post by DaMathew »

Hmmm.... so thank you all for your answers! Looks like we'll have to wait until 0.13 is released ;D But i'll take a look at the EMT_TRANSPARENT_ALPHA_CHANNEL code, maybe i'll find the problem...
Andi|xng
Posts: 83
Joined: Thu Mar 24, 2005 10:49 pm
Location: Schrobenhausen, Germany
Contact:

Post by Andi|xng »

I have exactly the same problem, with both DirectX and OpenGL.
The docs say, that EMT_TRANSPARENT_ALPHA_CHANNEL only draws pixel with alpha > 127 - and this seems to be the case. The problem is, that (at least in my case) changing the MaterialTypeParam does not help anything.
Andi|xng
Posts: 83
Joined: Thu Mar 24, 2005 10:49 pm
Location: Schrobenhausen, Germany
Contact:

Post by Andi|xng »

I have no z-buffer problem... I tried it with only one mesh in the scene manager, a decal with a transparent-to-black gradient on it, drawn on a white background (so there is no need for a z-buffer).
The result: Only pixels with alpha > 127 are drawn, no matter what the value of MaterialTypeParam was (I tried everything... 0f, 0.1f, 0.5f, 0.9f, 1f, 100f, 254f...).
This happens in both DirectX and OpenGL mode.
ilbuzzo
Posts: 71
Joined: Sat Mar 05, 2005 4:00 pm
Location: Italy

Post by ilbuzzo »

Hi guys,
I've had this trouble myself in my DeleD level Preview but I solved using 0.01f value reference, cause if you use 0.0f engine will automatically use 127 as reference (0.5f it's documented in help guide). Note that you must force texture loading in 32 bit to correctly load a tga texture file (or in general an alpha mapped texture).
If you use 0.1f just pixels > 25 will be drawn and so on....Now I think you've understood why values used are not so good ;).
Anyway I suggest to try values between 0.003f and 0.01f to have your desired results.
If you can't believe me, give a look to DeleD DMF loader forum thread.
Give a look to:
Image
I did it with 0.01f ref value with my DeleD Preview plugin.
Bye all guys
Andi|xng
Posts: 83
Joined: Thu Mar 24, 2005 10:49 pm
Location: Schrobenhausen, Germany
Contact:

Post by Andi|xng »

Of course I also tried these values. But the result is still the same. But thanks for your answer anyway! Perhaps you can send me your test application? Then I can see if it is a problem of my video drivers or of my code? andi@xenoage.com - That would be great :)
ilbuzzo
Posts: 71
Joined: Sat Mar 05, 2005 4:00 pm
Location: Italy

Post by ilbuzzo »

Hi Andy,
You can download my application from DeleD's main site, but you need to download DeleD too.
So go to http://www.delgine.com and download DeleD lite (it's freeware) then download DeleD Level Preview Plugin in plugins section (freeware too), create a scene just like mine (a rectangle at base, and two crossed rects with tga texture) (remember to choose alpha blending in DeleD material settings) then use my plugin and you'll see an alpha blended crossed rectangle with a 0.01f ref value.
If you have troubles (I'm not so sure you can see tga textures in DeleD's lite, but if it can save in memory my plugin will load anyway) let me know or send me your texture and how you want it to be shown and I'll make some tries.
Bye ;).
Post Reply