class CrShader::Language::Types::Sampler2D

Overview

2D texture sampler reference (sampler2D).

Defined in:

crshader/language/types.cr

Instance Method Summary

Instance Method Detail

def fetch(coord : IVec2, lod : Int32 = 0) : Vec4 #

Fetches texel at integer pixel coordinates without bilinear filtering.


def sample(uv : Vec2) : Vec4 #

Samples the texture at normalized coordinates uv, returning an RGBA vector.


def sample_lod(uv : Vec2, lod : Float32) : Vec4 #

Samples the texture at explicit mipmap level of detail lod.


def size(lod : Int32 = 0) : IVec2 #

Returns dimensions of the texture at mipmap level lod as ivec2(width, height).