Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Z-Order problems #75331
05/24/06 17:59
05/24/06 17:59
Joined: Apr 2006
Posts: 14
S
Sidarta Offline OP
Newbie
Sidarta  Offline OP
Newbie
S

Joined: Apr 2006
Posts: 14
I'm making a racing game and I'm having problems with Z-Order.
The track is formed by four models: one, the track itself; two, the high-speed turns; three and four, the guardrails. Their Z-Orders are for some reason wrong, so things are rendered in front or behind of them despite their spatial distribution.

Here are some examples:




Please, somebody help me!!

Re: Z-Order problems [Re: Sidarta] #75332
05/24/06 18:04
05/24/06 18:04
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
z sorting materials have been posted from time to time.

material zsort{
effect="
texture entSkin1;
technique zs{
pass p0{
texture[0]=<entSkin1>;
zenable=true;
zwriteenable=true;
alphablendenable=false;
}
}";
}

Re: Z-Order problems [Re: broozar] #75333
05/25/06 09:54
05/25/06 09:54
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Don't get confused by the previous post - not even I understand it - but here's what you do for avoiding z sorting problems:

- Make sure that you are using the recent engine version. Old versions had a 16 bit z buffer.

- Fix level design faults, like blocks or meshes that are extremely thin or intersect each other.

- Adjust the view clip_near and decrease the clip_far parameter until the requirements of your level is met.

In internet game design forums you might find more advices about proper level design that does not produce z sorting problems.

Re: Z-Order problems [Re: jcl] #75334
05/25/06 09:58
05/25/06 09:58
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Also, avoid textures with alpha channel or transparency as this often causes Z-sorting problems. However, with a simple material, this part can be worked around.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Z-Order problems [Re: ulillillia] #75335
06/14/06 15:12
06/14/06 15:12
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
Is this the same problem? I'm using A6.40.5 Extra. I've got these treetops which are box-shaped MDL's, with a TGA skin of leaves. I also tried it with alpha-channeled DDS (dxt3 and 5) and the same thing happens.

The leaves are somehow being cut out, wherever the silhouette of the objects inthe background are. They do not intersect, and the background geometry is actually pretty far away. These aren't sprites, they're models with alpha channels.

Here you can see what the treetop cube should look like (the problem isn't too visible here):



Now here you can see the same treetop cube with the problem significantly more visible.



You can also see how the leaves are visible directly in front of the tree (it looks like they are painted on the tree), but obscured by the far-away MDL terrain geometry behind it.

This has me stumped (hah little tree joke there). Does anyone know how I could remedy this? I hope there's a way, because the "avoid textures with alpha channel" solution is a non-solution.

I'm using 6.40.5 Extra.
yours,

Re: Z-Order problems [Re: JetpackMonkey] #75336
06/14/06 15:26
06/14/06 15:26
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
Your screenshots aren't showing for some reason (it could be my somewhat unstable internet connection).

Edit: never mind - I had to view the page sounce and click the "retry" button about 5 times just to view the screenshots saying it couldn't find the server....

Just wondering, have you tried making a wall as a model and putting a transparent object behind the wall to see if it renders? This is the simplest of test levels one could make....

Last edited by ulillillia; 06/14/06 15:28.

"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Z-Order problems [Re: ulillillia] #75337
06/14/06 15:38
06/14/06 15:38
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
Hi Ulillillia,

>Just wondering, have you tried making a wall as a model and putting a >transparent object behind the wall to see if it renders? This is the simplest >of test levels one could make....

Hm, I haven't tried that, but I'm pretty sure putting it behind a wall would correctly the whole object.

It's the silhouette of the stuff behind the alpha-channelized model that's cropping out the image.

Re: Z-Order problems [Re: JetpackMonkey] #75338
06/14/06 15:49
06/14/06 15:49
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
is the object in the background transparent too?

transparent objects can't use the z-buffer (it's described in the faq forum).

Re: Z-Order problems [Re: ventilator] #75339
06/14/06 16:14
06/14/06 16:14
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Yes, that's what I'd also suspect.

If you have several transparent entities, the origin distance will determine which will be rendered first. Your image looks as if the origin of the blue object is closer to the camera.

See Manual -> entities -> transparency. There are several solutions to that problem.

Re: Z-Order problems [Re: jcl] #75340
06/14/06 20:01
06/14/06 20:01
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
Hi guys thanks for all your suggestions.

Let's see, here's the assessment:

1. The background object is not transparent-- it's a very large piece of MDL geometry. It's a 24 bit dds texture. I tried switching it to bmp but it didn't change this.

3. There aren't any other transparent objects behind this 'treetop' cube on which the texture is. All the other geometry has transparent = 0 and alpha = 100, and 24 bit textures only.

4. I tried changing the d3d_entsort to all three possible settings. It didn't change anything. This was per the manual's entity:transparent section. It mentions the same problem you describe re: intersecting transparent polygons, but in this case there is only this one polygon. But otherwise I didn't see any other solutions mentioned.

5. I tried using 32 bit DDS, and then 32 bit TGA on the 'treetop cube' to see if this would change things. No difference.

6. I tried adding a block skycube to see if that would help, but no difference.


Each image is of the same stuff, only from different angles. Here the order is from closest to furthest away: treetop, grassy hill thing, purple cube. The purple cube is quite far away.

I appreciate your insight on this!

Page 1 of 4 1 2 3 4

Moderated by  old_bill, Tobias 

Gamestudio download | 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