Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Stein Nygaard, posted on November 21, 2004

Image Description, by Stein Nygaard

Hey flipcoders :) First off... Nice shader, eh? Hehe :)

Been working with my glsl-shaders, and lately I've been focusing on getting my normal-mapping working. Finally I got it working, on ATI _and_ nVidia cards!

The thing is, that the glsl-implementation still is a bit weird sometimes. Let me give an example: I was working a bit on my homecode at work (sorry boss), where I have a machine with nVidia card. I got some stuff going, using the built-in matrix-variable gl_ModelViewMatrixInverse... But, when I got home and tried it out, it didn't even compile. Why? Because ATI haven't implemented this built-in matrix (yet?). So, I sat down and implemented stuff at home, using a uniform matrix instead, computing the inverse modelview on cpu. Worked just fine :) Then got to work again, and tried it out with the new code. Wtf... Didn't work at all! It compiled and ran, but the uniform matrix somehow wasn't copied to the shader. What to do... I got the very latest oficial drivers from nVidia, and swiz: Everything looked great :)

So... It's quite important to have new drivers, when working with glsl, as they're updated constantly.

I've also been running 3dlabs' parsertest on my 9800PRO, my fx5900 ultra at work - both with the latest drivers. Thought that it might be of interest to other glsl-developers... It came as a big surprise to me, that the nVidia drivers don't support anywhere near the amount of ATI. I'm not really sure if this parsertest is reliable, but if it is: I'm happy about my 9800 from ATI.

Have a look here:

Please comment with any experiences you may have had using glsl :)

- Stein Nygaard |

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

November 21, 2004, 04:25 AM

Looks nice :), have you seen/tried relief mapping? More work and pretty slow but has nice results too. Its good to see that there are actually coders using glsl, not so much discussion yet on that subject. I have also been doing stuff with glsl and I have to agree that there are still lots of problems with drivers and different cards. Latest nVidia drivers dont work so well with 6800 cards and without those latest drivers the glsl support is minimal. I dont use ATI much but I've noticed that their compiler is much more strict about variable types than nvidias. I just hope that both manufacturers get their drivers fixed and full support for glsl soon.


November 21, 2004, 06:17 AM

nVidias 66.81 works great on my 6800 - all my glsl programs do what they're supposed to.


November 21, 2004, 08:59 AM

Yes... Reliefmapping is really nice! I gotta try that sometime :]
Did you do some cool stuff with glsl? Screenshots?


November 21, 2004, 09:00 AM

Ah, okay... Well, I just got a 6800GT at work, so I'm gonna upload a parsertest-log from that tommorow - when I get there.


November 22, 2004, 03:45 AM

Here's the log from my 6800GT at work...
So strange, but it actually supports even less than the fx5900 - even with never drivers!


November 22, 2004, 02:15 PM

Ahh, the 3dlabs-suite. Most of the "failed" tests are code fragments, that compile but shouldn't...I can live with this kind of error (sure it would be better if nVidia was standards compliant, but for everyday work their current driver version is already pretty usable imo).


November 22, 2004, 05:34 PM

I Also use GLSL and *may* have found an issue: vertex attributes
these do not like to work at all, on my ATI 9600.
If any one has this working let me know maybe im doing soemthing wrong.

Great shader btw :)


November 22, 2004, 06:03 PM

Which attributes is that?


November 23, 2004, 02:43 AM

well im just trying to set a vec4 for each vertex using GLSL it seems to be setting soemthing, but its not constant, ie. i tried using the attribte to set the vertex colour, but i get flickering between blue and black, while i would expect red as most values passed in are (1,0,0,0)


November 23, 2004, 03:19 AM

Hmm... Sounds very strange and uncool! I actually had similar problems, but that was when dealing with textures. If I didn't save the texcoords in my vertexshader, then I couldn't set colors in my fragshader.
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); resulted in black!
I suggest you try to eliminate this kind of stuff, to see if that helps. Try make your shader as simple as possible, and see if you can spot where the shit hits the fan.
Be sure to let me know!


November 25, 2004, 02:47 AM

well all my vert shader does is transform (which works) and sets a colour value
frag shader then takes that and outputs the colour.


November 25, 2004, 09:38 AM

This is not impressive. You're using glslang, which is a piece of urine to use. You're doing simple diffuse/specular tangent space bumpmapping, something that has been done with much more crude and difficult to use mechanisms for the last decade.
I hope you don't think I think you're stupid, you're obviously not - I just don't see why this is an image of the day.
Sure it looks nice, but diffuse/specular bumpmapping does look nice, always has...but there you have it.
You're using glslang, yes, but surely it's more credit to the driver programmers rather than the users of the language that this stuff runs at all.
You're not a driver programmer for nvidia or ati - so what are you proud of exactly? That you typed in a simple (can't get more simple) and incredibly well known (can't get more well known) c program and hit compile+run+printscreen?


December 01, 2004, 02:43 AM

Hehe... Thank you for such constructive comments!
You obviously didn't get the point of this iotd, which indeed wasn't "look at this total new bumpmapping!", but rather "anyone else having fun with glsl?".
Did I say that I was "proud" of anything? Think not...
I just wanted to share my experiences with glsl, and get some comments from people. I thought, why not post it on iotd, since it seemed a bit dead these days.
And btw, why is glsl "a piece of urine to use"?

Post an iotd yourself, and show what kind of images/info you like to see here!

This thread contains 13 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.