Projective texture mapping

Projective texture mapping

Projective texture mapping is a method of texture mapping that allows a textured image to be projected onto a scene as if by a slide projector. Projective texture mapping is useful in a variety of lighting techniques and it's the starting point for shadow mapping.

Projective texture mapping is essentially a special matrix transformation which is performed per-vertex and then linearly interpolated as standard texture mapping.

Fixed function pipeline approach

Historicallyref|nvsdk_ptm, using projective texture mapping involved considering a special form of eye linear texture coordinate generationref|glEyeLinear transform ("tcGen" for short). This transform was then multiplied by another matrix representing the projector's properties which was stored in texture coordinate transform matrixref|glTCXform. The resulting concatenated matrix was basically a function of both projector properties and vertex eye positions.

The key points of this approach are that eye linear tcGen is a function of vertex eye coordinates, which is a result of both eye properties and object space vertex coordinates (more specifically, the object space vertex position is transformed by the model-view-projection matrix).Because of that, the corresponding texture matrix can be used to "shift" the eye properties so the concatenated result is the same as using an eye linear tcGen from a point of view which can be different from the observer.

Programmable pipeline approach

A less involved method to compute this approach became possible with vertex shaders. Readers are encouraged to check this method is essentially the same as before.For readers not familiar with this newer graphics technology, this feature allows to override the default vertex and pixel processing allowing a user defined program to be used.

The previous algorithm can then be reformulated by simply considering two model-view-projection matrices: one from the eye point of view and the other from the projector point of view.

In this case, the projector model-view-projection matrix is essentially the aforementioned concatenation of eye-linear tcGen with the intended projector shift function.By using those two matrices, a few instructions are sufficient to output the transformed eye space vertex position and a projective texture coordinate. This coordinate is simply obtained by considering the projector's model-view-projection matrix: in other words, this is the eye-space vertex position if the considered projector would have been an observer.

Caveats

In both the proposed approaches there are two little problems which can be trivially solved and comes from the different conventions used by eye space and texture space.

Defining properties of those spaces is beyond the scope of this article but it's well known that textures should usually be addressed in the range [0..1] while eye space coordinates are addressed in the range [-1..1] .According to the used texture wrap mode various artifacts may occur but it's obvious a shift and scale operation is definitely necessary to get the expected result.

The other problem is actually a mathematical issue. It is well known the matrix math used produces a back projection. This artifact has historically been avoided by using a special black and white texture to cut away unnecessary projecting contributions. Using pixel shaders a different approach can be used: a coordinate check is sufficient to discriminate between forward (correct) contributions and backward (wrong, to be avoided) ones.

References

# The [http://developer.nvidia.com/object/Projective_Texture_Mapping.html original paper] from the [http://developer.nvidia.com nVIDIA developer web site] includes all the needed documentation on this issue. The same site also contains [http://developer.nvidia.com/object/projective_textures.html additional hints] .
# Texture coordinate generation is covered in section 2.11.4 "Generating Texture Coordinates" from the [http://www.opengl.org/documentation/specs/ OpenGL 2.0 specification] . Eye linear texture coordinate generation is a special case.
# Texture matrix is introduced in section 2.11.2 "Matrices" of the [http://www.opengl.org/documentation/specs/ OpenGL 2.0 specification] .


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Cube mapping — The lower left image shows a scene with a viewpoint marked with a black dot. The upper image shows the net of the cube mapping as seen from that viewpoint, and the lower right image shows the cube superimposed on the original scene. In computer… …   Wikipedia

  • Shadow mapping — or projective shadowing is a process by which shadows are added to 3D computer graphics. This concept was introduced by Lance Williams in 1978, in a paper entitled Casting curved shadows on curved surfaces . Since then, it has been used both in… …   Wikipedia

  • Subsurface scattering — (or SSS) is a mechanism of light transport in which light penetrates the surface of a translucent object, is scattered by interacting with the material, and exits the surface at a different point. The light will generally penetrate the surface… …   Wikipedia

  • Подповерхностное рассеивание — Трёхмерная модель бюста, в освещении которого задействовано подповерхностное рассеивание …   Википедия

  • 3D projection — Part of a series on …   Wikipedia

  • 3D en informatique — Infographie 3D La synthèse d image 3D souvent abrégée 3D (3D pour Trois Dimensions : x,y,z, les trois axes qui constituent le repère orthonormé de la géométrie dans l espace) est un ensemble de techniques notamment issues de la CAO qui… …   Wikipédia en Français

  • 3D sur ordinateur — Infographie 3D La synthèse d image 3D souvent abrégée 3D (3D pour Trois Dimensions : x,y,z, les trois axes qui constituent le repère orthonormé de la géométrie dans l espace) est un ensemble de techniques notamment issues de la CAO qui… …   Wikipédia en Français

  • Infographie 3D — Image réaliste réalisée avec Maya et Mental Ray La synthèse d image 3D souvent abrégée 3D (3D pour Trois Dimensions : x,y,z, les trois axes qui constituent le repère orthonormé de la géométrie dans l espace) est un ensemble de techniques… …   Wikipédia en Français

  • Synthese d'image 3D — Infographie 3D La synthèse d image 3D souvent abrégée 3D (3D pour Trois Dimensions : x,y,z, les trois axes qui constituent le repère orthonormé de la géométrie dans l espace) est un ensemble de techniques notamment issues de la CAO qui… …   Wikipédia en Français

  • Synthèse d'image 3D — Infographie 3D La synthèse d image 3D souvent abrégée 3D (3D pour Trois Dimensions : x,y,z, les trois axes qui constituent le repère orthonormé de la géométrie dans l espace) est un ensemble de techniques notamment issues de la CAO qui… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”