Represents a texture tile in a texture atlas.
struct
|
TextureTile
|
In order to get correct texture coordinates, the following steps must be performed:
X
,
Y
and
Z
to
tile
texture
coordinates
S
and
T
:
S := ([X, Y, Z] * U + Offset.X) + Offset.Z T := ([X, Y, Z] * V + Offset.Y) + Offset.WThe Z and W components of Offset hold the float delta of X resp. Y (see FloatDelta). On the CPU, tile texture coordinates can be computed by using one of the
Compute
methods.
S
and
T
to
Bounds
in
order
to
avoid
color
bleeding
at
the
tile
edges:
Bounds.X <= S <= Bounds.Y Bounds.Z <= T <= Bounds.WClamping should be done on the GPU to avoid distortions between vertex positions and texture coordinates.
See also:
VertexFormat.HeightmapCoordinatesOutput texturing coefficient vector (see remarks).
public
readonly
field
|
Bounds
|
||
type
|
Vec4F
|
Output texturing coefficient vector (see remarks).
public
readonly
field
|
Offset
|
||
type
|
Vec4F
|
The
texture
to
use
or
null
if
the
texture
for
the
given
pyramid
tile
is
not
ready
yet
or
does
not
exist.
public
readonly
field
|
Texture
|
||
type
|
ITexture2D
|
Output texturing coefficient vector (see remarks).
public
readonly
field
|
U
|
||
type
|
Vec3F
|
Output texturing coefficient vector (see remarks).
public
readonly
field
|
V
|
||
type
|
Vec3F
|
Computes
texture
tile
coordinates
S
and
T
.
[Pure]
|
||||
public
method
|
Compute
(Vec3D coords)
|
|||
type
|
Vec2F
|
|||
params
|
coords
|
Cubemap coordinates, in the range [0..1]. | ||
returns
|
The texture tile coordinates. |
Computes
texture
tile
coordinates
S
and
T
.
[Pure]
|
||||
public
method
|
Compute
(Vec3I coords,
int32 n = MappingUtil.MaxSize)
|
|||
type
|
Vec2F
|
|||
params
|
coords
|
Cubemap coordinates. | ||
n
|
Maximum cubemap coordinate. Defaults to MaxSize. | |||
returns
|
The texture tile coordinates. |
Computes
texture
tile
coordinates
S
and
T
.
[Pure]
|
||||
public
method
|
Compute
(float64 x,
float64 y,
float64 z)
|
|||
type
|
Vec2F
|
|||
params
|
x
|
Cubemap X-coordinate, in the range [0..1]. | ||
y
|
Cubemap Y-coordinate, in the range [0..1]. | |||
z
|
Cubemap Z-coordinate, in the range [0..1]. | |||
returns
|
The texture tile coordinates. |
Computes
texture
tile
coordinates
S
and
T
.
[Pure]
|
||||
public
method
|
Compute
(int32 x,
int32 y,
int32 z,
int32 n = MappingUtil.MaxSize)
|
|||
type
|
Vec2F
|
|||
params
|
x
|
Cubemap X-coordinate. | ||
y
|
Cubemap Y-coordinate. | |||
z
|
Cubemap Z-coordinate. | |||
n
|
Maximum cubemap coordinate. Defaults to MaxSize. | |||
returns
|
The texture tile coordinates. |