Page 1 of 1

no texture filtering

PostPosted: Sun Nov 10, 2019 1:36 pm
by solitarius576
i would like to play with point filtering
i modified the occurrences of gl_linear to gl_nearest
but only the 2d elements seems to render with point filtering
is there a way to achieve this or the texture filtering is done with shaders?
thx

Re: no texture filtering

PostPosted: Sun Nov 10, 2019 10:05 pm
by Bart
The old engine does filtering in the shaders. But if you're running the new engine (which has been the default in SVN builds for a couple years now), check out Src/Graphics/New3D/Texture..cpp in CreateTextureObject().

Re: no texture filtering

PostPosted: Mon Nov 11, 2019 1:41 am
by solitarius576
thx for reply
i modified the two occurrences in that file, since i modified all gl_linear that i could find in all the files
but still only 2d elements, i'm guessing the tile generator, get's that point filtering look
the textures on 3d objects are still filtered
i have to mention i'm not a coder so maybe i'm doing something wrong
maybe Ian can give a second opinion

Re: no texture filtering

PostPosted: Mon Nov 11, 2019 1:45 am
by Bart
I didn't read Texture.cpp carefully. It is already set to nearest filtering. Turns out Ian is performing texture sampling in the shader, probably to emulate Model 3's non-OpenGL-compatible edge clamping. The shaders are in R3DShaderTriangles.h and R3DShaderQuads.h (normal and quad rendering, respectively). The relevant function is called textureR3D(). I'm not sure if Ian's engine supports the -frag-shader command line option to load external shaders but at the very least you can edit and recompile.

Re: no texture filtering

PostPosted: Mon Nov 11, 2019 2:44 am
by solitarius576
ah ok
thx again, i will try but as i said i'm no coder, and this shader business it's above me :oops:

Re: no texture filtering

PostPosted: Fri Jan 17, 2020 1:19 am
by solitarius576
i figured out and disabled the mipmaping too
everyhing is super sharp now
thx for the help