Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Depth Sort Correction #84320
08/03/06 04:03
08/03/06 04:03
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Does anyone have a shader that will effectively correct sorting errors for models with alpha channels?

Re: Depth Sort Correction [Re: A.Russell] #84321
08/03/06 07:08
08/03/06 07:08
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
Maybe if you create a gaphics card that supports it. This is just not possible...


Follow me on twitter
Re: Depth Sort Correction [Re: A.Russell] #84322
08/03/06 08:09
08/03/06 08:09
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
It's all in how you skin and UV map your model.

Ole Tobiesen Ford pickup model off Acknex Site with a few modifications.
Originaly the windshield and rest of the truck were seperate meshs, I merged them and reskinned the windshield. Now it's one mesh, with alpha channel skin ( 32 bit tga ) no sort issue, no flags or scripts set on the model either. This can be done time and again with models now ( with the changes done to MED) and not have a sorting issue. You should also beable to do so with other modelers that support multiple textures and they import/export properly to MDL7 ( i know it works fine with Milkshape)

The key is to Skin/UV map your model to differnt skins based on transparency need. Not mixing Semi-transparent and full Opacity in the same skin. So you have in the truck above TWO(2) skins. the full opaque skin for the main truck body, and a completly semi transparent skin for the windshield. then the truck polys are UV mapped to the coorisponding skins

Modified Ford truck model

Re: Depth Sort Correction [Re: Grimber] #84323
08/03/06 11:03
08/03/06 11:03
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
I took a look at the model, but I am not sure how that would work for the model in question. Here it is:



Currently it is all one mesh mapped onto a singe texture with alpha transparency.

Would it work if the centre stalk was mapped to an opaque texture, and the leaves all to the same texture with transparency, or what do you suggest?

With your truck the glass can have a uniform transparency, but with the leaves, the alpha is meant to mask the edges of the texture.





Last edited by A.Russell; 08/03/06 11:08.
Re: Depth Sort Correction [Re: A.Russell] #84324
08/03/06 11:35
08/03/06 11:35
Joined: Sep 2003
Posts: 4,959
US
G
Grimber Offline
Expert
Grimber  Offline
Expert
G

Joined: Sep 2003
Posts: 4,959
US
yes 100 opaque for the stock

for the leaves a seperate skin.

where what usualy goes wrong there is that black outline along the outside edge of the leaves you have typicaly ends up being anti-aliesed ( which with an alpha channel results in mixed 100% opaque and semi transparency gradient mix)

instead you need to go and redo the leaf edge to where it is sharply cut off
( 100% full opaque leaf image surrounded by 100% full transparent. Like you would have done for using the overlay flag full black without anti-alies edges)

OR you have to put a SMALL amount of transparency value into the ENTIRE leaf texture, so NONEof it is 100% opaque, but the leaf area is so minimumal in transparency you can't see it being transparent.

Re: Depth Sort Correction [Re: Grimber] #84325
08/03/06 15:40
08/03/06 15:40
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
You should try semi transparent skins. ventilator wrote a shader (also available as ffp) that works pretty good and should look good on your plant.


Follow me on twitter
Re: Depth Sort Correction [Re: mk_1] #84326
08/03/06 16:32
08/03/06 16:32
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Thanks Tony, I'll pass that on to the modeler.

MK_1: Do you know where can this shader be found?

Re: Depth Sort Correction [Re: A.Russell] #84327
08/03/06 18:26
08/03/06 18:26
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
wiki. It's some kind of improved overlay. Every pixel is rendered with or without full opaque depending on a treshold value you can set. You should at least use antialiasing 2x for the game then but it looks pretty good.


Follow me on twitter
Re: Depth Sort Correction [Re: mk_1] #84328
08/04/06 04:33
08/04/06 04:33
Joined: Mar 2003
Posts: 4,427
Japan
A
A.Russell Offline OP
Expert
A.Russell  Offline OP
Expert
A

Joined: Mar 2003
Posts: 4,427
Japan
Thanks MK_1, this shader from the wiki works:
Code:

material right_alpha_mat
{
effect =
"
technique right_alpha1
{
pass p0 {zWriteEnable=true; alphaTestEnable=true;}
}
";
}

action right_alpha_acc
{
my.material = right_alpha_mat;
my.dynamic = off;
}



The edges are a bit rough, but the sorting problems are gone without needing to redo the UVs and textures.


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1