Wobble shader not working on new macbook pro


    Sep 02 2010 | 11:03 pm
    I recently upgraded from a 4 year old macbook pro and I often used this shader in performance. Now when I turn it on in my patch it just turns the screen black with no errors in the Max window and it's fine if I turn it off.
    If I isolate it in a shader example patch i get the same result. Does anyone have any ideas for modifying the shader? I assume something isn't talking correctly to my newer graphics card.
    This is a macbook pro with the nvidia geforce 330m/512mb ram if that matters.
    I haven't hit this issue with any of my other shaders yet, but this one would be missed.

    • Sep 03 2010 | 4:55 pm
      Even without a fix, can anyone possibly take the time to confirm that this is happening on their mid 2010 macbooks...i would just like to know if its my machine/settings or if its a general shader problem with these newer graphics cards
      I tried running the opengl profiler for a frame with wobble turned on, but most of the processes looked normal as far as i could tell..the getGLerror was always gl_zero (if thats anything)
      I also tried compiling the shader in the shader builder but i think something might be different with how it gets passed images or something..I ended up getting the same black image
    • Sep 03 2010 | 5:11 pm
      can you post a test patch?
    • Sep 03 2010 | 5:18 pm
      I will post the shader code I have below as well. My guess is maybe something is getting screwed up with the light position, but I don't have any evidence.
      Shader, just in case everyone else's is different from mine:
      Shader for wobbling a texture
    • Sep 03 2010 | 5:45 pm
      I am also getting only a black screen when using your test patch. I am using a MBP 10.6.4 NVIDIA GeForce GT 330M
    • Sep 03 2010 | 6:30 pm
      Thanks a lot, good to know I'm not crazy. I have that exact same setup as well. I've just exhausted all of my resources for trying to figure out how to fix it..maybe some shader wizard will come along...
    • Sep 03 2010 | 7:23 pm
      i'm not sure why, but the clamp function is acting weird on nvidia cards with this particular shader. try replacingfloat spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0); withfloat spec = max(dot(reflectVec, viewVec), 0.0);
      if anyone has insight into this, i'd love to hear it.
    • Sep 03 2010 | 7:45 pm
      That did it, thanks a lot!
      I was going to ask you how you debugged that, but had you just heard about it 'around town' or something? I'm trying to get a little more self sufficient for figuring out these open gl issues
    • Sep 03 2010 | 8:49 pm
      debugging shaders is tricky. really, the only way to do it is with gl_FragColor output value. you can set this equal to different variables from the different stages of the shader.
      for example the first thing i did was set the varying lightintensity equal to the spec value in the vertex shader. then is i set gl_FragColor = vec4(lightintensity, lightintensity, lightintensity,1.0) and determined that the spec value was 0 (because the output was black).
      however changing "clamp" to "max" was just a lucky guess. i still have no idea why clamp was not working.
    • Sep 04 2010 | 3:33 pm
      using a slightly different approach: using the original shader, turning the light on and calling a shader directly in the video plane.