LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: fliegerhorst on August 18, 2005, 15:10:23

Title: GLSL on OS X
Post by: fliegerhorst on August 18, 2005, 15:10:23
hi there!

i just realized that with the latest graphics driver update for apple's powerbooks GLSL is now finally supported under OS X
(http://www.apple.com/support/downloads/powerbookg4graphicsupdate10.html) - i'm not sure how it is with the g5 line, but i would guess that now the later powerbooks and g5s support glsl.

i made a quick test but unfortunately there seems to be a problem with lwjgl - which is loading but completely ignoring the shaders in its rendering! another example: the glsl support demo on jmonkeyengine.com shows only a grey quad without texture.

anyone here has an idea about lwjgls progress in this area?
or is this a jme problem?

cheers,
horst
Title: GLSL on OS X
Post by: Matzon on August 18, 2005, 15:59:22
I think its a jme issue.
Try running the shaders test in: org.lwjgl.test.opengl.shaders
Title: GLSL on OS X
Post by: fliegerhorst on August 18, 2005, 19:22:09
ok, i tried it with ShadersTest in the lwjgl-macosx-0.98 release
both low level programs work and display a colored sphere, where the shader equivalents only show up a black window.

i tested this on a powerbook g4 w/ radeon mobility 9800 128mb / osx 10.4.2
Title: GLSL on OS X
Post by: elias on August 18, 2005, 22:30:43
I'm curious: Have you seen _any_ GLSL program work on your setup?

- elias
Title: GLSL on OS X
Post by: fliegerhorst on August 18, 2005, 23:10:08
prior to the above mentioned graphics driver update by apple glsl didnt work on this machine.
but of course i have checked - that after installing the update, i could successfully write and execute shaders using apples opengl shader builder tool (included in their developer tools)

-- you don't have this problem on your machine?
i have a few g5s at work and will test the same on there tomorrow.

-- please let me know if i could help you with some more information?
Title: GLSL on OS X
Post by: elias on August 19, 2005, 06:22:08
I've never tried shaders on any machine, so I can't say if it works elsewhere. However, I know that GL2 exposes methods to get any errors from compilation of the shaders (glValidateProgram? glGetShaderInfoLog? glGetProgramInfoLog? ). Have you checked the output from them?

- elias
Title: GLSL on OS X
Post by: fliegerhorst on August 19, 2005, 07:08:01
the strange thing is - it seems that the shaders are fully validated, if your shaders have a syntax error lwjgl exits by outputting the error. however if everything is correct - nothing happens!

(note: i havent checked these methods directly, since i'm a jme user)
Title: GLSL on OS X
Post by: elias on August 19, 2005, 09:26:36
I tried on our G5, but I can't even get simple GLSL shaders to work in Shader Builder when rendering in hardware mode. But in software rendering, it works. It smells like a driver problem to me.

- elias
Title: GLSL on OS X
Post by: fliegerhorst on August 19, 2005, 10:28:31
on the g5 it is a driver issue. apple didnt release any new graphic drivers for quite some time...

in fact - afaik - at the moment only the latest powerbook supports glsl - that's why i've explicitly mentioned this update.
(here shaderbuilder runs glsl shaders in NON-software mode)

what can i do to start looking for the problem?
Title: GLSL on OS X
Post by: elias on August 19, 2005, 10:48:20
I'd dumb down the shaders to the absolute minimum, that is a "null" vertex shader, and a fragment shader that only set the color to something constant, say:


void main(void) {
   gl_FragColor.rgb = vec3(1.0, 1.0, 0.5);
   gl_FragColor.a = 1.0;
}



And see if that works.

- elias
Title: GLSL on OS X
Post by: fliegerhorst on August 19, 2005, 11:52:37
ok, so i did.

using the minimal shader example you posted - gl shader builder renders only a white sphere.

i'm sorry to have bugged you with this false positive - it's clear now that i've mistakenly believed glsl finally works on the mac - since a minimal sampler2D shader showed up the texture correctly.

too bad - this is really a graphics driver issue. =/

in case there'll be a new driver by apple  that really supports glsl - what modifications have to be done to lwjgl or will it work out of the box?
Title: GLSL on OS X
Post by: Matzon on August 19, 2005, 12:01:35
it should work out of the box
Title: GLSL on OS X
Post by: gregorypierce on September 12, 2005, 18:10:44
Apple doesn't actually support GLSL at this time, only some bastard subset of GLSL which is ripe with APPL_ extensions. I've been waiting too :) Its keeping me from moving forward on my stuff because I want an entire shader based rendering path.
Title: GLSL on OS X
Post by: numberR on September 12, 2005, 23:34:13
http://lists.apple.com/archives/mac-opengl/2005/Aug/msg00027.html
it's coming, according to the mailing list.
i just hope it  will happen soon...