turning off texture filtering and a game timing question

Blitz3D Forums/Blitz3D Programming/turning off texture filtering and a game timing question

DrakeX(Posted 2003) [#1]
is there any way to turn off texture filtering on an object? the reason i ask i because i'm using sprites for a HUD and the texture filtering is making fine details all blurry. not to mention i want it to look nice and sharp. note i'm not talking about mipmapping :) i've tried turning mipmapping off (cleartexturefilters then loading the textures without the mipmapping flag) with no results.

also, i have seen two methods for game timing, in addition to the render tweening method built in to blitz. one method involves making a timer and using WaitTimer to pause each frame. the other method is to use VWait : Flip False. does anyone know which is better or if there are advantages/disadvantages to each method?


Hotcakes(Posted 2003) [#2]
My personal favourite is a brute force method. Inside the main loop is a timer which updates at whatever times per second (60 for a normal game I guess) which branches off and executes the game code, then I leave the drawing code in the rest of the main loop with a Flip False (no VWait) - having it redraw the screen as often as it can.

With regards to the -not- mipmapping thing, it could still be mipmapping - I'v heard it can be persistant depending on what detail level your drivers are set to - go into your advanced display properties and have a fiddle around. I always leave my mipmapping on the highest detail cuz things like HUDs can screw up like this and it's not always immediately obvious =]


JaviCervera(Posted 2003) [#3]
timer=CreateTimer(60)  ;This timer 'ticks' 60 times in a second

;At the very end of your game loop
WaitTimer(timer)   ;This will only delay if the current tick has 
                   ;not been reached during the loop
Flip False is used when you don't want to wait for the next vertical refresh of the monitor.


Rob(Posted 2003) [#4]
Use cleartexturefilters before loading your textures, you'll get the sharpest image the card can do as it won't be mipped. It's up to you to get the scaling right. Many methods in code archvies. See hud code.

Render tweening is always better framerate wise, than brute force methods. This is because it only renders when it absolutely has to, saving a fair bit of time.


jhocking(Posted 2003) [#5]
I think I know what you are asking with regards to the texture filtering and no, you can't turn it off. Mip mapping only affects textures far away; when near there is a sort of antialiasing (bilinear filtering I think) which affects textures. Unfortunately that filtering is done automatically by your 3D card and can't be turned off.

As for timing, I recommend the delta time approach. I've you've not seen that try looking for Steady Detla Time in the Code Archives. The gist is you allow the game to render as fast as it can and keep track of how much time is passing between frames, scaling everything which happens in the game (eg. all movements) according to that delta time.


BlackJumper(Posted 2003) [#6]
I have been using the 'tweening' method on some code recently and have had all sorts of problems with objects 'leaking' through the scenery. [I am using PointEntity to guide objects to their objectives and some targets cause pitching --> tunneling/flying. Some entities also manage to burrow through scenery as if it wasn't there, while others get jammed in the walls ! ]

Is it possible that this is due to the tweening process... where the object is halfway through a collision during the tween update and so doesn't get 'bounced' properly ?


DrakeX(Posted 2003) [#7]
"no, you can't turn it off"

crap. thansk for the suggestions for the mipmapping people but jhocking knew what i was really talking about. no offense but you all probably don't know what i'm talking about because this feature is not in BB..! in DB you can turn off texture filtering. if you notice textures usually have their pixels blended together -- even up close -- and this is texture filtering. you can turn this off in DB, yielding blocky-looking textures which are really no use for games (unless you're going for the PS1 look) but great for HUDs and menus.

as for the timing issue -- thanks :) it seems that the built-in tweening causes people more problems than it's worth, so i'll look into doing manual game timing. i know i have some DB code around somewhere that uses the delta time method..