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 / Multiple Backdrops

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd Jan 2009 21:14
Hello!

As you all may know, the "Set camera range" command will set the range to where the objects stop drawing, well, is there a way to set multiple of these backdrops? Like, I want my questionmark objects to draw only in a range of 50, where I want the level to draw in a range of 400.

Is this possible?

TheComet

Peachy, and the Chaos of the Gems

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Jan 2009 00:15 Edited at: 3rd Jan 2009 00:55
Check the distance from the camera and only draw those object that you have in a set range. Use the fast form of the distance formula to calculate:



Enjoy your day.
jason p sage
19
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 00:39
Where does this "fast_dist_calc" function come from?

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Jan 2009 01:04
oops!



Enjoy your day.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Jan 2009 14:38
Another question: Isn`t it faster to check box-wise than sphere-wise?



Also note that checking if the object is hidden takes longer to perform than actually hiding it, same with checking if it is in screen.

Tell me if I`m wrong, though...

TheComet

Peachy, and the Chaos of the Gems

jason p sage
19
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2009 15:51
Usually faster to check a sphere... next a cube with equal sizes in all direction, then a box is usually last... but it really depends on how the code does the checking.

In frustrum culling, you "prepare" by making all objects fall into one of those categories... Sphere, cube, box. You are only concerned with the dimensions that surround the object.

The frustrum is what camera sees... and you test if object "bounding areas" (box, cube, sphere) are in frustrum - if so - EXCLUDE OFF (if instances - just show) if not in frustrum - exclude on (instances just hide).

For the distance from the camera for LOD - this technique Latch gave ideas on is decent.

The latest newletter has Lee explaining how to make LOD even smoother fading from one detail level to the next.

--Jason

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Jan 2009 04:26
Quote: "Also note that checking if the object is hidden takes longer to perform than actually hiding it, same with checking if it is in screen."

I don't know about the checking if it's hidden versus hiding it. I never did any benchmarks.

If the objects aren't in screen and are showing, you're just wasting processing time displaying objects that are out of view. The trade off is the check if they're in screen, versus always being displayed if they are not in view. For a plain or two you can leave them visible even behind the camera and it won't matter much. A tree, the polygons will probably take more processing power than the in screen check. Run some tests. Find out what works best.

If you are displaying things like a question mark or an indicator of an action, you could use a 2d image and paste it at the item's screen location when the camera is within range. For this, you'd most likely want an in screen check or your 2d image would show up on screen even if the object was behind the camera.

The news letter also mentions stacking objects. Kevin Picone had an excellent example from some years back of storing all of the usable objects in arrays and managing their display with that. You could really manage what you are trying to accomplish and squeeze out some good performance by implementing some of these techniques.

Enjoy your day.
Bluestar4
20
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 15th Jan 2009 13:27
Quote: "want my questionmark objects to draw only in a range of 50, where I want the level to draw in a range of 400"

this is an interesting problem. what have you decided to do comet ? range checking or have you come up with an alternate method?

bluestar4~
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Jan 2009 14:03
I will have to do range checking... I was hoping that you could set a second camera range, but that doesn't exist...

I have implemented most of it, and it runs at a good speed. I have been hearing something about this "LOD" in überEngine. It seems to lower the detail in distance and higher it near the camera. Is this anything for DBC?

TheComet

Peachy, and the Chaos of the Gems

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Jan 2009 14:37
LOD means level of detail. The farther away something is, the less detail you apply to it to speed up your game. For example, a tree up close may be a full 3d multi-poly object. But way off in the distance, it might just be a plane textured with a picture of the high poly tree so you waste less power rendering the things that can't be seen as well. Or maybe the entire background off in the distance is just a bitmap textured onto something low poly. As you get closer, you may swap in more detailed objects subtley, and swap out the less detailed objects. For DBC, you'd have to manage this yourself. You may have different models and pictures at various detail levels. Though DBC does have static occlusion. Objects behind static objects with occlusion enabled will not be rendered and thus should boost performance.

Enjoy your day.

Login to post a reply

Server time is: 2026-07-05 01:47:29
Your offset time is: 2026-07-05 01:47:29