21.06.2014 Views

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.10. TEXTURING 330<br />

Major Axis Direction Target s c t c m a<br />

+r x TEXTURE_CUBE_MAP_POSITIVE_X −r z −r y r x<br />

−r x TEXTURE_CUBE_MAP_NEGATIVE_X r z −r y r x<br />

+r y TEXTURE_CUBE_MAP_POSITIVE_Y r x r z r y<br />

−r y TEXTURE_CUBE_MAP_NEGATIVE_Y r x −r z r y<br />

+r z TEXTURE_CUBE_MAP_POSITIVE_Z r x −r y r z<br />

−r z TEXTURE_CUBE_MAP_NEGATIVE_Z −r x −r y r z<br />

Table 3.23: Selection of cube map images based on major axis direction of texture<br />

coordinates.<br />

3.10.10 Cube Map Texture Selection<br />

When cube map texturing is enabled, the ( s t r ) texture coordinates are treated<br />

as a direction vector ( )<br />

r x r y r z emanating from the center of a cube. The<br />

q coordinate is ignored. If the q coordinate is negative, then the values of the<br />

direction vector become undefined. At texture application time, the interpolated<br />

per-fragment direction vector selects one of the cube map face’s two-dimensional<br />

images based on the largest magnitude coordinate direction (the major axis direction).<br />

If two or more coordinates have the identical magnitude, the implementation<br />

may define the rule to disambiguate this situation. The rule must be deterministic<br />

and depend only on ( )<br />

r x r y r z . The target column in table 3.23 explains how<br />

the major axis direction maps to the two-dimensional image of a particular cube<br />

map target.<br />

Using the s c , t c , and m a determined by the major axis direction as specified in<br />

table 3.23, an updated ( s t ) is calculated as follows:<br />

s = 1 ( )<br />

sc<br />

2 |m a | + 1<br />

t = 1 ( )<br />

tc<br />

2 |m a | + 1<br />

Seamless Cube Map Filtering<br />

Seamless cube map filtering is enabled or disabled by calling Enable or Disable,<br />

respectively, with the symbolic constant TEXTURE_CUBE_MAP_SEAMLESS.<br />

When seamless cube map filtering is disabled, the new ( s t ) is used to find a<br />

texture value in the determined face’s two-dimensional image using the rules given<br />

in sections 3.10.11 through 3.10.12.<br />

<strong>OpenGL</strong> <strong>4.2</strong> (<strong>Compatibility</strong> <strong>Profile</strong>) - <strong>April</strong> <strong>27</strong>, <strong>2012</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!