FX2D noSmooth(), textureSampling?

The performance boost from FX2D is really nice, however I can’t seem to be able to turn off the smoothing. noSmooth() doesn’t work, before or after calling size(), in settings() or setup();

It doesn’t appear ((PGraphicsOpenGL)g).textureSampling(2); can be used with FX2D, as PGraphicsFX2D can’t be cast to PGraphicsOpenGL

PSurfaceFX has setSmooth but I can’t figure out how to test it.

surface = (PSurfaceFX) getSurface();
canvas = (Canvas) surface.getNative();
canvas.getGraphicsContext2D().setImageSmoothing(false);

Note that setImageSmoothing is only available in JavaFX 12+.

1 Like