Base interface for classes that represent textures for 3D models.
interface
|
IModelTexture
|
extends
|
IConfigurable
|
||
IPreloadingResourceHandle
|
|||||
base of
|
ModelTexture
|
IModelTexture objects act as resource handles and produce ITexture2D resource objects.
Does this resource handle support preloading?
property
|
CanPreloadResource
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
preloading
is
supported
(i.e.
PreloadResource
will
never
return
null ),
false
if
preloading
is
not
supported
(i.e.
PreloadResource
always
returns
null ).
|
||
inherited
|
IPreloadingResourceHandle.CanPreloadResource
|
The preferred format to use for this model texture.
property
|
PreferredTextureFormat
{
get
}
|
||
type
|
TextureFormat
|
||
value
|
The
preferred
texture
format
or
null . |
Creates a new resource object, using the given graphics context.
[OwnerReturn]
|
||||
method
|
CreateResource
(Graphics graphics)
|
|||
type
|
IResource
|
|||
params
|
graphics
|
[not-null]
|
The graphics context to use. | |
returns
|
The
resource
object
or
null . |
|||
inherited
|
IResourceHandle.CreateResource
|
Remarks:
Resource objects may implement the IMemoryConsumption interface. In this case, the reported memory consumption will be interpreted as an estimate on how much GPU memory is consumed by the resource. This estimate can then be used for resource caching (e.g. CacheMemory).
Compares this object with the given one.
[Pure]
|
||||
method
|
Equals
(T other)
|
|||
type
|
bool
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
true
if
this
object
is
equal
to
other,
false
if
not.
|
|||
inherited
|
IEquatable.Equals
|
Preloads resource data, without creating the resource object.
[OwnerReturn, ThreadSafe]
|
||||
method
|
PreloadResource
()
|
|||
type
|
IResourceData
|
|||
returns
|
The
preloaded
resource
data
or
null
if
this
resource
handle
does
not
support
resp.
require
preloading.
|
|||
inherited
|
IPreloadingResourceHandle.PreloadResource
|
Remarks:
Calling CreateResource on the returned resource will perform no additional loading, which means that all necessary data is already present in memory.
Reads elevation data.
method
|
ReadElevation
(PixelRange range)
|
||
type
|
ElevationBuffer
|
||
params
|
range
|
The pixel range to use (see ScanlineRange). | |
returns
|
|
The elevation data. |
Reads pixel data.
method
|
ReadPixels
()
|
||
type
|
ColorBuffer
|
||
returns
|
The
pixel
data
or
null
if
not
found. |
Reads texture data.
[OwnerReturn]
|
||||
method
|
ReadTexels
()
|
|||
type
|
TexelBuffer
|
|||
returns
|
The
texture
data
or
null
if
not
found. |
Returns the configuration value that describes this object.
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
inherited
|
IConfigurable.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
Interprets this model texture as a bump map and computes a normal map from it.
method
|
NormalMap
(float64 height = 0.01)
|
||
type
|
IModelTexture
|
||
params
|
height
|
[>0]
|
The
relative
bump
height
(see
remarks).
Defaults
to
0.01f .
|
returns
|
|
The resulting model texture. |
Remarks:
Black
pixels
lie
in
the
XY
plane
(see
figure),
white
pixels
are
at
the
given
height.
The
height
is
specified
relative
to
the
size
of
this
texture
(i.e.
maximum
of
width
and
height),
e.g.
a
value
of
1
would
turn
the
cuboid
below
into
a
cube.
............. .: .: Z+ . : . : | . +--------.--+-- X+ |. / . / ............. / : / : / :/ :/ +-----------+ / Y+