How to add a command to minib3d to turn off texture filtering You will need to patch some files
Step 1: Open TMesh.bmx and scroll down until you find:
' mipmapping texture flag
If tex_flags&8<>0
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR)
Else
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR)
EndIf Change it to look like:' mipmapping texture flag
If(THardwareInfo.TextureFilters)
If tex_flags&8<>0
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR)
Else
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR)
EndIf
Else
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST)
EndIf Step 2: Open THardwareInfo.bmx and add-
Global TextureFilters : Int = 1 -at the end of the globals (e.g. under MaxLights)
Step 3: Open functions.bmx and add this wherever you think is comfortable
Rem
bbdoc: MiniB3D Only
about: Enables/disables texturefilters.
The command enables/disables texture filters on meshes.
End Rem
Function TextureFilters(boolean:Int)
THardwareInfo.TextureFilters = boolean
End Function
Rem
bbdoc: MiniB3D Only
about: Returns the value of TextureFilters.
The command returns wether TextureFilters is enabled or not.
End Rem
Function GetTextureFilters:Int()
Return THardwareInfo.TextureFilters
End Function
To use, put TextureFilters(boolean) in your main file True blurs textures like before and false pixelates textures like Doom!
ENJOY!
Could not have been done without this thread: http://www.blitzbasic.com/Community/posts.php?topic=97016
|