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 / UV scaling/camera rotation bug? And a control oddity...

Author
Message
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 12th May 2003 02:01
I recently noticed that if I have a large box (5500x5500) with its texture scaled up (25-35x), and the camera rotates a certain way, I get a huge FPS hit.

In my project, I have the camera positioned 600 units above the box, pointed down at a sphere on it. When I begin to rotate it on its Y axis, DBP slows to a crawl (from 60 FPS to about 11). I can rotate full circle back to the previous position, and it works fine again.

If I comment the scale object texture line, I don't get the slowdown.

I can understand why scaling a texture that much would slow the program down, but I really don't get why 1) it's that much of a performance hit and 2) why it only happens when the camera is rotated a certain way.


The control bug is this... I have a bit of code that checks for the Insert or Pageup keys being pressed using Scancode(), and if they are rotates the camera (same program [b]) ). Well, when push either key and then click the mouse... the program freezes. It dosen't crash; the mouse still moves, but the screen dosen't update at all. Esc still closes the program.

There's nothing in my program that could have been triggered that does this, not a single suspend or wait line in all the code. It's pretty frustrating too...

Thankee.
--Mouse

Famous Fighting Furball
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 12th May 2003 23:39
Um.. bump? I really need a fix for the last one at least in an upcoming patch

Sorry about the bold, not sure how that got in there.

--Mouse

Famous Fighting Furball
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 12th May 2003 23:52
you are mapping a box 5000x5000 with a 30 tiled texture
It's like having 6 matrices 5000x5000 with 30x30 tiles each in the same spot..
try it with matrices and you'll get the same effect..
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 12th May 2003 23:53
It s strange tho, cause Patch 4 should have fixed it to some extent..
are you sure you got only 1 box there?
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 13th May 2003 00:08
Yup, only 1. And I'm certain patch 4 is correctly installed.

--Mouse

Famous Fighting Furball
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 13th May 2003 03:12
Even with Patch4 that's a box twice the size of the default camera range and a texture scaled 25 times! If the original texture was 512x512 pixels (which would be 1.04 Meg of texture data) you're mapping that 25 times over which is about 25Megs worth of textures being drawn. Now it may optimise it when drawing but that's still quite a bit.

As for the program freezing with the PgUp key (etc) - post your code. This will not be fixed in Patch 4.1 because I'm 99% certain the bug is in your code as opposed to being something we can actually fix. At least I have a PageUp key response working here without error/pausing.

Sometimes even when you're 110% positive there isn't a problem with your code, it doesn't mean it's not there. We can help, but need more info.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 13th May 2003 05:53
I wouldn't be surprised if it was in my code... . As for the UV data... thanks for explaining, but... why is it slower only when I rotate the camera? I just don't understand it

Here's my code. I really don't want to post the whole thing, so I've chopped bits out... however the problem still occurs, so I'm sure I didn't remove anything critical. I noted that if I cut out the mentioning of object 55, it runs perfectly... not sure what the conflict is there, but it's solid code (I think )

Thanks for looking into this.

--Mouse

Famous Fighting Furball
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 14th May 2003 18:01
'lil bump ...

--Mouse

Famous Fighting Furball
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 14th May 2003 20:26
why don 't you exclude scancode when you're mouse clicking ?

if mouseclick()=0 and scancode()=210 then camangle=camangle+4

apparently there is some conflict, turning the cam as you check screen position of object 55 would completely mess up the situation..
not sure tho, because the 2 actions are supposed to happen in sequence and not at once, so above wouldn't make sense..not easy to judge from that code
have you tried keys other than PgUp/Down?
Ian T
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 14th May 2003 21:09
Yeah, I could do that, or try something else. But the thing is, I really shouldn't have too... I just want to know if it's a bug in DBP or not. I don't have a problem using a workaround until whatever it is is fixed (I'm using one right now), but if it is a bug, I'd be nice if it was fixed .

--Mouse

Famous Fighting Furball

Login to post a reply

Server time is: 2026-07-11 08:46:29
Your offset time is: 2026-07-11 08:46:29