|
Re: Z-Order problems
[Re: PHeMoX]
#75362
07/24/06 07:15
07/24/06 07:15
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
apparently you can fix the sorting errors of individual polygons on a model by creating them in the right order. since they aren't sorted, they are just rendered in the order in which they are saved to the file (if that makes sense). so, polygons created last will always appear ontop, and those created first will always appear underneath. i guess it could be possible to create the whole model as normal, and then cut-paste polygons that need to be re-sorted. this could be tedious, but most of the time you would be doing them in groups. i don't actually know if this will work, but i don't see why not.
julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Z-Order problems
[Re: jcl]
#75364
07/25/06 09:17
07/25/06 09:17
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
but would us cut-pasting polygons in the correct order work?
julz
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Z-Order problems
[Re: jcl]
#75365
08/03/06 16:24
08/03/06 16:24
|
Joined: Jul 2005
Posts: 366
eleroux
Senior Member
|
Senior Member
Joined: Jul 2005
Posts: 366
|
Quote:
Not really. But I've added some more information to the FAQ explanation, which should clear up the issue a little:
Q. I have problems with the sorting of transparent entities or alpha channel textures. For instance, I'm trying to make a tree by crossing two sprite like a 'X. When using 32 bit TGA sprites, the first sprite is always drawn before the second sprite. This doesn't happen when I use PCX or BMP or 24 bit TGA sprites.
A. Transparent entities - meaning entities with TRANSPARENT flag or with an alpha channel texture - can not write into the z buffer. Thus the engine sorts them according to the distances of their origins. Neverteless, transparency causes visible errors when objects intersect or when a concave mesh consists of transparent polygons. You just have to think a little to avoid those mistakes. For instance, make your 'X' from 4 connected sprites rather than 2 intersectings sprites, and separate a transparent mesh into convex parts.
Hope this helps.
Yes, this helps a lot.
But, when you said 'not really', do you mean I got things completely wrong? does the z-enabling material code solve the z-sorting issue or not?
I'm working on some tutorials right now and I'd appreciate if you point me to what parts I got wrong on this, really.
Thanks!
Emilio
|
|
|
Re: Z-Order problems
[Re: eleroux]
#75368
08/04/06 04:37
08/04/06 04:37
|
Joined: Mar 2003
Posts: 4,427 Japan
A.Russell
Expert
|
Expert
Joined: Mar 2003
Posts: 4,427
Japan
|
Eleroux, I wish the article was still around, but is demonstrated with screen shots how it worked. Anyway, for anyone interested, I found a solution to sorting problems on entities with alpha transparency texture in the improved overlay shader (thanks to MK_1): 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; }
|
|
|
|