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 / 100 seperate objects using SAME texture - how many times is the texture loaded?

Author
Message
Redmotion
23
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 25th Jul 2003 12:01
Say if I have 100 or even a 1000 separate objects all using the same texture map but mapped slightly differently (a large one maybe 512x512 at the smallest 1024x1024 would be better) and load them all in, does Dark Basic load the texture once or 100 times?

I'm using .x format objects and maybe a number of tga's or jpg's.

cheers,
J.
PROJECTS:
Cyberbowl (70% done)
Something a bit bigger(understatement of the year) st art/concept/design doc stage
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 25th Jul 2003 12:11
I would guess it loads it once, the slowdown tho is the loading of the different x file data objects that have different UV maps.

If you stored the image into one location then it will only be stored in one location but as for usage on the screen it would have to render each mesh and texture according to how much is on the screen.

One texture for a series of mesh data objects would reduce texture size when it somes to final project distribution size.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Jul 2003 13:02
If they're level objects, I suggest adding them as limbs to a dummy object, then texture the dummy object with the loaded texture.


Van-B

My cats breath smells of cat food.
Redmotion
23
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 25th Jul 2003 15:03
I suppose, in a way, they are level objects, but it is structured similarly to Vice city. But a 1000 reasonably detailed buildings displayed or loaded simultaneously will practically grind the game to a hault.

So I need (don't worry I'm not requesting code!! ) the nearest groups of buildings to be loaded and then replaced or "unloaded" in relation to your position. (is there a command to flush out individual objects - or can you load new objects into the memory position of old ones? - I'm not sure you can?)
Does this sound a reasonable approach? Any better ways?

I want to disguise the pop up obviously! But this will be the first bit of code to try to get this amount of data to run at constant and smooth speed. Then the detail can go in.

PROJECTS:
Cyberbowl (70% done)
Something a bit bigger(understatement of the year) st art/concept/design doc stage
UberTuba
23
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 25th Jul 2003 15:24
if itr was me id make the entire world in a mesh. then use the triangle command to render each visible polygon. for polygons far away like
at the top of buildings,id color them not teture them.

as for small but detailed objects like phone botths i would use a set number off them (say 5) and then get an array with all the phone
box positions and position those 5 boxes where the nearest ones stored in the array are. that goes for people and cars too.
And if u thing think that will cause a ghastly amount of popup.
Just remember thats the way gta3 did it(a little more sophisticated of course) and if you look closely youwill se cars popping up out of nowher in the distance

Life is a terminal disease.
You never survive it.
Hamish McHaggis
23
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 25th Jul 2003 15:27
Other than 'load object/texture object' and 'delete object', which will be slow as you said, you could use 'hide object' and 'show object'. That just means that they aren't rendered, but the memory of them isn't deleted.

cuRant PRogekt: a three-de map editer
Why the hell'd you ask me for crying out loud!?!
Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Hamish McHaggis
23
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 25th Jul 2003 15:30
Sorry if I got completely the wrong idea, I'm not sure of what you mean. GTA3 also used ghosting, as far as I can remember, to disguise the popup.

cuRant PRogekt: a three-de map editer
Why the hell'd you ask me for crying out loud!?!
Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Jul 2003 15:34
Well....

If you attach them as limbs to a dummy object like I mentioned, you can hide the limbs. Fairly easy to work out if a limb is positioned inside a bounding box around the camera then show it or hide it.


Van-B

My cats breath smells of cat food.
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 25th Jul 2003 16:06
Just FYI: DBPro loads and references textures by filename, so it will not load the same filename 100 times. It will load the texture in once internally.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
New DBS Web Sites Coming Soon - All Change

Login to post a reply

Server time is: 2026-07-23 02:37:49
Your offset time is: 2026-07-23 02:37:49