how to disable the filtering on texture

Blitz3D Forums/Blitz3D Beginners Area/how to disable the filtering on texture

RemiD(Posted 2014) [#1]
Hello,

I have read several posts on the forum but i have still not managed to remove the automatic filtering on textures, all textures look blurred, especially when the camera is close.
How to disable this automatic filtering for all textures, or if it is too slow to render this way, at least for some textures ?

here is an example of what i mean :


Thanks,


RemiD(Posted 2014) [#2]
I have tried to use ClearTextureFilters() and TextureFilter() but it does not seem to remove the filtering effect on the texture or maybe i don't use it correctly :



RemiD(Posted 2014) [#3]
i thought that the blurred effect was because of mipmapping
http://en.wikipedia.org/wiki/Mipmap
but after having read this topic : http://www.blitzbasic.com/Community/posts.php?topic=95323
it seems that the blurred effect is because of bilinear filtering
http://en.wikipedia.org/wiki/Bilinear_filtering

What can i do to desactivate this filtering ?


Floyd(Posted 2014) [#4]
I don't know what you hope to see. The lines in the image are 1 pixel wide. When the texture is displayed on screen this becomes about 6 pixels for distant points and 15 pixels for close ones. That transition can be smooth ( blurry ) or it could be a stairstep effect. But it can't be clean lines like the image.

Here is your program with the rectangles replaced by a single line for simplicity.




RemiD(Posted 2014) [#5]
Thanks for the explanation.
I will try to find another way without using textures (only meshes and vertex color)


RemiD(Posted 2014) [#6]
Is it possible to have no smooth effect ? To have the texels displayed with their exact color and without blurring near the sides even if there is a stairstep effect ? Is it possible to do that ? If yes how ?


feeble1(Posted 2014) [#7]
Here is the relevant post: Here's how to disable filtering!

And this should help you out: Click here!


RemiD(Posted 2014) [#8]
feeble1>>Very good ! Exactly the render i wanted to have.
Thank you very much !

Is there any compatibility problem or perfommance hit to use this rather than the default filtering ?

Thanks again :)


feeble1(Posted 2014) [#9]
There should be no performance issues. If you stretch a small texture over a large surface, it would appear pixelated instead of the default smoothing.


RemiD(Posted 2014) [#10]
Ok, good.


RemiD(Posted 2015) [#11]
new link with an example : http://tempsend.com/0E19532EC9


Guy Fawkes(Posted 2015) [#12]
AWESOME!


RemiD(Posted 2015) [#13]
new link with example : http://tempsend.com/98DF7E1D69


Guy Fawkes(Posted 2015) [#14]
Um..... Link down...


RemiD(Posted 2015) [#15]
http://tempsend.com/6722B00BCD


Kippykip(Posted 2015) [#16]
Now that link is down
I have an alternative file which is a stripped down file of some dll that Ive been using which disables the filter
I might attach it in a bit


RemiD(Posted 2015) [#17]
new link : http://rd-stuff.fr/disable-bilinear-filtering-of-textures-201509131549.zip


RemiD(Posted 2016) [#18]
new version (i have modified the values sent to the functions according to the directx documentation) : http://rd-stuff.fr/disable-bilinear-filtering-of-textures-201612021732.zip
It works well here...