Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Transparent object disappearing randomly

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Jun 2012 16:11
Hey everyone


Look at the green ring on selected units in this video:



I'm using a plain object textured with a PNG with an alpha channel. The plain is positioned at Unit(n).pos.x# , Unit(n).pos.y#+0.3 , Unit(n).pos.z# which is more than enough distance above the ground to prevent Z-fighting. For some reason though when I use set object transparency obj,2 the plain will randomly disappear. If I use set object transparency obj,0, it is always visible. Why?

TheComet

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 10th Jun 2012 16:20 Edited at: 10th Jun 2012 16:35
Are you sure that you ground is completely flat? The way it fades out is like it moves under the ground. Maybe Z clipping, but looks more like a mesh error. And it happens exactly in-line with the down dip, which could have caused the mesh to bend at that point. If you take height from the 4 legs, it does not account for bending in the mesh between the legs. If you take out Unit(n), and replace it with the circle's own check, that should fix it.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Jun 2012 16:43
Hi Pincho

It is 100% flat, and the unit is positioned at ground height, putting the plain 0.3 over the ground. The thing is, if I disable transparency, I don't get this weird glitch.

I even tried positioning the plain +2 over the ground (which is way over the unit's head up in the sky), and I still get the error!

TheComet

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 10th Jun 2012 17:02 Edited at: 10th Jun 2012 17:05
Are all of the normals facing the right way? Maybe the ring has flipped normals? Maybe some of the ground has flipped normals, and culling?

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Jun 2012 17:55 Edited at: 10th Jun 2012 17:56
Hi

I have no idea why the ring would dissapear like that with transparency set on mode 2. Is it the same with mode 1?

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Jun 2012 18:19
I don't know how, but that fixed it. I've always used transparency 2 to enable the alpha channel in images. Well I'm glad that weird glitch is over, thanks for pointing that out!

TheComet

Login to post a reply

Server time is: 2026-07-08 00:25:28
Your offset time is: 2026-07-08 00:25:28