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 Discussion / Drawing order

Author
Message
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 18th Apr 2003 11:57 Edited at: 18th Apr 2003 11:59
I know it's possible to draw an object so that it always appears infront of other objects. Is it possible to draw objects to always be behind without using multiple cameras? Think Unreal-style skyboxes: An entire scene composed of objects and such is being rendered behind the level, not just a static skybox.

Also, I can't recall how to correctly send an object to front. Something like disable z depth? And if there are multiple objects with this property, which of these would be drawn to front?
Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 18th Apr 2003 20:04
I don't play many 1ps's so I can't tell what you mean by unreal style skyboxes. But this is the command:

disable object zdepth [object]

As far as the rest goes, try it and see

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 18th Apr 2003 21:08
Ok I tried it. As I had hoped, disabling zdepth moves all objects with this flag to post-rendering - from here, normal rules about depth and polygon clipping apply. So essentially, there are 2 3d draw routines. Now if only I could create a 3rd: pre-rendering. This would be optimal for skyboxes or skybox scenes (like mentioned about Unreal).

So currently I'm debating whether to use disable object zdepth on all the objects except the background scene, or only disabling on the 3d hud. Is there some sort of compromise anywhere?
Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 18th Apr 2003 22:57
Well there's 'lock object on' which locks objects to the screen for your hud, so camera movement doesn't influence their position anymore. That leaves you disable zdepth for anything you always want infront, and the rest is there normally. finally you have the backdrop to play with, and between all those things there's not much you couldn't do given a bit of imagination.

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 19th Apr 2003 00:12
Unfortunately, though I like it, my hud is dynamic. It simulates the inside of a space ship/car and jerks around a bit depending on your acceleration and such. Guess I'll have to resize the background and move everything backwards by a lot.
Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 19th Apr 2003 00:46
Test it, I'm not sure but I don't think there's any reason why it couldn't still do that locked to the screen

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 19th Apr 2003 03:13
Hmm, lock object on doesn't have anything to do with disabling the z-depth, does it? Because regardless of whether the hud is locked to the camera or not, I believe that if you run into a wall (especially one that has no camera clipping), the wall can cut infront of the hud.
Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 19th Apr 2003 03:35
Is that what happened when you tested it? that's strange... why not disable the zdepth first then lock it.
I'm guessing that your hud had quite a long z axis.

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 19th Apr 2003 03:51
Actually no, it is quite small and near the camera. Do you remember my SkyCars demo? When you fall through the floor into the great spacey void, and you have forward velocity, it's possible for the camera to cut through one of the blocks ahead of you in efforts to follow the car.

Same would apply for any circumstance of the type. IE: consider a tree with noclipped branches. When you walk through, there will be a point where the tree branches (plain) will be closer to the camera than the hud.

Oh, disabling the zdepth first would defeat the purpose, since I need to disable the zdepth on the level in order to always be infront of the backdrop scene.

I haven't actually tried it yet, so I'll go modify my code and do that now.
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 19th Apr 2003 04:13 Edited at: 19th Apr 2003 04:35
Hmm, that was unexpected. I locked the background objects and it automatically disabled their z-depth**. So this means that I should, I think, do this:

Background is treated normal.
Player and level objects get disabled z-depth.
Hud gets locked on.

This may or may not fix the problem with polygons passing infront of the hud, but if it doesn't, it's a small loss. Or maybe I should just modify the depth of the background objects so that they'll never interfere with the level objects. Hmm, tough choice.

**EDIT: Well, I talked to Rich, and I guess this isn't supposed to happen. Strange how this project is creating so many unexpected oddities for me.
Danmatsuma
22
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 19th Apr 2003 05:05
Every project does i reckon
Always something new to work out.
I tend to cheat - a LOT

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.

Login to post a reply

Server time is: 2025-05-16 15:17:45
Your offset time is: 2025-05-16 15:17:45