HarryB
03-04-2005, 11:08 PM
Hi,
I have a problem with texture mapping on a sphere: I can't get the shading to be smooth at the polygon edges. I use the commands
glTexImage2D(GL_TEXTURE_2D,0,3,p_dib->Width(),p_dib->Height(),0,GL_BGR_EXT,GL_UNSIGNED_BYTE,(GLvoid *)p_dib->GetBits());
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//GL_DECAL);
glEnable( GL_TEXTURE_2D );
and then map the bitmap on the polygons of the wireframe sphere. It looks good until I zoom in. Then I can distinguish the individual polygon shapes, which I don't want.
Can anybody give me a hint on how to get the mapping smooth?
Thanks in advance,
Harry
I have a problem with texture mapping on a sphere: I can't get the shading to be smooth at the polygon edges. I use the commands
glTexImage2D(GL_TEXTURE_2D,0,3,p_dib->Width(),p_dib->Height(),0,GL_BGR_EXT,GL_UNSIGNED_BYTE,(GLvoid *)p_dib->GetBits());
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//GL_DECAL);
glEnable( GL_TEXTURE_2D );
and then map the bitmap on the polygons of the wireframe sphere. It looks good until I zoom in. Then I can distinguish the individual polygon shapes, which I don't want.
Can anybody give me a hint on how to get the mapping smooth?
Thanks in advance,
Harry