Jump to content
  • Advertisement
Sign in to follow this  
indigox3

cg fragment shader problem

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

Do all of the Cg standard math library functions work with all profiles? I'm using the CG_PROFILE_FP20 profile on a Geforce 4 Ti 4200, and if I put something like: float duh = pow(11.0, 11.0); I get an error compiling my fragment program. However the same code compiles without error in my vertex shader, using the CG_PROFILE_ARBVP1 profile.

Share this post


Link to post
Share on other sites
Advertisement
The GF4 cannot perform a POW in the fragment shading hardware (which are register combiners). But the vertex programs have EXP and LOG instructions, so they can handle it. To do a per-fragment POW on NV2x hardware (like the GF4), you need to use a look-up texture. NV3x hardware (GFFX) and later can do POW in the fragment shader.

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.

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!