Hello, I have to say that it's a pleasure working with the JOGL API.
I'm having an issue where my application works on Windows and Linux systems, but not on Mac (10.8.4). I suspect that there might be a compatibility issue in the shaders used in the unit test, but cannot be sure. Is there something obvious that I'm missing here? Thanks in advance for any input. private final static String VERTEX_SHADER_SRC = "#version 110" + '\n' + "attribute vec3 xyz_in;" + '\n' + "attribute vec3 normal_in;" + '\n' + "attribute vec4 color_in;" + '\n' + "attribute vec2 uv_in;" + '\n' + "uniform mat4 translation;" + '\n' + "uniform mat4 rotation;" + '\n' + "uniform mat4 projection;" + '\n' + "uniform vec4 light_dir_in;" + '\n' + "varying vec4 color_out;" + '\n' + "varying vec2 uv_out;" + '\n' + "void main()" + '\n' + "{" + '\n' + "gl_Position = projection * rotation * translation * vec4(xyz_in, 1);" + '\n' + "vec4 normal = normalize(projection * rotation * translation * vec4(normal_in, 0));" + '\n' + "float cosAI = dot(normal, light_dir_in);" + '\n' + "cosAI = clamp(cosAI, 0.0, 1.0);" + '\n' + "cosAI = max(cosAI, 0.4);" + '\n' + "color_out = (color_in * cosAI);" + '\n' + "uv_out = uv_in;" + '\n' + "}"; private final static String FRAGMENT_SHADER_SRC = "#version 110" + '\n' + "uniform sampler2D sampler;" + '\n' + "varying vec4 color_out;" + '\n' + "varying vec2 uv_out;" + '\n' + "void main()" + '\n' + "{" + '\n' + // Apply texture if the provided UV coordinates aren't (-1, -1) "if(abs(uv_out.x + 1.0) > 0.001)" + '\n' + "{" + '\n' + "gl_FragColor = color_out * texture2D(sampler, uv_out);" + '\n' + "}" + '\n' + "else" + '\n' + "{" + '\n' + "gl_FragColor = vec4(color_out.r, color_out.g, color_out.b, 1);" + '\n' + "}" + '\n' + "}"; |
Administrator
|
Hi
Your problem has probably nothing to do with your operating system. Please indicate which graphics card you use on your Mac. I remind you that you should not use the "varying" keyword in very recent shaders (use "in" and "out" instead), you can look at this document. Edit.: Please tell us which error message you get.
Julien Gouesse | Personal blog | Website
|
Thanks for the reply, gouessej.
I'm not getting any errors, but rather just a black screen. (When the same code works on all of the other stations). The graphics driver being used is intel's HD graphics 4000. Honestly, I've read over the document that you provided, but 90% of it is well over my head at this point, I'm afraid, so I will take your advice and adjust my shaders to see what happens. Thanks again |
Administrator
|
Hi
There is probably a problem with your driver, someone else already has a problem with this chip under Windows: http://forum.jogamp.org/Java3D-crash-intel-4000-td4029426.html Please give me the version number of your driver and ensure you use the very latest one. As far as I know, your chip supports OpenGL 3.3 core and GLSL 3.30. Intel fixed several major bugs in its Windows driver for this chip this year, especially in the creation of the context and in the behavior of the GLSL shader (as you can see here), maybe it's the case for the driver for Mac OS X too.
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |