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 / Does DBPro draw only the polgons in the cameras view??

Author
Message
Cpt Caveman
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location: New Zealand
Posted: 17th Jun 2003 12:45
Or is there some code/command that tells it to only draw what is on screen. I think I saw some code somewhere that does do what I ask but it was a while ago and may have been for DB Classic only. Please help.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 17th Jun 2003 15:10
set object cull objectNumber,0

This command will tell DBPro not to render polygons facing away from the camera.



This code is the most primitive of all optimisation routines and will spead up most heavy 3D applications significantly.

Pneumatic Dryll
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 17th Jun 2003 23:48
DBPro uses the following occlusion methods:

1) Frustrum culling. Anything outside the six clip planes (near, far, top, right, left, bottom) are not drawn. Only when the whole object is outside of that though.

2) Backface culling, polys with normals pointing away from the camera are not drawn.

Patch 6 (maybe 5) will introduce node-trees / portals which splits the world into small segments (like a series of cubes), and only draws the visible ones.

Do you want Windows menus in your DBP apps? - Get my plugin: http://snow.prohosting.com/~clone99/downloads/tpc_menus_103.zip
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 18th Jun 2003 01:16
"Patch 6 (maybe 5) will introduce node-trees / portals which splits the world into small segments (like a series of cubes), and only draws the visible ones"

Sombody from db production team to answer this please
Will it???

Info Q.&statments corect@da time of going to pres. I acept 0 responsibility for typos gramaticaly incorect txt swering or pety complant tht u hve so just piss off unles u r anserin da Q.
OpticRealm
23
Years of Service
User Offline
Joined: 25th Apr 2003
Location:
Posted: 18th Jun 2003 10:31
that "set object cull objectNumber,0" slowed me down from 45fps to 31fps. haha weird eh?
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 18th Jun 2003 11:09
Frobscottle:


Yes, Mike (DBS) have already built an octree + portal solution to replace the static objects commands. They are due to appear in the public release in patch 5 or 6.

l8r,
Kevin Picone
[url]www.underwaredesign.com[/url]
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 18th Jun 2003 11:09 Edited at: 18th Jun 2003 11:14
@opticrealm
Well der! the flag at the end has to be set to one for it not to draw away facing polyogns

tut

you palounka

Info Q.&statments corect@da time of going to pres. I acept 0 responsibility for typos gramaticaly incorect txt swering or pety complant tht u hve so just piss off unles u r anserin da Q.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 18th Jun 2003 11:10
oh rite

cool

Info Q.&statments corect@da time of going to pres. I acept 0 responsibility for typos gramaticaly incorect txt swering or pety complant tht u hve so just piss off unles u r anserin da Q.
Oliver
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 18th Jun 2003 22:19


Was this a joke, it slowed down my game by 50 fps, no wonder, doing 65535 loops. And the objects dispear randomly! And all the object I had nicly hiden appear again!
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 18th Jun 2003 22:40
No it's a basic optimisation technique, I put it here as a demonstration. Of course you change the loop length to include only those objects you wish to hide

I use more game-specific techniques based upon this principle, I put it here to show the principle, not to be a magic wand

Pneumatic Dryll
OpticRealm
23
Years of Service
User Offline
Joined: 25th Apr 2003
Location:
Posted: 19th Jun 2003 01:33
you shoulda said it needed a 1

hahaha

i shall try again and post my results;

BRB
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 19th Jun 2003 11:08
i said you needed 1

Info Q.&statments corect@da time of going to pres. I acept 0 responsibility for typos gramaticaly incorect txt swering or pety complant tht u hve so just piss off unles u r anserin da Q.
drarem
23
Years of Service
User Offline
Joined: 26th Jun 2003
Location:
Posted: 26th Jun 2003 23:23
Make sure your objects are in numeric order.. this is pseudocode btw, I'm not yet DBPRO-esque..

means you maintain a visible array, to show whether one is or not visible, and have this triggered in your timer loop, so if 20 objects suddenly appear/disappear, you wont see any noticeable speedups/slowdowns..

Login to post a reply

Server time is: 2026-07-16 10:53:18
Your offset time is: 2026-07-16 10:53:18