Texture Buffer filter

I’m trying to set a specific filter for a texture that I have in a offscreen buffer.
It’s a very small texture(64x64) stretched over a very large object and I don’t want the texture to get blurred, I want sharp pixels, or in other words - I want to set the texture magnification filter to ‘Nearest’.

This is more or less the code I’m trying to use:

mesh=loader.loadModel('some_mesh')
mesh.reparentTo(render)
mesh.setShader(Shader.load(Shader.SLGLSL, "shaders/ter_v2.glsl", "shaders/ter_f3.glsl")) 

tex=Texture()
tex.setMagfilter(Texture.FTNearest)
buff=base.win.makeTextureBuffer("canvas", 64, 64,tex))
mesh.setShaderInput("walkmap", tex) 

In the shader I use the “walkmap” as any other texture

//GLSL
#version 110
uniform sampler2D walkmap;
varying vec2 texUV;

void main()
    { 
    vec4 walk=texture2D(walkmap,texUV);
    gl_FragData[0] = walk;        
    }

Is there any way (in Panda3D or on the glsl shader side) to get the texture displayed unfiltered?

the best I’ve managed so far with my shader-fu is to cut of the blurred part, it looks interesting, but it’s not exactly what I’m after:

vec4 walk=vec4(1.0,1.0,1.0,1.0)- step(texture2D(walkmap,texUV), vec4(0.5,0.5,0.5,0.5));

Hmm… This may not be the best way to go about it, but could you not alter the texture coordinates such that they keep to integer pixels? Something like this, based on your posted shader:
(This is untested, and I’m not familiar with GLSL, so the following may not be correct; some work may be called for on the part of the reader to turn it into usable code… ^^; )

uniform sampler2D walkmap;
varying vec2 texUV;
varying float2 pixelSize;
// Calculate "pixelSize" above once outside the shader as (1.0/texWidth, 1.0/texHeight)

void main()
    {
    //  Divide the uv-coordinates by the pixel-size and discard the remainder,
    // thus giving us a discrete "pixel-bin" in each dimension. That done,
    // re-multiply by the pixel-size to get back into the appropriate
    // dimensions.
    int x = (int)(texUV.x/pixelSize.x);
    int y = (int)(texUV.y/pixelSize.y);
    texUV.x = x*pixelSize.x;
    texUV.y = y*pixelSize.y;
    vec4 walk=texture2D(walkmap,texUV);
    gl_FragData[0] = walk;       
    }

Setting the minfilter and magfilter to FTNearest is the way to go. There is no need to implement custom logic for it in your shader.
Maybe makeTextureBuffer resets the filter settings? Might call setMinfilter and setMagfilter afterwards to be sure.

I took a look at my actual code (it’s used in my “Koparka” editor if anyone wants to take a look) and I do call setMagfilter(Texture.FTNearest) after the buffer is created. If it’s not a panda error, then I must be making an error somewhere.

EDIT:
If I ask the texture what Magfilter it’s using (getMagfilter) it says “0” and that is “Texture.FTNearest” but the texture applied looks fussy/blurred not pixelated.