# FX2D noSmooth(), textureSampling?

**URL:** <https://discourse.processing.org/t/fx2d-nosmooth-texturesampling/4312>\
**Category:** Processing\
**Created:** [October 10, 2018, 2:59am UTC](https://discourse.processing.org/t/fx2d-nosmooth-texturesampling/4312 "2018-10-10T02:59:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmccandless](https://avatars.discourse-cdn.com/v4/letter/l/f0a364/32.png) [@lmccandless](https://discourse.processing.org/u/lmccandless)\
**Post date:** [October 10, 2018, 2:59am UTC](https://discourse.processing.org/t/fx2d-nosmooth-texturesampling/4312/1 "2018-10-10T02:59:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [August 14, 2019, 11:13am UTC](https://discourse.processing.org/t/fx2d-nosmooth-texturesampling/4312/2 "2019-08-14T11:13:14Z")

</div>

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

```

Note that `setImageSmoothing` is only available in JavaFX 12+.
