Hi, I was just wondering if there is a standard shader / set of shaders for re-creating the normal OpenGL fixed functionality pipeline rendering? It seems a bit of a pain to have to go and write it all - plus I’ll probably get it wrong!
Originally posted by jelly:
[b]Hi, I was just wondering if there is a standard shader / set of shaders for re-creating the normal OpenGL fixed functionality pipeline rendering? It seems a bit of a pain to have to go and write it all - plus I’ll probably get it wrong!
Thanks,
Andy.[/b]
I wanted to do the same a while ago, and couldn’t find any when I looked, so I think you’ll have to write your own. The orange book has most of the information you need. Below is a vertex shader which might get you started. As far as I can tell, there isn’t any mechanism for determining which lights or texture units are active, so your shader will either need to make assumptions, or have a bit of extra information passed through to it via some uniforms. This shader simply assumes that light 0 is a point light.
Thanks, this is a good starting point. It’s a shame that there isn’t a standard set of shaders that you can use for GLSL. I think nVidia supply one written in Cg, maybe a conversion is in order.
Also, I was wondering if anyone knows of any good web sites for sharing glsl shaders? I’ve written some that others could probably use, and I’m sure others have too. All the shaders I’ve found seem to be on individuals sites rather than a community site. There should be something on opengl.org really.