Content deleted Content added
The article is poorly written however, and reader ratings agree with this. I'm not sure if this is the right tag. |
m →Programmable pipeline approach: Fixed typo Tags: canned edit summary Mobile edit Mobile app edit Android app edit App section source |
||
(6 intermediate revisions by 6 users not shown) | |||
Line 1:
{{confusing|date=March 2012}}
{{Tone|date=April 2022}}
'''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 is the starting point for [[shadow mapping]].
Line 5 ⟶ 6:
== Fixed function pipeline approach ==
Historically{{ref|nvsdk_ptm}}, using projective texture mapping involved considering a special form of eye linear texture coordinate generation{{ref|glEyeLinear}} transform (''tcGen'' for short). This transform was then multiplied by another matrix representing the projector's properties which
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
== Programmable pipeline approach ==
A less involved method to compute this approach became possible with [[vertex shaders]].
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
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.
Line 28:
== References ==
#{{note|nvsdk_ptm}} The [http://
#{{note|glEyeLinear}} 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.
#{{note|glTCXFform}} Texture matrix is introduced in section 2.11.2 "Matrices" of the [http://www.opengl.org/documentation/specs/ OpenGL 2.0 specification].
|