Removing texture filters

BlitzMax Forums/MiniB3D Module/Removing texture filters

deps(Posted 2008) [#1]
Hello again.
In order to get some retro feeling out of it, I use BackBufferToTex to copy the view onto a cube and I have another camera close to that cube so I get some big nice pixels. I want it to look like it uses a low resolution. The texture dimensions is 128x128.
The problem is that it looks blurred. I use ClearTextureFilters but it doesn't seem to affect the result at all.
It looks ok if I use a texture dimension of 256x256.
How can I make it look unfiltered when I use a smaller texture?

Is there another and better way of doing this?

Demonstration:
Import sidesign.minib3d

Const SCREEN_W:Int = 128
Const SCREEN_H:Int = 128

Graphics3D 640,480
ClearTextureFilters
Local texture:TTexture=CreateTexture( SCREEN_W,SCREEN_H )
AmbientLight 255,255,255

' This is the "television"
hidden_cam = CreateCamera()
PositionEntity hidden_cam, 0,1000,-2
RotateEntity hidden_cam, 0,0,180
Local cube:TMesh=CreateCube()
ScaleEntity cube, 1,1,1
EntityTexture cube,texture
PositionEntity cube,0,1000,0

' The scene
Local cam:TCamera=CreateCamera()
PositionEntity cam,0,0.1,-2
CameraViewport cam,0,0,SCREEN_W,SCREEN_H
'CameraClsColor cam, 0,128,0

c1 = CreateCube() ; ScaleMesh c1, 0.4,0.4,0.4
PositionEntity c1, -1,0,0
EntityColor c1, 255,0,0

c2 = CreateCube() ; ScaleMesh c2, 0.4,0.4,0.4
PositionEntity c2,  1,0,0
EntityColor c2, 255,255,0

a=0
While Not KeyHit( KEY_ESCAPE )
	a :+ 1
	RotateEntity c1,0,a,0
	RotateEntity c2,a,0,0
	UpdateWorld()
	
	HideEntity hidden_cam
	ShowEntity cam

	Wireframe True
	HideEntity cube
	RenderWorld
	ShowEntity cube
	Wireframe False
	
	BackBufferToTex(texture)
	
	ShowEntity hidden_cam
	HideEntity cam
	RenderWorld
	Flip 
Wend