Archived

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

aker_jus

Slow sphere-mapping....

Recommended Posts

don''t enable tex-gen on the R and Q texture coords.

ie,
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);

NOT:
glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_R,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
glTexGeni(GL_Q,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);

etc.

and make sure you only enable S and T.

Share this post


Link to post
Share on other sites
Maybe you should post more details here. Some code would be great especially the fragment you have added and which caused the fps dropdown. What graphics card do you have and what driver version dou you have installed?

Share this post


Link to post
Share on other sites
My dev pc is an ATI radeon mobility (laptop), winxp home, 256 ram. I am loading a simple ms3d model and rendering it using sphere mapping and my fps drops by 100, thats it. When I disable it, it goes 100 up again. However, on my Nvidia pc, there is no much difference wether I use sphere mapping or not, speed is the same. I guess it is my drivers, right?

Share this post


Link to post
Share on other sites
Probably it is due to your laptop''s graphics card that doesn''t support sphere mapping by hardware and the driver must calculate the mapping coordinates in software. It can cause a performance drop by some amount especially on a slow machine but 100 fps is quite a lot. How many vertices has the model you are rendering? The more vertices the more computation must be done for sphere mapping to work.

Share this post


Link to post
Share on other sites
Oh yes, that must be it! Cause on my nvidia, it drops only an fps or so. My model is around 500 vertices, that is not the case. Definately my card, Radeon Mobility M6, with no hardware TL.

Share this post


Link to post
Share on other sites