Slowdown

Blitz3D Forums/Blitz3D Beginners Area/Slowdown

Terry B.(Posted 2007) [#1]
I have a small terrain, that is textured with a 128X128 grass texture. The problem is, when I apply the texture to the terrain, the program slows by 30 fps.
Any ideas why this happens?


H&K(Posted 2007) [#2]
When you say "By 30 FPS" do you mean from like 180 to 150Fps. Its perfectly normal for the added texture to slow down a previously running program, but you havent really said how much its slowing by (%) to know if its a problem or not.


Gabriel(Posted 2007) [#3]
You're not giving us much to go on, are you? Slows by 30FPS could mean the difference between 31fps and 1fps or it could mean the difference between 2400fps and 2370fps. Frames per second is not linear, so it's very important what kind of numbers you're talking about.


Terry B.(Posted 2007) [#4]
It slows by 50%, the average fps on all the machines I have tried it on is 60.


IPete2(Posted 2007) [#5]
Please show us the code or a demo Terry - then we can comment.

The way you are doing this may affect the results, so the code is preferable.

IPete2.


Terry B.(Posted 2007) [#6]
This is the code I use to texture the terrain.
If I take off the lightmap then the program still runs at 50% but if i take off the grass texture it runs at full speed.
Tex = LoadTexture("media\Grass.bmp")
tex2 = LoadTexture("Media\h1l.bmp")
ScaleTexture tex2,TerrainSize(Terrain),TerrainSize(terrain)
EntityTexture Terrain,Tex

EntityTexture terrain,tex2,0,1



Quantum(Posted 2007) [#7]
This might sound like a silly question.... but your are creating the terrain & texturing it outside the main-loop aren't you?

Only I've done silly things like place something that only needs doing once in the main-loop before & it ends up getting re-created each cycle... a definate frame-rate killer! lol


Stevie G(Posted 2007) [#8]
What GFX card do you have? Also, what size in pixels are your textures?


Terry B.(Posted 2007) [#9]
Ok so I have noticed somthing else, it only slows down when I face the center of the terrain.
And the dimensions of the textures are 128X128.
I am not sure what my GFX card on my work computer is, but I got it 2 weeks ago so it is fairly good.


chwaga(Posted 2007) [#10]
if you put it INSIDE the main loop, it could be deleting and reloading the texture every loop (VERY fast looping, VERY hard on the computer)


Terry B.(Posted 2007) [#11]
I didnt put it in the main loop, it is only called right after the graphics command.


Gabriel(Posted 2007) [#12]
I am not sure what my GFX card on my work computer is, but I got it 2 weeks ago so it is fairly good.


Uhh.. they didn't stop selling crappy videocards in the past two weeks.

So you have nothing else going on but this lightmapped terrain, and you're down to 30fps? If so, can you post the whole code? There shouldn't be too much to it if it's just a terrain.


Mortiis(Posted 2007) [#13]
do you have the latest b3d update and the latest drivers for your gfx card?


Terry B.(Posted 2007) [#14]
@ Mortis
Yes I do.


chwaga(Posted 2007) [#15]
it could have been just going super fast because there was nothing operating inside the main loop untill you added the terrain, giving it a more...realistic? FPS.


Mortiis(Posted 2007) [#16]
Well then, why don't you post you full source code?