Hey, guys, I have a doubt in Blitz3D, how to disable the bilinear filtering in the textures, because I'm creating a 3D game in pixel art, and using the "ClearTextureFilters()" function is not having any effect, the texture is still "blurred", does anyone know how do this?, thanks for your attention.
Hi Plim, have you tried texture flag '1024'? According to this commit...
https://github.com/blitz-research/blitz3d_msvc2017/commit/0e48d376bd6075420b42da...
...this very useful feature was added in 2018 by someone called Dave Camp - thanks Dave whoever you are!
Hi Mark, it's an honor to talk to you, yes I used:
"Const tex_mipmap_OFF = 1024"
Ex:
ground_tex = LoadTexture( "imgs_Base/chadrez.png", tex_color + tex_alpha + tex_mipmap_OFF)
But does it only work in BlitzNG and not in "Blitz3DSetup1108" which is what I prefer to use, or does it work in "Blitz3DSetup1108" and I didn't know how to make it work?, thanks a lot for answering.
Of course :)
Const tex_color = 1 ; Color texture
Const tex_alpha = 2 ; Alpha texture (Include alpha channel data)
Const tex_mask = 4 ; Masked texture (black is transparent)
Const tex_mipmap = 8 ; Create texture mipmaps
Const tex_clampu = 16 ; Restrict U texture coords from "bleeding over"
Const tex_clampv = 32 ; Restrict V texture coords from "bleeding over"
Const tex_envshpere = 64 ; Load texture as a spherical environment map
Const tex_vram = 256 ; Force texture graphics to vram
Const tex_highcolor = 512 ; Forces texture graphics to be 32-bits per pixel
Const tex_mipmap_OFF = 1024 ; Turn mipmap OFF
Graphics3D 800,600,0,2
SetBuffer BackBuffer()
ClearTextureFilters()
light=CreateLight()
RotateEntity light,45,45,0
cube=CreateCube()
w=256
tex1=CreateTexture(w,w, tex_color, tex_mipmap_OFF)
For i=0 To 10000
Color Rand(255),Rand(255),Rand(255)
Plot Rand(0,255),Rand(0,255)
Next
EntityTexture cube, tex1
CopyRect 0, 0, 256, 256, 0, 0, BackBuffer(), TextureBuffer(tex1)
camera=CreateCamera()
CameraRange camera,0.001,50
TranslateEntity camera,0,0,-1.4
While KeyHit(1)=0
TurnEntity cube,0,.1,0
RenderWorld()
Flip
Delay 10
Wend
End
Hi, you need to use 'Or' to combine multiple flags together (which sounds very counter-intuitive!) For example, this works for me:
tex1=CreateTexture(w,w, tex_color Or tex_mipmap_OFF)
By using a comma here, you're actually creating a 1024 'frame' texture!
You can also use plain additon to combine flags, ie: '+', but then you have to be careful to only use each flag exactly once. Still, I think this is what most b3d coders used, and it makes a bit more logical sense I guess.
In retrospect, I think Blitz3D should have had '|' and '&' and maybe '~' operators too.
Bye!
Mark