Archived

This topic is now archived and is closed to further replies.

kimryo

glTexImage2D

Recommended Posts

kimryo    100
for(i = 255; i >= 0; i--) { int j; for(j = 0; j < 256; j++) { int m=(int)(255-sqrt(i*i+(255-j)*(255-j))+0.5); if(m<0) m=0; fog_texture[i * 256 + j] = m; } } glGenTextures(1, &planar_fog); //... glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE , 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, fog_texture); What coversion work is been done by glTexImage2D API with GL_LUMINANCE flag to convert my fog_texture array''s data into actucal texels? Thanks. We create world.

Share this post


Link to post
Share on other sites