View Full Version : fract( XX ) not acceptable in vertex shader
as in, the shader wont compile.
this is happening on my nv3x (81.xx), i have no problems using it in the fragment shader.
is there some restriction about using it in the vs that i dont know about?
04-22-2006, 10:36 PM
The spec does seem to be a bit thin with respect to hardware support for specific functions. But I have no vertex shader problems with fract on a NV40 (GLSL validate says all is well). You sure it's fract at fault? Seems like that should be fairly easy to support on NV3x hardware... it's just x - floor(x). My guess is you've hit some other limit, or something. Can you post your shader and your actual driver version?
ta, so i guess its allowed
TC = vec3( gl_MultiTexCoord0.x - floor(gl_MultiTexCoord0.x), gl_MultiTexCoord0.y, time );
this doesnt (as in not compiles)
TC = vec3( fract(gl_MultiTexCoord0.x), gl_MultiTexCoord0.y, time );
this also doesnt
TC = vec3( fract(gl_Vertex.x), gl_MultiTexCoord0.y, time );
this is with driver 81.85 on gffx5900
im guessing a driver problem
04-23-2006, 01:50 PM
It's allowed and that looks like perfectly valid code to me. Compiles fine on ATI.
ok downloaded the latest official drivers 84.21 and the problems still there,
can someone with a gffx try it out the fract command in the vertex shader to confirm this so i can get onto nvidia to fix it.
04-30-2006, 05:01 PM
Maybe its 'frac', as in CG?
very very sorry this was my error, unbelieveable stopid of me.
when i was loading in the vs ild check for the letters 'fra' (cause i seperate the vs + fs's by sticking the following words in my shader src
// fragment shader
i have no idea why i only checking for the first 3 letters and not the whole word fragment but (hey im an idiot) but even then that will cause a problem with eg (unlikely but possible)
// vs //
// fragment shader will get the current gl color
gl_Color = gl_FrontColor;
i suppose the only foolproof way is to have the vs + fs in 2 seperate files
05-03-2006, 05:21 PM
You could use full tags like [Vertex shader] and [Fragment shader] like I do rather than putting it into a comment. Almsot no chance of screwing up with that.
05-05-2006, 09:52 PM
Btw, what was the reasoning behind spec'ing it this way, that the shader entry point has to be called main? I've been spreading things out in separate files, but this is becoming a real nuisance. Well, perhaps it's only a mild annoyance ;-).
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.