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.

Newcomers DBPro Corner / Loading a new model over an old one...

Author
Message
Doremar
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 6th Feb 2004 07:55
I've written some code in DBP that switches between a high poly model and a low poly model depending on the distance of the model from the camera. All is working very nicely with one ugly hitch. Deleting the old model and loading the new one causes FPS to drop momentarily, and that of course gets increasingly worse the more models I add.

So, my question is, is there a more graceful method for changing one model for another? Perhaps some faster or more efficient way to load the model such that it doesn't cause the system to lag?

I've included the code I'm using to switch models on the Source button.

Thanks in advance for any suggestions =)

P.S. I'm using the vector3 method from the code snippets board to get the distance between the mobs and camera.

A Cloaking Robe of Elven-Kind hangs in my wardrobe behind
All those things that mother said were proper for a boy
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 6th Feb 2004 19:28
load both the high and low poly ones at the begginning, position both models in the same place but hide the one you don't need and show the one you do.


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
Doremar
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 6th Feb 2004 20:54
Excellent. Works great, thanks =)
I need to do a little work to make sure the model animations will still sync up when I switch objects but the fps drop for using a new model is now negligable.

A Cloaking Robe of Elven-Kind hangs in my wardrobe behind
All those things that mother said were proper for a boy
Doremar
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 7th Feb 2004 07:46
Hrm, actually there is a down-side to that method.

When I was deleting the model that wasn't being used, I had a very large performance boost overall and a significant performance drop whenever the models changed (like 60fps, dropping to 20fps to switch 6 or 7 models nearly simultaneously).

Using hide, now there is no performance drop while loading, but the program runs slower in general (about 40fps consistently with 6 or 7 models)

Unfortunately, that performance drop defeats the purpose of switching to low poly models. Is there something I'm missing?

A Cloaking Robe of Elven-Kind hangs in my wardrobe behind
All those things that mother said were proper for a boy
Doremar
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location:
Posted: 9th Feb 2004 05:07
I've found a sorta solution that may work out if I find a method to deal with the side-effects of using a completely different object number in the rest of the code.

I noticed that when I wasn't facing the hidden objects, my FPS was still just fine, so apparently even though an object is hidden it's still hammering the system as if it was still rendering all those hidden polys.

Now when I don't need it I am hiding the high poly model AND repositioning it -10000 units down, well out of range of the camera. Performance when using the low poly models increases dramatically.

A Cloaking Robe of Elven-Kind hangs in my wardrobe behind
All those things that mother said were proper for a boy

Login to post a reply

Server time is: 2024-09-21 21:12:05
Your offset time is: 2024-09-21 21:12:05