chris clepper a écrit :
I just fired up your vertex shader in OSX Shaderbuilder and it runs fine. And it runs in GEM as well with a passthrough fragment shader. The only problem on the Mac so far is that it prints that the shader is running in hardware when it is clearly killing the CPU and software only.
I will try it on a PC now and post the results.
ok, thanks.
here is all the files, if someone else what to try.
cyrille
cgc
void main() { gl_FragColor = gl_Color; }
#N canvas 408 201 614 572 10; #X obj 75 22 gemhead; #X msg 30 62 print; #X obj 74 446 glsl_program; #X obj 148 306 pack 0 0; #X msg 32 187 print; #X obj 169 286 t b f; #X obj 169 241 change; #X obj 147 103 change; #X msg 148 346 link $1 $2; #X msg 31 399 print; #X floatatom 169 267 2 0 0 0 ID - -; #X floatatom 147 126 2 0 0 0 ID - -; #X obj 166 367 print linking; #X obj 74 490 rotateXYZ; #X floatatom 93 468 5 0 0 0 - - -; #X floatatom 349 379 5 0 0 0 - - -; #X obj 351 15 _gemwin; #X obj 352 202 _light _________________________; #X msg 349 397 time $1; #X floatatom 137 468 5 0 0 0 - - -; #X floatatom 179 466 5 0 0 0 - - -; #X obj 75 221 glsl_fragment; #X obj 75 84 glsl_vertex; #X obj 73 520 teapot; #X obj 265 28 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 94 60 open noise.vert; #X msg 96 192 open noise.frag; #X connect 0 0 22 0; #X connect 1 0 22 0; #X connect 2 0 13 0; #X connect 3 0 8 0; #X connect 4 0 21 0; #X connect 5 0 3 0; #X connect 5 1 3 1; #X connect 6 0 10 0; #X connect 7 0 11 0; #X connect 8 0 2 0; #X connect 8 0 12 0; #X connect 9 0 2 0; #X connect 10 0 5 0; #X connect 11 0 3 0; #X connect 13 0 23 0; #X connect 14 0 13 1; #X connect 15 0 18 0; #X connect 18 0 2 0; #X connect 19 0 13 2; #X connect 20 0 13 3; #X connect 21 0 2 0; #X connect 21 1 6 0; #X connect 22 0 21 0; #X connect 22 1 7 0; #X connect 24 0 25 0; #X connect 24 0 26 0; #X connect 25 0 22 0; #X connect 26 0 21 0;
void main(void) { vec4 v = vec4(gl_Vertex); vec4 pos = gl_ModelViewMatrix * v; float LightIntensity = max(dot(normalize(vec3(0.,3.,3.) - pos.xyz), gl_Normal), 0.0); gl_FrontColor = gl_Color * LightIntensity;
// v.x += 0.1 * noise1(v); v.x += (float)(0.1 * noise1(v));
gl_Position = gl_ModelViewProjectionMatrix * v; }