Sign in to follow this  
indigox3

cg fragment shader problem

Recommended Posts

indigox3    122
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
Eric Lengyel    3460
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this