Jump to content
  • Advertisement
Sign in to follow this  
butthead_82

OpenGL sampler1D not working in CG

This topic is 3381 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);
       cgGLEnableTextureParameter(fresnelMapHandle);
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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!