Projective texture mapping: Difference between revisions

Content deleted Content added
AWB Assisted clean up
m sp (2): a eye→an eye, familar→familiar
Line 1:
'''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 (mathematics)|matrix]] [[Coordinate_systemCoordinate system#Transformations|transformation]] which is performed per-vertex and then linearly interpolated as standard texture mapping.
 
{{divbox|yellow|Highly technical reading|The following content assumes the reader is confident with real time [[3d computer graphics]] and related technologies such as the involved processing in [[graphics processing unit]]s, with a basic mathematical background. Knowledge of the [[OpenGL]] API is encouraged, although not required.}}
Line 9:
 
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 aan 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 familarfamiliar 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.
Line 23:
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.