Skip to content

UniformSampler

final class UniformSampler
Package: dev.joid.lib.bridge.render.shader.uniform · Module: core · Source: UniformSampler.java

One sampler of a shader, its texture unit and the texture, filter and wrap bound to it.

The constructor of Shader creates one per sampler of its stages, numbered from unit 1: the backend keeps unit 0 for its own use. At each draw, the render bridge resolves each sampler with resolveSampler, which falls back to the texture of the render state when the sampler has no allocated texture.

ReturnsSignatureSummary
UniformSamplercreate(String name, int unit) factoryCreates a sampler from its GLSL name and its texture unit.

ReturnsSignatureSummary
thisvalue(ITexture texture, TextureFilter filter, TextureWrap wrap) fluentBinds a texture to the sampler, with its filter and its wrap; IShader.sampler calls it.
StringgetName()Returns the name of the sampler in the GLSL source.
intgetUnit()Returns the texture unit of the sampler, from 1, in the order of the vertex then the fragment stage.
ITexturegetTexture()Returns the bound texture, or null when none is bound.
TextureWrapgetWrap()Returns the wrap bound with the texture, or null when none is bound.
TextureFiltergetFilter()Returns the filter bound with the texture, or null when none is bound.

UniformSampler create(String name, int unit) factory

Creates a sampler from its GLSL name and its texture unit.

this value(ITexture texture, TextureFilter filter, TextureWrap wrap) fluent

Binds a texture to the sampler, with its filter and its wrap; IShader.sampler calls it.

String getName()

Returns the name of the sampler in the GLSL source.

int getUnit()

Returns the texture unit of the sampler, from 1, in the order of the vertex then the fragment stage.

ITexture getTexture()

Returns the bound texture, or null when none is bound.

TextureWrap getWrap()

Returns the wrap bound with the texture, or null when none is bound.

TextureFilter getFilter()

Returns the filter bound with the texture, or null when none is bound.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page