#include <PainterMultitexture.h>
Inheritance diagram for PainterMultitexture:
Public Methods | |
PainterMultitexture () | |
Initialize the object with defaults. | |
virtual void | paintMesh (const Mesh &mesh, const Vector &eye, const Vector &light) const |
Draw the Mesh using multitextures. | |
virtual void | paintTriangle (const Triangle &triangle, const Vector &eye, const Vector &light) const |
Draw a Triangle taking into account the texture coordinate perturbation. | |
Private Attributes | |
bool | m_perturbTextureCoordinates |
If true, perturb the current texture coordinates towards the light. |
The drawing process uses the multitexture facilities of the card in order to render the detail and bumpmap layers.
|
Draw the Mesh using multitextures. This method uses the multitexture facilities of the card:
Reimplemented from Painter. |
|
Draw a Triangle taking into account the texture coordinate perturbation. For every vertex, compute the Vector connecting that vertex to the light. Bring that Vector into tangent space using Triangle#getObjectToTangentSpaceMatrix. Once in tangent space, the X and Y coordinates represent the amount by which the bumpmap texture should be perturbed before subtracted from itself in order to compute the heightmap. This can be intuitively understood as follows: if the light is perpendicular to our texture (colinear with the face normal) at the current vertex, then the texture should not be perturbed at all: when the light (=normal) is brought into tangent space, it corresponds to the Z axis, that is to the vector (0, 0, 1). The X and Y coordinates of the light (=normal) do not perturb the texture. Reimplemented from Painter. |
|
If true, perturb the current texture coordinates towards the light. This value is set to true in paintMesh in order to perturb the current layer towards the light in such a way that, when it is blended against the layer underneath, it adds or subtracts to produce a normalmap. |