겨울팥죽 여름빙수
article thumbnail
GLSL, OpenGLES2.0 glFog

OpenGLES2.0 not support glFog. So If you want fog effect, you have to a code using glsl. 1. Calculate GL_FOG_MODE have 3 modes. GL_LINEAR : f = (end - z)/(end - start) GL_EXP : f = exp(-density*z) GL_EXP2 : f = exp2(-(density*z)*(density*z)) Color = Color_source*f + (1-f)Color_fog start - fog start distionce(usually 0.0f) end - fog's end distance (usually 1.0f) Color_source is fragment color. Co..