Jump to content
  • Advertisement
Sign in to follow this  

OpenGL sampler1D not working in CG

This topic is 3295 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm writing openGL-CG program. I want to use sampler1D in my shader program and I enable it like this:
       fresnelMapHandle = cgGetNamedParameter(shaderFP_water, "fresnelMap");
       cgGLSetTextureParameter(fresnelMapHandle, fresnelMapTex);
In fragment program I declare:
       uniform sampler1D fresnelMap
...and sample it with:
       float w = tex1D( fresnelMap, coord ).x;
But this doesn't work. The geometry that I apply shader to gets messed up. Is there something wrong with this code above? In code above, in openGL I treat 1D texture same as 2D. Maybe it should be treated differently? P.S. Another weird thing is this works on ATI card(even pretty old one) but not on (new) nvidia. [Edited by - butthead_82 on September 13, 2009 6:36:32 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!