Jump to content
  • Advertisement


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


cg fragment shader

This topic is 5352 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

im trying to write a fragment shader that will offset the pixels from my original image, which is a 2d image ive tried using tex2D like so
void main( float2 texCoord   : TEXCOORD0,  
	   out float4 color : COLOR,
           uniform sampler2D texMap ) 

  float4 clr = tex2D( texMap, texCoord );
  // PROBLEM whenever i adjust m to anything other than 0 

  // it doesnt work

  float4 m = float4( 0, 0, 0, 0 );
  float2 newest;
  newest.xy = texCoord.xy + m.xy * clr.xx + m.zw * clr.yy;
  color.rgb = tex2D( texMap, newest.xy  ).rgb;
  color.w = 1.0;
the compiler returns the error : fatal error C9999: Dependent texture operations don't meet restrictions of texture shaders when the value is not 0 i have also tried adding a float2 to the texcoord value but it returns the same error. so if anyone knows an alternate way of adjusting the texcoords without using a vertex shader please let me know // EDIT: nevermind turns out my hardware dosent support it [edited by - ssjason123 on February 23, 2004 6:07:18 PM]

Share this post

Link to post
Share on other sites

  • 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!