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.

Code Snippets / Hiding objects that are not in view.

Author
Message
BiggAdd
Retired Moderator
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 18th Jul 2005 01:55
Here is some code to hide objects that the camera can't see.



Tell me what you think!


SSDD
Same Sh** Different Day
BiggAdd
Retired Moderator
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 18th Jul 2005 02:02
Aso you could do this:


Which looks as though its a torch.


SSDD
Same Sh** Different Day
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Jul 2005 03:42
So where your code is really about is this?



Immunity and Annihalation makes Immunihalation...
BiggAdd
Retired Moderator
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 18th Jul 2005 03:54
well yeh


SSDD
Same Sh** Different Day
Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 18th Jul 2005 04:38
whats the point, you wont see it anyway

Your signature has been erased by a mod because it's larger than 600x120...
BiggAdd
Retired Moderator
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 18th Jul 2005 10:49
i dunno.... i j ust made some random code.


SSDD
Same Sh** Different Day
TEH_CODERER
22
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 19th Jul 2005 02:32
If you are using highish poly objects or loads of objects (eg. trees) then it should cause a speed increase. It is the exact same piece of code I have been using for a while. Well, mine had indentation but that was the only difference!

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Jul 2005 19:46
I believe DBP has automatic fustrum culling

PETA - People for the Eating of Tasty Animals
TEH_CODERER
22
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 21st Jul 2005 04:30
Hey? Fustrum? I know it hides back faces of objects which are using 'set object cull' but I don't think it hides objects out of the screen.

Freddy 007
21
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 21st Jul 2005 06:40


That function hides object out of the screen too.

*** PANZERGAMES ***
BiggAdd
Retired Moderator
21
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 21st Jul 2005 12:29
I'll just try concentrate on 3D Design instead of coding.


SSDD
Same Sh** Different Day
TEH_CODERER
22
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 22nd Jul 2005 00:45
KLU 007 - All you did was stick it in a function?

X Trade
22
Years of Service
User Offline
Joined: 19th Feb 2004
Location: near bristol, UK
Posted: 29th Jul 2005 18:11
this is actually obselete, because dbp does actually hide objects which are off the screen....

i discovered this by making a small cube (0.01 size) and then making a sphere limb which was much larger... collision boundaries and other boundaries wern't updated at the time (duno if they are now either) when using 'add limb', and so when the centre of the object (where the cube was) went offscreen, the entire object dissapeared, even though technically the sphere should still be partly visible.

www.AoFP.co.uk
TEH_CODERER
22
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 29th Jul 2005 18:46
Ah. I had that as well which was annoying. It kept hiding an object so you could see it dissappearing at the side of the screen.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Aug 2005 20:54
An area that might be worth looking into is hiding limbs that are off screen - like precalculate a visibility grid. That way memblock terrains for example could be made from lots of limbs just like advanced terrain, except with the memblock benefits like alpha transparency. Texturing 1 limbed object should be better for performance than having several textured (smaller) objects.

Worth noting that the code would work in DBClassic and if I remember correctly it would increase performance.


Van-B

Put those fiery biscuits away!

Login to post a reply

Server time is: 2026-06-11 16:16:05
Your offset time is: 2026-06-11 16:16:05