/*
* REGISTERABLE ENUM: SE_Image_Mapping_Method
*
* This data type specifies how to combine an <Image Mapping Function>
* instance's texture map with any <Colour> instances on the textured
* object.
*
* There are 4 methods: Replace, Decal, Modulate, and Blend.
*
* For most image signatures, only the Replace method is valid. The other 3
* image mapping methods are only defined for <Image> instances that have
* one of the following image signatures:
* SE_IMAGSIG_ALPHA
* SE_IMAGSIG_LUMINANCE
* SE_IMAGSIG_LUMINANCE_ALPHA
* SE_IMAGSIG_123COLOUR
* SE_IMAGSIG_123COLOUR_ALPHA
*
* When applying <Image> instances to an object, there are up to 4 sets of
* values to consider:
* - the current <Colour> and alpha (a.k.a. <Translucency>) of the object
*
* - the <Colour> and alpha defined by the <Image>
*
* - the image blend colour (if any) of the object; specified by one of its
* <Colour> components, if present
*
* - the final <Colour> and alpha of the object
*
* Based on what elements are defined in the image, here are the
* recommendations of the other 3 image mapping methods on how to
* combine the <Image>'s colour and alpha with the object's pre-existing
* values to produce the final displayed values. These recommendations
* are based on the number of colour and alpha elements defined in the
* applied <Image>:
*
* Type 1 - Only one Colour component (either a Luminance value or
* an Alpha value) is defined in each texel of the <Image>, the
* image_signature of which is either SE_IMAGSIG_LUMINANCE
* or SE_IMAGSIG_ALPHA.
*
* Type 2 - Two Colour components are defined (Luminance and Alpha) in each
* texel the <Image>, the image_signature of which is
* SE_IMAGSIG_LUMINANCE_ALPHA.
*
* Type 3 - A full colour triplet (but no Alpha) is defined in each texel of
* the <Image>, the image_signature of which is
* SE_IMAGSIG_123COLOUR.
*
* Type 4 - A full colour triplet and alpha are defined in each texel of the
* <Image>, the image_signature of which is
* SE_IMAGSIG_123COLOUR_ALPHA.
*
* Please note that in the following equations, it is *assumed* that
* (a) values are normalized for all components, and
* (b) if an object does not have an explicitly defined alpha, the alpha for
* that object is 1.
*
* Also, in the following equations, the calculation for Displayed Colour is
* actually done once for each of the components of colour model, using the
* respective colour components.
*/
typedef SE_Short_Integer SE_Image_Mapping_Method;
Enumerant | Definition | Value |
SE_IMAGMAPMETH_REPLACE |
For this image mapping method, no calculations are needed; the colour
and alpha (a.k.a. translucency) of the <Image> completely replace the
original colour and alpha of the object (if any).
|
1 |
SE_IMAGMAPMETH_DECAL |
For this method, the <Image> is essentially rendered on top of anything
already there, like a decal (hence the name).
For Type 1 and Type 2, the results are not defined.
For Type 3 - Displayed Colour = Image Colour
Displayed Alpha = Original Object Alpha
For Type 4 - Displayed Colour =
(1 - Image Alpha) * Original Object Colour +
(Image Alpha * Image Colour)
Displayed Alpha = Original Object Alpha
|
2 |
SE_IMAGMAPMETH_MODULATE |
For this method, the <Image>'s luminance (or colour) and alpha are
linearly combined with those of the original object.
For Type 1 Luminance - Displayed Colour = Image Luminance *
Original Object Colour
Displayed Alpha = Original Object Alpha
For Type 1 Alpha - Displayed Colour = Original Object Colour
Displayed Alpha = Original Object Alpha *
Image Alpha
For Type 2 - Displayed Colour = Image Luminance *
Original Object Colour
Displayed Alpha = Image Alpha * Original Object Alpha
For Type 3 - Displayed Colour = Image Colour *
Original Object Colour
Displayed Alpha = Original Object Alpha
For Type 4 - Displayed Colour = Image Colour *
Original Object Colour
Displayed Alpha = Image Alpha * Original Object Alpha
|
3 |
SE_IMAGMAPMETH_BLEND |
For this method, the image blend colour of the object determines how
the <Image> is combined with the object's primary colour.
For Type 1 Luminance - Displayed Colour =
(1 - Image Luminance) *
Original Object Colour +
(Image Luminance * Blend Colour)
Displayed Alpha = Original Object Alpha
For Type 1 Alpha - Displayed Colour = Original Object Colour
Displayed Alpha = Original Object Alpha *
Image Alpha
For Type 2 - Displayed Colour =
(1 - Image Luminance) * Original Object Colour +
(Image Luminance * Blend Colour)
Displayed Alpha = Original Object Alpha * Image Alpha
For Type 3 - Displayed Colour =
(1 - Image Colour) * Original Object Colour +
(Blend Colour * Image Colour)
Displayed Alpha = Original Object Alpha
For Type 4 - Displayed Colour =
(1 - Image Colour) * Original Object Colour +
(Blend Colour * Image Colour)
Displayed Alpha = Original Object Alpha * Image Alpha
|
4 |
Prev: SE_Image_Component_Type.
Next: SE_Image_MIP_Extents.
Return to:
Top of this Page,
Type Index