Effect describing the texture to be used when drawing the associated part data. More...
Public Types | |
enum | SamplerWrapMode { REPEAT, CLAMP_TO_EDGE, CLAMP_TO_BORDER, MIRRORED_REPEAT } |
Specifies what should happen to texture coordinates that are outside the 0 to 1 range. More... | |
enum | SamplerFilter { NEAREST, LINEAR, NEAREST_MIPMAP_NEAREST, LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR, LINEAR_MIPMAP_LINEAR } |
Specifies the minifying and magnification filtering used when doing the texture mapping. More... | |
![]() | |
enum | Type { COLOR, OPACITY, FRONT_AND_BACK_COLOR, FRONT_AND_BACK_OPACITY, TEXTURE, EYE_LIFT, POLYGON_OFFSET, HALO, LIGHTING, LINE_WIDTH, POINT_SIZE } |
Enumerator for each of the available effect types. More... | |
Public Member Functions | |
EffectTexture () | |
Constructs an empty effect. More... | |
EffectTexture (const Image *textureImage) | |
Constructs a texture effect with the given image. More... | |
virtual Type | type () const |
Returns Effect::TEXTURE. More... | |
virtual PtrRef< Effect > | clone () |
Clones the effect. More... | |
const Image * | image () const |
Returns the image used to texture the part. More... | |
void | setImage (const Image *textureImage) |
Specifies the image used to texture the part. More... | |
SamplerWrapMode | samplerWrapMode () const |
Returns the wrapping mode to use for textures when the texture coordinate is outside the 0 to 1 range. More... | |
void | setSamplerWrapMode (SamplerWrapMode wrapMode) |
Specifies what should happen to texture coordinates that are outside the 0 to 1 range. More... | |
SamplerFilter | samplerMinifyingFilter () const |
Returns the minifying filter function used for the texture mapping. More... | |
void | setSamplerMinifyingFilter (SamplerFilter filterType) |
Specifies the minifying filter function to use in the texture sampler when doing texture mapping. More... | |
SamplerFilter | samplerMagnificationFilter () const |
Returns the magnification filter function used for the texture mapping. More... | |
void | setSamplerMagnificationFilter (SamplerFilter filterType) |
Specifies the magnify filter function to use in the texture sampler when doing texture mapping. More... | |
Color4f | borderColor () const |
Returns the border color to use when wrapping is set to CLAMP_TO_BORDER. More... | |
void | setBorderColor (const Color4f &color) |
Sets the border color to use when wrapping is set to CLAMP_TO_BORDER. More... | |
float | ambientIntensity () const |
Returns the ambient intensity of the color. More... | |
void | setAmbientIntensity (float intensity) |
Specifies the ambient intensity of the color. More... | |
float | specularIntensity () const |
Returns the specular intensity of the color. More... | |
void | setSpecularIntensity (float intensity) |
Specifies the specular intensity of the color. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
Static Public Member Functions | |
static PtrRef< EffectTexture > | createResultMapping (const Image *textureImage) |
Create a texture effect that is suitable to use with a ScalarMapper. More... | |
Additional Inherited Members | |
![]() | |
Effect () | |
Constructs an empty part effect of a given type. More... | |
Effect describing the texture to be used when drawing the associated part data.
May be overridden by the following effects if found further up the stack:
Supported by the following part data:
Specifies the minifying and magnification filtering used when doing the texture mapping.
Specifies what should happen to texture coordinates that are outside the 0 to 1 range.
Enumerator | |
---|---|
REPEAT |
The integer part of the coordinate will be ignored and a repeating pattern is formed. |
CLAMP_TO_EDGE |
The texture coordinates will be clamped into the range 0 to 1. |
CLAMP_TO_BORDER |
The coordinates that fall outside the 0 to 1 range will be given the borderColor(). |
MIRRORED_REPEAT |
The texture will also be repeated, but it will be mirrored when the integer part of the coordinate is odd. |
cee::geo::EffectTexture::EffectTexture | ( | ) |
Constructs an empty effect.
cee::geo::EffectTexture::EffectTexture | ( | const Image * | textureImage | ) |
Constructs a texture effect with the given image.
float cee::geo::EffectTexture::ambientIntensity | ( | ) | const |
Returns the ambient intensity of the color.
1.0f is max intensity 0.0f is min intensity
cee::Color4f cee::geo::EffectTexture::borderColor | ( | ) | const |
Returns the border color to use when wrapping is set to CLAMP_TO_BORDER.
Clones the effect.
Implements cee::geo::Effect.
|
static |
Create a texture effect that is suitable to use with a ScalarMapper.
The method creates an EffectTexture and then configures the following settings:
const Image * cee::geo::EffectTexture::image | ( | ) | const |
Returns the image used to texture the part.
EffectTexture::SamplerFilter cee::geo::EffectTexture::samplerMagnificationFilter | ( | ) | const |
Returns the magnification filter function used for the texture mapping.
EffectTexture::SamplerFilter cee::geo::EffectTexture::samplerMinifyingFilter | ( | ) | const |
Returns the minifying filter function used for the texture mapping.
EffectTexture::SamplerWrapMode cee::geo::EffectTexture::samplerWrapMode | ( | ) | const |
Returns the wrapping mode to use for textures when the texture coordinate is outside the 0 to 1 range.
void cee::geo::EffectTexture::setAmbientIntensity | ( | float | intensity | ) |
Specifies the ambient intensity of the color.
1.0f is max intensity 0.0f is min intensity
void cee::geo::EffectTexture::setBorderColor | ( | const Color4f & | color | ) |
Sets the border color to use when wrapping is set to CLAMP_TO_BORDER.
Any pixel with a texture coordinate outside the 0 to 1 range will get this color.
void cee::geo::EffectTexture::setImage | ( | const Image * | textureImage | ) |
Specifies the image used to texture the part.
void cee::geo::EffectTexture::setSamplerMagnificationFilter | ( | SamplerFilter | filterType | ) |
Specifies the magnify filter function to use in the texture sampler when doing texture mapping.
The texture coordinates are independent of the texture resolution. This method specifies what do when the texture is magnified, i.e. getting a bigger resolution in pixels on the screen than the original image. There are two options: LINEAR will do an weighted average of the 4 pixels surrounding the given coordinates. NEAREST will just pick the pixel closest to the coordinates.
The default value is EffectTexture::LINEAR.
void cee::geo::EffectTexture::setSamplerMinifyingFilter | ( | SamplerFilter | filterType | ) |
Specifies the minifying filter function to use in the texture sampler when doing texture mapping.
The texture coordinates are independent of the texture resolution. This method specifies what do when the texture is minified, i.e. getting a smaller resolution in pixels on the screen than the original image.
The default value is EffectTexture::LINEAR_MIPMAP_LINEAR
void cee::geo::EffectTexture::setSamplerWrapMode | ( | SamplerWrapMode | wrapMode | ) |
Specifies what should happen to texture coordinates that are outside the 0 to 1 range.
The SamplerWrapMode defines how to handle texture coordinates that are outside the 0 to 1 range.
The default value is EffectTexture::REPEAT.
void cee::geo::EffectTexture::setSpecularIntensity | ( | float | intensity | ) |
Specifies the specular intensity of the color.
1.0f is max intensity 0.0f is min intensity
float cee::geo::EffectTexture::specularIntensity | ( | ) | const |
Returns the specular intensity of the color.
1.0f is max intensity 0.0f is min intensity
|
virtual |
Returns Effect::TEXTURE.
Implements cee::geo::Effect.