vasturiano / three-spritetext

A sprite based text component for ThreeJS
https://vasturiano.github.io/three-spritetext/example/basic/
MIT License
340 stars 46 forks source link

Flickering when zoomed out #48

Closed lluis closed 1 month ago

lluis commented 4 months ago

Hi, is there any way to prevent the flickering when moving camera while zoomed out? Specially for texts with stroke See for example the demo page from https://vasturiano.github.io/three-spritetext/example/basic/

vasturiano commented 1 month ago

@lluis thanks for reaching out.

The reason for most of the flickering during the zooming operations was because the texture had a linear minification filter. This makes the text a slightly more crisp but has the unwanted side effect of sub-pixel flickering when the camera moves. I've changed the minFilter to the default LinearMipmapLinearFilter which I think it's more suiting to this text representation.

In any case any other filter can still be applied on demand by setting it on the text sprite, something like:

myTextSprite.material.map.minFilter = THREE.NearestFilter;
lluis commented 1 month ago

@vasturiano Thanks for the fix! :smile: