Header menu logo Mibo

Texture Module

Pipe-friendly helpers for configuring a loaded Texture2D.

raylib's texture filter is a property of the texture itself, set with Raylib.SetTextureFilter. The Mibo loader (IAssets.Texture) generates mipmaps and forces Trilinear filtering on every texture at load time — good for 3D/PBR surfaces, but it makes tiles sampled from a gutterless spritesheet bleed at the edges. Use these helpers to override that per texture:

 let assets = GameContext.getService<IAssets> ctx
 let atlas = assets.Texture "tiles.png" |> Texture.filter TextureFilter.Point
val assets: obj
val atlas: obj
Apply once (e.g. in init) — not every frame — since it mutates the cached texture's sampler.

Functions and values

Function or value Description

filter filterMode tex

Full Usage: filter filterMode tex

Parameters:
    filterMode : TextureFilter - The raylib TextureFilter to apply.
    tex : Texture2D - The texture to configure (returned for piping).

Returns: Texture2D
Modifiers: inline

Sets the texture's filtering mode, overriding the load-time default (mipmaps + Trilinear).

Point (nearest) filtering reads exact texels — use it on a tile atlas to stop adjacent tiles from bleeding into each other. The texture already has mipmaps generated on load; Point/Bilinear simply ignore them.

filterMode : TextureFilter

The raylib TextureFilter to apply.

tex : Texture2D

The texture to configure (returned for piping).

Returns: Texture2D

mipmaps tex

Full Usage: mipmaps tex

Parameters:
    tex : Texture2D - The texture; the updated struct (new mipmap count) is returned for piping.

Returns: Texture2D
Modifiers: inline

Generates mipmaps for the texture (the Mibo loader already does this on load, so this is mainly useful for textures loaded outside the loader).

raylib-cs mutates the texture byref and writes the mipmap count back into the same struct, so the returned texture must be used.

tex : Texture2D

The texture; the updated struct (new mipmap count) is returned for piping.

Returns: Texture2D

wrap wrapMode tex

Full Usage: wrap wrapMode tex

Parameters:
    wrapMode : TextureWrap - The raylib TextureWrap to apply (Clamp, Repeat, MirrorClamp, MirrorRepeat).
    tex : Texture2D - The texture to configure (returned for piping).

Returns: Texture2D
Modifiers: inline

Sets the texture's wrap (addressing) mode — how sampling handles texture coordinates outside the [0, 1] range.

Use Repeat/MirrorRepeat for a tiling background; Clamp stops edge texels from wrapping. Like filter, this is a per-texture sampler property.

wrapMode : TextureWrap

The raylib TextureWrap to apply (Clamp, Repeat, MirrorClamp, MirrorRepeat).

tex : Texture2D

The texture to configure (returned for piping).

Returns: Texture2D

Type something to start searching.