Intrinsics1 min read
sample_bias_offset
Samples a texture with a LOD bias and integer texel offset.
Reading Time
1 min
Word Count
113
Sections
7
Try It Live
Test sample_bias_offset in a live shader
Open the playground, start from a visual preset, and wire sample_bias_offset into the fragment stage to see how it behaves with real values.
Open PlaygroundThe sample_bias_offset function samples a texture with automatic LOD selection, adds a LOD bias, and applies a constant integer texel offset.
Live Demo
Signature
bwsl
sample_bias_offset :: (texture2D tex, sampler samp, float2 uv, float bias, int2 offset) -> float4 {...}
Parameters
| Parameter | Type | Description |
|---|---|---|
tex | texture2D | Texture to sample |
samp | sampler | Sampler state |
uv | float2 | Texture coordinates |
bias | float | LOD bias |
offset | int2 | Integer texel offset applied to the sample |
Return Value
Returns the filtered sample value after applying the LOD bias and texel offset.
Example
bwsl
float sharpen = -0.5;
float4 right = sample_bias_offset(detailTex, uv, sharpen, int2(1, 0));Compiled Output
When compiled to GLSL:
glsl
textureOffset(tex, uv, offset, bias)
See Also
- sample_bias - LOD bias sampling
- sample_offset - Offset sampling
- sample_lod_offset - Explicit LOD with offset