Dynamic change of minFilter

I have a renderTarget whose texture I use as input to a shader.
I wish to experiment with the minFilter on the texture.
Once the renderTarget and it’s texture are established it appears that changing minFilter has no effect.
Using texture.needsUpdate after updating minFilter does not help (indeed gives other issues).

Q1: Is there a way to change minFilter dynamically without losing the texture content?
(I can create a new texture and copy across, but that’s a bit of a faffle.)

Q2: Is there anywhere in the documentation that tells me which texture properties can be changed dynamically (eg generateMipmaps) and which ones can’t (eg it seems minFilter)

p.s. on three.js docs
it seems the descriptions for LinearMipmapNearestFilter and NearestMipmapLinearFilter are switched.

1 Like

A1: perhaps also setting the material.needsUpdate = true will help?

A2: not that i’m aware of.

p.s. I tend to agree… the docs seem misleading and contradictory there.


NearestMipmapLinearFilter chooses the two mipmaps that most closely match the size of the pixel being textured and uses the NearestFilter criterion to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.

should be:

NearestMipmapLinearFilter chooses the mipmap that most closely matches the size of the pixel being textured and uses the LinearFilter criterion (a weighted average of the four texels that are closest to the center of the pixel) to produce a texture value.

and:

LinearMipmapNearestFilter chooses the mipmap that most closely matches the size of the pixel being textured and uses the LinearFilter criterion (a weighted average of the four texels that are closest to the center of the pixel) to produce a texture value.

should be:

LinearMipmapNearestFilter chooses the two mipmaps that most closely match the size of the pixel being textured and uses the NearestFilter criterion to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.

@Mugen87 :cowboy_hat_face: ?

min and max filter can both be changed dynamically. You do need to call a needsUpdate on the .map rather than on the .material.

obj.material.map.minFilter = THREE.NearestFilter;
obj.material.map.needsUpdate = true;
1 Like

@emkajeej

OP is using a rendertarget texture, so the semantics might be different ?

@MutatorGroup_Todd to be clear… you’re setting your:

rendertarget.texture.minFilter and .magFilter, and then 
rendertarget.texture.needsUpdate = true; 

And it’s not working?

Oops, missed that part. Apologies for the confusion.

1 Like

No it’s a fair point, and good to know that it probably does work for regular textures… indicating it might be an issue specifically with rendertargets or smth. :+1: