I’m trying to implement some kind of simple lighting in a GLSL vertex shader.
Currently I’m using a directional light and I’m trying to get the L-Vector for the diffuse calculation like this:
The only problem is, this position doesn’t change if I rotate the scene, etc.
(I tried this by simple setting the vertex-color to that value)
The GL-Spec says, that the position gets stored after having been transformed by the modelview-matrix, so it should change when I rotate the view.
If I use fixed-function lighting, it works.
Has anybody else experienced this issue or can tell me what I’m doing wrong?
I’m using an ATI Radeon 9800 with Catalyst 4.1
Thanks for your patience, I spoke with devrel and you should hear back today.
Also, I was incorrect, this issue has not been fixed. We will try to reproduce it. If you have a reproducer app, please send it to ‘devrel@ati.com’ as this will expediate the issue being fixed.
Hi all. I’m totally new to shading languages and i’d like to learn. I’ve seen some examples and this thread seemed to explain my problem. It doesn’t, but here it is anyways:
what graphics card are you using? In 3dlabs drivers, gl-state based on arrays or structs is not yet supported. So you have to supply this info as a uniform.
If it’s an ATI, it “should” work. At least you shouldn’t get a compile error. As stated above, the implementation is buggy insofar, as that you have to manually multiply the light-pos with the modelviewmatrix.
I mailed a test-shader to ATI devrel, so hopefully, it will be fixed in the next driver release.
Ok, thanx… Suddenly it works I downloaded the new ATI drivers (for my radeon 9600 xt, 256MB) and it works fine now. I get a link error when I use noise functions though. This is what i did:
Ow. I read some ‘tutorials’ but I still can’t find out how to use the uniforms. I can declare them in the shader, but how to I communicate from my application (in cpp)?
I just wanted to follow up yet again. We reproduced the issue with gl_LightSource[n].position, and indeed the value being set was the object space position rather than the eye space.
We have a fix for the issue and it will show up in a future driver release.
I just wanted to follow up yet again. We reproduced the issue with gl_LightSource[n].position, and indeed the value being set was the object space position rather than the eye space.
We have a fix for the issue and it will show up in a future driver release.
Thanks.
– Dan (ATI)[/b]
Sorry to hijack that thread, but would it be possible to include a changelog concerning everything that has been changed/added in ATI’s glSlang-implementation in the release notes of newer drivers?
I was a bit disappointed when I downloaded Cat4.1 and nothing in that way was mentioned.
ATI Devrel maintains a list of the large changes and caveats for each release. Please send an E-mail to ‘devrel@ati.com’ and request the GLSL caveats list to get it.