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 / Culling Tips

Author
Message
dononeton
20
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 2nd Jan 2007 05:32 Edited at: 2nd Jan 2007 05:36
I was was searching the forums and saw a few culling threads. So I tried one of them. The one I tried was made by Lost in Thought using a moded version of the Inca Engine. It doubled the FrameRate. So I would like to to know what I need to thimk about to make a simple culling function so I can learn from that to make improvements in time. I guess hide objects that are off screen, distance from camera, dont play animations off screen. What about portals I saw something about it when I was searching

but there is no help or highlighting for universe commands

And there is LOD. The dbo format does not support this. So I could show a modle at a given distance and increase that distance I could hide old object and show new object. Will all that showing and hiding have a negative response on the framerate?
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 2nd Jan 2007 15:10
I've never tried hiding and showing objects for level of detail so I am not sure how it will affect the frame rate.

Instead of using hide object and show object I think you should use these commands since I heard they make the program go faster than just hiding objects.

exclude object on = hides the object
exclude object off = shows the object

dononeton
20
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 3rd Jan 2007 01:03
Thanks Daemon

This is what I got so far
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 3rd Jan 2007 02:20
I improved your code a bit. It's quite a good start.



dononeton
20
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 3rd Jan 2007 02:36
Thanks Daemon

I have not used vectors yet so I am going to study your code and see what I can come up with. I guess I got the idea. The distance from the camera will change the model. Get vector3 for the camera and get vector3 for all object in scene and sutract them and get a value. IF that distance is between your two set distances then show that model if not show the other
dononeton
20
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 3rd Jan 2007 05:23
Will the exclude object on/off work on limbs?

I want to make an object load it in DBPro and make another and again load it in DBPro both object have the same orgin. Make one of them a limb of the other. Then save . dbo file and bring that new file into my game. Exclude the low res limb when it is so many units from the camera and when it is in the low res distance exlude the the high res limb
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 3rd Jan 2007 20:22
If you use my frustum culling it will give you the distance of each object from the camera with no extra cpu cycles. The result of the SphereInFrustum() function returns the distance from the center of the mesh to the camera screen. Just make a new global variable (or array) to hold the result when calling that function (in the Update_cull_objs() or such). This way you can do LOD and Frustum culling without much added strain on the CPU.

dononeton
20
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 4th Jan 2007 05:09
@ Lost in Thought

Your function is awesome. But I want to come up with something of my own. Learn by doing I am going to study it to get some insight.Do you have any suggestions about a culling function that is a little simpler? Like dont draw anthing that is not in your Filed of view or cull out everthing that is beside or behind you. I dont think I am going to make UT2004 game or anything. I just want to make a base engine. I got some code for object,sound and image numbers generation. I also got a slide collision code. I am working on my Lod function then next a simple culling function. Then player code. If I think and make my own code I will remember the synax, commands game organizaions and be more productive with my code
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 6th Jan 2007 00:18
Quote: "Like dont draw anthing that is not in your Filed of view "


This is easier in Dark Basic Pro than you may think.



dononeton
20
Years of Service
User Offline
Joined: 12th Jun 2004
Location: Tusaloosa, AL : USA
Posted: 6th Jan 2007 21:41 Edited at: 6th Jan 2007 21:56
Thanks Daemon

I was wandering if there was a command to see if an object was on screen. This is what I came up with



When move the camera so one of the boxes is off screen I gain 6 fps so when all 3 are off screen I gain 18 fps. So all of my objects have to be coded in,no limbs. All of LOD models have to be added as object. I was wandering if I want Dark Lights to make lightmaps I would need to make my level with the high res models and when I got my lightmap go into the code and add my other models for the LOD

Login to post a reply

Server time is: 2024-09-25 15:28:49
Your offset time is: 2024-09-25 15:28:49