Movatterモバイル変換


[0]ホーム

URL:


Defold logo




Texture filtering and sampling

Texture filtering decides the visual result in cases when atexel (a pixel in a texture) is not perfectly aligned with a screen pixel. This happens when you move a graphical element that contains the texture less than a pixel. The following filter methods are available:

Nearest
The nearest texel will be picked to color the screen pixel. This sampling method should be chosen if you want a perfect one-to-one pixel mapping from your textures to what you see on screen. With nearest filtering everything will snap from pixel to pixel when moving. This may look twitchy if the Sprite moves slowly.
Linear
The texel will be averaged with its neighbors before coloring the screen pixel. This produces smooth appearances for slow, continuous motions as a Sprite will bleed into the pixels before fully coloring them–thus it is possible to move a Sprite less than a whole pixel.

The setting for which filtering to use is stored in theProject Settings file. There are two settings:

default_texture_min_filter
Minifying filtering applies whenever the texel is smaller than the screen pixel.
default_texture_mag_filter
Magnifying filtering applies whenever the texel is larger than the screen pixel.

Both settings accept the valueslinear,nearest,nearest_mipmap_nearest,nearest_mipmap_linear,linear_mipmap_nearest orlinear_mipmap_linear. For example:

[graphics]default_texture_min_filter=nearestdefault_texture_mag_filter=nearest

If you don’t specify anything, both are set tolinear by default.

Note that the setting ingame.project is used by in the default samplers. If you specify samplers in a custom material, you can set the filter method on each sampler specifically. See theMaterials manual for details.


[8]ページ先頭

©2009-2025 Movatter.jp