View unanswered posts | View active topics It is currently Wed Oct 20, 2021 8:21 pm



Reply to topic  [ 4 posts ] 
 alpha transparency... ? 
Author Message

Joined: Sat Mar 27, 2010 1:42 pm
Posts: 2
Post alpha transparency... ?
Hi,

would it be possible to add simple transparency to GLC Player ?

My models use PNG textures with (sometimes) alpha transparency, but GLC Player displays them as fully opaque textures. It's a pity because otherwise, I think this software is by far the best free Collada viewer available. :)

[edit]

Oops, I didn't see this "Feature Requests" was in the GLC lib board, not the GLC player board... Sorry. ^^;


Sat Mar 27, 2010 1:45 pm
Profile
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post Re: alpha transparency... ?
Thanks Pezito
Pezito wrote:
Hi,
would it be possible to add simple transparency to GLC Player ?

It's possible but with a limitation. I haven't find a solution to determine if a QImage has transparency. Or perhaps, there something I miss in the COLLADA material definition.
I will look at this limitation.
But theres is a work around :
Image
Pezito wrote:
Oops, I didn't see this "Feature Requests" was in the GLC lib board, not the GLC player board... Sorry. ^^;

It's the right place, the limitation come from GLC_lib.


Sun Mar 28, 2010 11:28 am
Profile

Joined: Sat Mar 27, 2010 1:42 pm
Posts: 2
Post Re: alpha transparency... ?
Hehe, I've been using this plane model as a reference to check the features of GLC (because my models could miss something). That's how I saw the tranparency problem wasn't specific to my models. :)

I've found the same workaround as you described, by editing the material and slightly moving the transparency cursor. It would be fine to me, but there still is a problem (maybe only on my side ?)... It seems it breaks normals or Z-sorting badly. On your plane it works fine, because the transparent object (propeller) isn't the same as the opaque object (plane body). But my models, because they use a single texture with alpha channel, have opaque and transparent parts in the same object. So when I try the workaround and turn transparency on, polygones seem to randomly reverse normals or be Z-sorted the wrong way (see attached picture).

As for detecting when a texture uses an alpha channel, maybe you check for the presence of the "A_ONE" parameter ?

I've read about the various transparency modes allowed in Collada files which are - correct me if I'm wrong - A_ONE, A_ZERO, RGB_ONE and RGB_ZERO. For instance, in my model :

Code:
<transparent opaque="A_ONE">
   <color>0.000000 0.000000 0.000000 1.000000</color>
</transparent>


You can assume that any model using the "A_" argument has an alpha channel, otherwise it would be using the "RGB_" argument, right ?

Either this, or people could be using a <texture> tag like this :

Code:
<transparent opaque="A_ONE">
   <texture texture="Material_1-image-sampler" texcoord="" />
</transparent>


I saw that somewhere on the web, someone used it as a workaround to make sure alpha transparency was detected and used properly.

Anyway, I hope this helps... :)


Attachments:
Clipboard02.jpg
Clipboard02.jpg [ 120.73 KiB | Viewed 10512 times ]
Mon Mar 29, 2010 8:33 am
Profile
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post Re: alpha transparency... ?
Hi,
Pezito wrote:
Anyway, I hope this helps...

Thanks for the tips. I will looking at this for the next release.
But, to render transparent objects with accuracy is complex.
GLC_lib use Alpha Blending to render semi-transparent object. The scene is render in 2 pass :
    1: Non transparent objects
    2: Semi-transparent objects

When semi-transparent objects are render, Z buffer is "read only". But to get an accurate render, the object as to be sorted in z component relative to the camera. GLC_lib don't do that.
And, it's not enough because object can inter-penetrate... :cry:

So perhaps I will handle the simple Z sorting for the next release. But for the inter-penetrate objects.... I don't know.

;) Your model is Very Cool !
@+


Mon Mar 29, 2010 7:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.