Compiler warnings

im trying to cleanup my shaders so i dont get any warnings but there are two lines that i cant get right so they compile without warnings, any ideas?

(A)
vec3 normal, mv_vert, mv_cp;
normal = faceforward( normal, normal, ( mv_vert - mv_cp ) );
<stdlib>(7571) : warning C7011: implicit cast from “int” to “float”

(B)
vec4 camera_pos = gl_ModelViewMatrixInverse[3];

A) Compiles fine for me. B) Doesn’t compile, apparently because gl_ModelViewMatrixInverse hasn’t been implemented yet.

they both compile and run fine and my card, its just that cause ive got the strict compiler warning option enabled, they both generate warnings, ive reread the spec a few times and tried various things but cant get them to go away

The warning don’t make sense to me in part A.
Part B, I haven’t used that matrix but nvidia defines them. ATI doesn’t.

Also,

normal = faceforward( normal, normal, ( mv_vert - mv_cp ) );

can become

normal = mv_cp-mv_vert;

if I’m not mistaken.
You should email them directly if it bothers you that much :slight_smile:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.