Stop Blitz from 'smoothing' textures?

Blitz3D Forums/Blitz3D Programming/Stop Blitz from 'smoothing' textures?

Treacle(Posted 2011) [#1]
Hi,

I have created a cube mesh in Blitz 3D and am using a brush to texture each surface with a different texture. My textures are very small (16 x 16 pixels) and obviously my cube is a lot larger than this so blitz stretches the texture over each surface. The problem is that when it does this, it seems to be filtering or smoothing the texture somehow to give it a blurry appearance, but I don't want this. I want the texture to retain it's original blocky, pixel art look.

Any ideas how to do this as I can find no option to turn this 'smoothing' off?

Thanks.


Warner(Posted 2011) [#2]
By default, all textures are created and loaded with TextureFlag 8, which is mipmapping. Mipmapping can be turned off by adding the line TextureFilter "", 1 at the start of your program. You can also try manually adding the flags to the LoadTexture or CreateTexture command:
tex = LoadTexture("test.png", 1) or tex = CreateTexture(512, 512, 1)
I'm not completely sure if that second suggestion works.


Yasha(Posted 2011) [#3]
You need FastExtension for this one: http://www.fastlibs.com/index.php

There's an example included of achieving this effect. You'll need to design your backgrounds carefully though, as it seems to only be a global setting rather than something it can do per-texture.

EDIT: I was referring to the bilinear filtering, by the way. FastExtension also lets you play with mipmapping but that doesn't sound like what you want.

Last edited 2011


Ross C(Posted 2011) [#4]
You could also be seeing the effects of bilinear filtering, the blurring between the pixels (texels) making up the texture. I think FastExtension can do this.


Rroff(Posted 2011) [#5]
AFAIK FastExt is the only way to do this semi-reliably - the end user could use settings in the drivers that over-ride B3D mipmapping/filtering commands and even the way FastExt does it isn't 100% proof against the end user forcing certain filter options in the drivers.


Graythe(Posted 2011) [#6]
Another way is to make the texture larger.