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 Discussion / Laggy game from skybox?

Author
Message
BLink
21
Years of Service
User Offline
Joined: 1st Jan 2004
Location: Laptop, wherever that is
Posted: 7th May 2006 20:29
So I took out the backdrop and replaced it with an inverted sphere that centers around the camera and has a skybox texture applied, but it seemed to give the game a huge drop in framerate. Actually, it might also have something to do with changing from being inside an inverted cube tunnel to being on top of a random matrix, but either way, something's certainly killed how quickly the game flows.

Is there anything you guys know of I can do to fix this? Or do I need to post some parts of my code?

Pineapple juice, the best drink ever made.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 7th May 2006 20:44
I've never used a sphere for a sky - I've always used boxes, so I can't comment on the FPS problem with any experience.

A sphere has more faces than a cube, but not that many that it should affect the FPS. You do have Sync turned on right?

Also, have you tried NOT inverting the sphere? Simply changing the Cull flag in SET OBJECT will let you see the texture from inside the sphere without inverting it - which just might be causing the FPS reduction.

Finally, what size is your sphere's texture?

If it's really big, that might be having an effect. Depending on your system, reducing the texture size could help.

TDK_Man

Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th May 2006 00:21 Edited at: 8th May 2006 00:21
The matrix probably slowed your game down.

BLink
21
Years of Service
User Offline
Joined: 1st Jan 2004
Location: Laptop, wherever that is
Posted: 8th May 2006 01:03
It's a 1024x1024 texture, so I don't think that would be too unreasonably big, such to the extent of slowing down the sync rate. I do have it sync at the end of every loop, is there something more that I need than that?

And next time I boot it up, I'll try it without the matrix and with a normal sphere with the changed Cull flag. Thanks guys, I'll let you know how this turns out.

Pineapple juice, the best drink ever made.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 8th May 2006 15:13
1024x1024 textures aren't too bad - if you have a decent gfx card.

If your card is an older one then 1024x1024 is big. Remember, not too long ago, we were using 32x32 pixel textures and things looked fine...

As a test, you could try reducing the texture to 512x512 and check out the difference.

The matrix will have an effect, but it shouldn't really be that drastic with what you have done already. Can't be 100% sure, but if I had to pick one or the other to check out first, it would be my texture image sizes.

TDK_Man

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th May 2006 00:57
Personally I prefer spheres, in fact I made a skybox to skysphere converter for the very purpose.

The problem I have with skyboxes is that once they're loaded, then that's it - you can't change the texture unless everything is limbs. I like to use skyspheres instead, with a moderately low detail level, then it's easy to layer things and change textures, nice for sky transitions with alpha fading. Remember you can set the detail of the sphere when creating it.

With the skyboxes I have used though, I'd concur that they should'nt affect frame rate that badly, matrices can be really slow at big resolutions. Perhaps try that advanced terrain demo, that has a terrain and a skybox, both quite high quality, that should give a decent marker for how it should perform.

Aegrescit medendo
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 9th May 2006 10:11
Van

You forgot where you were by any chance?

This is the land of DB Classic - not Pro, so we don't have the luxury of advanced terrains.

Unless there's a DBC advanced terrain demo I don't know about...

TDK_Man

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th May 2006 11:30
Hehe, for some reason I had it in my head this was the newcommers board .

Aegrescit medendo

Login to post a reply

Server time is: 2025-05-23 14:51:31
Your offset time is: 2025-05-23 14:51:31