Advertisement

glFogfv to glFogiv turns fog from white to black?

Started by September 04, 2004 05:15 PM
1 comment, last by lc_overlord 20 years, 2 months ago
I decided to use glFogiv instead of glFogfv and my fog went from white to black! Before (white fog): float fog_color[4] = { 1.0, 1.0, 1.0, 1.0 }; glEnable(GL_FOG); glFogfv(GL_FOG_COLOR, fog_color); After (black fog): const int fog_col[4] = { 255, 255, 255, 255 }; glEnable(GL_FOG); glFogiv(GL_FOG_COLOR, fog_col); Anyone know why? Many thanks Kerr
Quote:
MSND:
Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to –1.0.


I always use floats,so I'm not really sure,but I think that means that you have to write this:

const int fog_col[4] = {2147483647,2147483647,2147483647,2147483647};
Advertisement
allways refer to this site when something goes wrong
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/
Extentions are allso allways fun to use
http://oss.sgi.com/projects/ogl-sample/registry/

This topic is closed to new replies.

Advertisement