Thema: Delphi OpenGL: Verdunkeln

Einzelnen Beitrag anzeigen

Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#10

AW: OpenGL: Verdunkeln

  Alt 7. Jul 2012, 18:15
Das Problem dabei ist, wenn ich z.B. habe:
glColor3f(0, 240, 233);

und dann als dunkle variante mache:
glColor3f(0, 213, 206);

funzt das nich weil er nicht von 255 ausgeht sondern von 213 wenn 213 das höchste ist.
Das heißt er rechnet nur Prozentual - und das möchte ich vermeiden.
Die Parameter von glColor3f gehen von 0.0 bis 1.0, nicht von 0 bis 255.

Zitat von OpenGl-Spezifikation:
Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and 0 maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0 . [...]

Floating-point values are mapped directly.
Das was in fett geschrieben ist, passiert bei dir.
  Mit Zitat antworten Zitat