Texture manipulation slowdown (help!!)

Blitz3D Forums/Blitz3D Programming/Texture manipulation slowdown (help!!)

Who was John Galt?(Posted 2003) [#1]
My program slows down drastically when I do either of the following:
1. Copy to the texture buffer of an on-screen object, even though I'm only copying a 64*16 texture which was loaded with the VRAM flag.
2. Even more bizarre- modifying the U,V cordinates of the 4 vertices of a textured square once per loop kills the frame count.

I've got a feeling this might have something to do with the tweening system (as used in Si's Castle demo) I'm using, but I haven't verified this. Anyone experienced similar/have any ideas why/how to sort it out?


jfk EO-11110(Posted 2003) [#2]
Make shure you really use the VRam Flag (256), eg:

tex=loadtexture("x.bmp", 1 or 256)

then - don't use 64*16 Textures - it will be scaled internally to 64*64 - which is probably slow. Better use 64*64 from beginning on. Always use Power-of-2-Textures (16*16, 32*32, 64*64, 128*128 ...)

what Card do you use? Some don't support the Flag. About Si's Tweening Code I have no idea.


Rottbott(Posted 2003) [#3]
Always use Power-of-2-Textures (16*16, 32*32, 64*64, 128*128 ...)
You should indeed use power of two textures, but they don't have to be square! 64*16 is fine!


Who was John Galt?(Posted 2003) [#4]
Thanks for the feedback, fellows, but I'm still none the wiser. I'm definitely setting the VRAM flag and I'm running a GeForce 2 GTS with 32MB memory.

I'm sure I've seen demos running that copy much bigger blocks around with no problems on my machine. How about the slowdown when modifying a few (4) UV coordinates on an entity per loop? I can scale textures in-loop with no slowdown, but modify a couple of coordinates and there goes my frame rate! This didn't happen when I tested it outside my game (i.e: without tweening and all the rest). Surely the GFX card takes care of texturing with the given U,V in real time and all Blitz needs to do is pass the modified values across?


Rottbott(Posted 2003) [#5]
I can't understand it myself. Why not post a small example program that demonstrates the problem so I can test it and see if I get the same thing. I have a Geforce 3 Ti200.


Ross C(Posted 2003) [#6]
I'm sure that using the V-RAM flag causes the texture to always be held in video memory, so if your running low on vid memory that texture is using up memory space and causing a slow-down. Only thing i can think of.