warp.texture_sample#

warp.texture_sample(
tex: Texture1D,
u: float32,
dtype: Any,
) Any#
  • Kernel

Sample the 1D texture at the given U coordinate.

Experimental

The texture API is experimental and subject to change. See warp.Texture.

Parameters:
  • tex – The 1D texture to sample.

  • u – U coordinate. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, width] if normalized_coords=False.

  • dtype – The return type (float, warp.vec2f, or warp.vec4f).

Returns:

The sampled value of the specified dtype.

Filtering mode is warp.TextureFilterMode.CLOSEST or warp.TextureFilterMode.LINEAR.

warp.texture_sample(
tex: Texture2D,
uv: vec2f,
dtype: Any,
) Any
  • Kernel

Sample the 2D texture at the given UV coordinates.

Experimental

The texture API is experimental and subject to change. See warp.Texture.

Parameters:
  • tex – The 2D texture to sample.

  • uv – UV coordinates as a warp.vec2f. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, width] x [0, height] if normalized_coords=False.

  • dtype – The return type (float, warp.vec2f, or warp.vec4f).

Returns:

The sampled value of the specified dtype.

Filtering mode is warp.TextureFilterMode.CLOSEST or warp.TextureFilterMode.LINEAR.

warp.texture_sample(
tex: Texture2D,
u: float32,
v: float32,
dtype: Any,
) Any
  • Kernel

Sample the 2D texture at the given UV coordinates.

Experimental

The texture API is experimental and subject to change. See warp.Texture.

Parameters:
  • tex – The 2D texture to sample.

  • u – U coordinate. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, width] if normalized_coords=False.

  • v – V coordinate. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, height] if normalized_coords=False.

  • dtype – The return type (float, warp.vec2f, or warp.vec4f).

Returns:

The sampled value of the specified dtype.

Filtering mode is warp.TextureFilterMode.CLOSEST or warp.TextureFilterMode.LINEAR.

warp.texture_sample(
tex: Texture3D,
uvw: vec3f,
dtype: Any,
) Any
  • Kernel

Sample the 3D texture at the given UVW coordinates.

Experimental

The texture API is experimental and subject to change. See warp.Texture.

Parameters:
  • tex – The 3D texture to sample.

  • uvw – UVW coordinates as a warp.vec3f. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, width] x [0, height] x [0, depth] if normalized_coords=False.

  • dtype – The return type (float, warp.vec2f, or warp.vec4f).

Returns:

The sampled value of the specified dtype.

Filtering mode is warp.TextureFilterMode.CLOSEST or warp.TextureFilterMode.LINEAR.

warp.texture_sample(
tex: Texture3D,
u: float32,
v: float32,
w: float32,
dtype: Any,
) Any
  • Kernel

Sample the 3D texture at the given UVW coordinates.

Experimental

The texture API is experimental and subject to change. See warp.Texture.

Parameters:
  • tex – The 3D texture to sample.

  • u – U coordinate. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, width] if normalized_coords=False.

  • v – V coordinate. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, height] if normalized_coords=False.

  • w – W coordinate. Range is [0, 1] if the texture was created with normalized_coords=True (default), or [0, depth] if normalized_coords=False.

  • dtype – The return type (float, warp.vec2f, or warp.vec4f).

Returns:

The sampled value of the specified dtype.

Filtering mode is warp.TextureFilterMode.CLOSEST or warp.TextureFilterMode.LINEAR.