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.

Dark GDK / Transparent textures?

Author
Message
Christian B
18
Years of Service
User Offline
Joined: 12th Jan 2006
Location: Montreal, Canada
Posted: 2nd Mar 2006 05:10
I'm having trouble with transparent textures. Here's a bit of code

Now there's one line that's commented out. I'll come back to it later.

cloudlayer.x contains a cloud layer that should be "over" the ground layer "groundplane.x". Both files are attached to this post. Now the cloud layer contains a semi-transparent texture. To create the feeling of high-altitude flight, the cloud plane will be between the camera and the ground. The character/plane/user controlled object will be above the clouds.

Now here's the problem. I don't see the ground through the cloud plane, what I see is a big blue blotch, which is the backdrop color. It's as though the render is ignoring the ground plane and using just blue as the transparent color (Z buffer related sorting problem?).

To test the theory you can uncomment the commented line in the code above. Then you will get exactly the result I'm looking for. Problem is, now if I render the aircraft/character, I won't be able to put it on top of the clouds as the clouds will now render last no matter what.

So, any clue to what's going on? Thanks in advance.

---
http://christianboutin.com

Attachments

Login to view attachments
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 2nd Mar 2006 12:28 Edited at: 2nd Mar 2006 12:30
Hello,

here is my answer (in form of commented source code.)


Altough I am not proficient in the z-buffer thingy, I think what I commented in there is correct. Hope it helps!

greets,
Barnski.

-- I just started with DarkSDK, by translating DBP Projects. --
Christian B
18
Years of Service
User Offline
Joined: 12th Jan 2006
Location: Montreal, Canada
Posted: 2nd Mar 2006 17:15
Thanks alot for a timely and accurate response. Unfortunately I'm afraid that if what you say is correct, and based on your corrected code it is, then about 17800 lines of code, the development of a level editor and streaming level format and the completion of a working prototype, my project will come to a screeching halt.

The way I stream object data as needed I cannot possibly forsee what object will be in front of what other object for all times. Also there will most likely be a time when a transparent object could pass in front of another and then behind it.

However I see something that gives me a tiny little bit of hope. I took my own code and replaced the loading of a .x object with dbMakeObjectCube, then I loaded the image and applied it to the cube and, even if the objects were created in the same order as before, the cube showed up correctly. It is as though object sorting is done better with primitives than with loaded objects. I will have to conduct further tests before I can prove that.

---
http://christianboutin.com
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 2nd Mar 2006 21:13
I don't know this for sure, and I also hope that I am wrong, so if u find out how to do it, then please post it ...

-- I just started with DarkSDK, by translating DBP Projects. --

Login to post a reply

Server time is: 2024-11-19 04:23:26
Your offset time is: 2024-11-19 04:23:26