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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
UniformSampler | create(String name, int unit) factory | Creates a sampler from its GLSL name and its texture unit. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Creation details
Section titled “Creation details”create
Section titled “create”UniformSampler create(String name, int unit) factory
Creates a sampler from its GLSL name and its texture unit.
Method details
Section titled “Method details”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.
getName
Section titled “getName”String getName()
Returns the name of the sampler in the GLSL source.
getUnit
Section titled “getUnit”int getUnit()
Returns the texture unit of the sampler, from 1, in the order of the vertex then the fragment stage.
getTexture
Section titled “getTexture”ITexture getTexture()
Returns the bound texture, or null when none is bound.
getWrap
Section titled “getWrap”TextureWrap getWrap()
Returns the wrap bound with the texture, or null when none is bound.
getFilter
Section titled “getFilter”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
