glFogfv to glFogiv turns fog from white to black?
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};
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/
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/
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement