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 / problem with objectLOD

Author
Message
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 13th Nov 2010 18:37
I have tried to use kaedroho's ObjectLOD plugin but, I can't get it to work right. What I want is to show the object with total poly count when camera is close to object, and as camera is far away from object it's poly count decreases. But All I get is four times larger number of polygons when near the object and, object gets invisible when camera gets a little far away from object. Can someone show me how to do this with one sphere instead of 1000 spheres like in kaedroho's demo?
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 13th Nov 2010 19:21 Edited at: 13th Nov 2010 19:23
Quote: "object gets invisible when camera gets a little far away from object"

Are your distant objects moving beyond your default camera range?
use: SET CAMERA RANGE Near Value, Far Value

Set the far value to a VERY large number, say 20000 or larger
SET CAMERA RANGE 1, 20000
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 13th Nov 2010 22:04
This is simple thing i load model with 20000 polygons and when i move the camera backwards it gets to 4020000 polygons, it is supposed to get lower amount of polygons.

my set camera range is 0,1000000
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 14th Nov 2010 12:13 Edited at: 14th Nov 2010 12:31
I downloaded kaedroho's ObjectLOD plugin, and ran his demo.
It seems to work ok, the farther away you move the fewer polys get rendered.

Can you post some example code for us to look at and try?
If you use DBPro spheres like in his demo, does it work correctly for you?

Try this code, see if it works, modified demo code
nruser
18
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: Serbia
Posted: 14th Nov 2010 17:02
your code works but:

this is my code - this part is placed inside of the function


and this is placed inside main do loop


i am using mouselook with this, and now object disappears randomly when moving around it with the camera, and it also doesn't get fewer polys
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 14th Nov 2010 19:46
You loaded object with the path Model$ with the number map.
But you didn't loaded the other versions of the same object with fewer polys which need to be placed in map2, map3, map4.
So where the lod level changes there's nothing to show because you only loaded you base LOD level. Plugin doesn't create those lod levels for you, you have to create it yourself!

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Nov 2010 17:27
Also, in this code...

All Map variables will have the same object number as you don't create any objects! You need to find free object, then create the object before finding another free object.

Think about it;
Find free Object, object 1 is free.
Find free object, object 1 is still free.

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-21 18:58:27
Your offset time is: 2026-07-21 18:58:27