PDA

View Full Version : GL_SPHERE_MAP



~Lip~
05-19-2011, 02:55 AM
http://143.89.38.172/Download/GoldDull.bmp

Dear all,
Here is an GL_SPHERE_MAP question. I am doing two different viewport displaying but I got a problem on texture map (SPHERE_MAP). I drew a block and texture it with the figure above and I got a different result while both of the views were using GL_SPHERE_MAP as shown in the second figure below. Can anyone tell why would it behaved like this?

http://143.89.38.172/Download/Texture5.png

V-man
05-19-2011, 07:07 AM
Let's look at how GL_SPHERE_MAP works.
http://www.opengl.org/wiki/Mathematics_of_glTexGen

The modelview effects it. And the normals of your vertices effect it. Perhaps you should use a smoothed texture map instead of yellow/green-blue

dorbie
05-19-2011, 11:15 AM
There's not enough detail in your question.

Was this a different graphics card, a different type of projection, a different texture format.

What are the key differences between the rendering to each viewport?

~Lip~
05-19-2011, 08:10 PM
Thanks bro,
It was discovered accidentally when I used a shape feature texture to do texture mapping. You should be right in the sense that my shader does not turned into GL_SMOOTH. But I enabled this code when I turned on the lights.
So the reason is still not clear.

~Lip~
05-19-2011, 08:14 PM
Thanks dorbie,

I programed an application which it can provide two standalone windows with their own viewport. Other than the viewport belongs to different windows, the projection(ORTHO), texture format(WithMipmap) and the lighting(Default) were the same.

~Lip~
05-19-2011, 10:07 PM
Oh dear, I found out the reason.
Itz so simple not related to anything of the setting.
Arhahahaha, based on the logic of sphere map, you can find the answer from the images at the thread Texture non-smoothing (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=297555#Post2975 55) .
Anyway, if anyone wants the answer, message me.