• Advertisement
Sign in to follow this  

cg fragment shader problem

This topic is 4469 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
Ahh ok, thanks,

(Just noticed the limitations of each profile are listed in an appendix of the Cg user manual)

Share this post


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

  • Advertisement