21.06.2014 Views

OpenGL 4.1 (Compatibility Profile) - July 25, 2010

OpenGL 4.1 (Compatibility Profile) - July 25, 2010

OpenGL 4.1 (Compatibility Profile) - July 25, 2010

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.1. OPENGL FUNDAMENTALS 8<br />

point operations are accurate to about 1 part in 10 5 . The maximum representable<br />

magnitude of a floating-point number used to represent positional, normal, or texture<br />

coordinates must be at least 2 32 ; the maximum representable magnitude for<br />

colors must be at least 2 10 . The maximum representable magnitude for all other<br />

floating-point values must be at least 2 32 . x · 0 = 0 · x = 0 for any non-infinite and<br />

non-NaN x. 1 · x = x · 1 = x. x + 0 = 0 + x = x. 0 0 = 1. (Occasionally further<br />

requirements will be specified.) Most single-precision floating-point formats meet<br />

these requirements.<br />

The special values Inf and −Inf encode values with magnitudes too large to<br />

be represented; the special value NaN encodes “Not A Number” values resulting<br />

from undefined arithmetic operations such as 0 0<br />

. Implementations are permitted,<br />

but not required, to support Inf s and NaN s in their floating-point computations.<br />

Any representable floating-point value is legal as input to a GL command that<br />

requires floating-point data. The result of providing a value that is not a floatingpoint<br />

number to such a command is unspecified, but must not lead to GL interruption<br />

or termination. In IEEE arithmetic, for example, providing a negative zero or a<br />

denormalized number to a GL command yields predictable results, while providing<br />

a NaN or an infinity yields unspecified results.<br />

16-Bit Floating-Point Numbers<br />

A 16-bit floating-point number has a 1-bit sign (S), a 5-bit exponent (E), and a<br />

10-bit mantissa (M). The value V of a 16-bit floating-point number is determined<br />

by the following:<br />

⎧<br />

(−1) S × 0.0, E = 0, M = 0<br />

⎪⎨ (−1) S × 2 −14 × M , E = 0, M ≠ 0<br />

2 10<br />

V = (−1) S × 2 E−15 × ( 1 + M )<br />

2 , 0 < E < 31<br />

10<br />

(−1)<br />

⎪⎩<br />

S × Inf , E = 31, M = 0<br />

NaN , E = 31, M ≠ 0<br />

If the floating-point number is interpreted as an unsigned 16-bit integer N, then<br />

⌊ ⌋<br />

N mod 65536<br />

S =<br />

32768<br />

⌊ ⌋<br />

N mod 32768<br />

E =<br />

1024<br />

M = N mod 1024.<br />

<strong>OpenGL</strong> <strong>4.1</strong> (<strong>Compatibility</strong> <strong>Profile</strong>) - <strong>July</strong> <strong>25</strong>, <strong>2010</strong>

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

Saved successfully!

Ooh no, something went wrong!