A batch for smooth texturing of a mesh sector.
struct
|
TexturingBatch
|
implements
|
IComparable<TexturingBatch>
|
||
IEquatable<TexturingBatch>
|
TexturingBatch values have this sort order:
The associated TextureAtlas object.
public
readonly
field
|
Atlas
|
||
type
|
TextureAtlas
|
The parent mesh sector.
public
readonly
field
|
BaseSector
|
||
type
|
int32
|
The base texture to use, as returned by TileLookup.
public
readonly
field
|
BaseTexture
|
||
type
|
int32
|
The mesh sector batch.
public
readonly
field
|
Batch
|
||
type
|
SectorBatch
|
Coefficient vector for distance-based texture tile blending on the GPU.
public
readonly
field
|
Blend0
|
||
type
|
Vec4F
|
Remarks:
Tile blending is necessary in order to avoid visible artifacts due to swapping of texture tiles; it can be performed on the GPU with the Blend0 and Blend1 coefficients according to this formula:
/ 1 \ | u | f = | v | * (Blend0 / x + Blend1) \ u*v / pixel = (1 - f) * S0 + (factor) * S1; Values on the GPU: u, v : texture coordinates x : Distance between camera and vertex S0 : Sample of parent texture tile S1 : Sample of child texture tile Blend0 : Shader constant (per-texture state) Blend1 : Shader constant (per-texture state)The texture coordinates
u
and
v
have
been
set
up
with
TileSetup
and
been
computed
on
the
GPU
as
described
there.
The
blend
factor
f
can
optionally
be
modified
by
a
smoothstep
function
(e.g.
SmootherStep).
This
will
make
the
transition
slope
steeper
at
the
center.
Additionally,
the
texture
tile
age
(see
TileFadeReset
and
TileFadeFactor)
can
be
used
to
fade
in
freshly
loaded
tiles.
Coefficient vector for distance-based texture tile blending on the GPU.
public
readonly
field
|
Blend1
|
||
type
|
Vec4F
|
Remarks:
See remarks of Blend0 for details.
The pyramid tile coordinates of this texturing batch.
public
readonly
field
|
Coords
|
||
type
|
PyramidCoords
|
The texture to use, as returned by TileLookup.
public
readonly
field
|
Texture
|
||
type
|
int32
|
public
method
|
CompareTo
(TexturingBatch other)
|
||
type
|
int32
|
||
params
|
other
|
public
method
|
Equals
(TexturingBatch other)
|
||
type
|
bool
|
||
params
|
other
|