If you want static per-vertex lighting, then yes - pre-calculate the diffuse+ambient and store the colour per vertex in the colour array. You won’t get specular, however (as that’s view dependent, ie. dynamic).
If you want static per-pixel lighting, then use lightmaps generated using either radiosity or raytracing or highly tesselated per-vertex lighting or any other method you can think of. (again, you won’t get specular)
If you want dynamic per-vertex lights, then stick with the fixed pipeline glLights, as they are usually implemented much faster than anything you could do using vertex programs or the CPU.
If you want dynamic per-pixel lights, then use a combination of vertex programs (or CPU vertex setup) and pixel/fragment shaders (dot3 texture environment mode is the minimum capability you need on your graphics card).
[This message has been edited by knackered (edited 05-12-2003).]
BTW, there seems to be a hell of a lot of swedish graphics programmers around these days…is buisness booming over there?
I worked over there for a few months a couple of years ago, and the general feeling was that the swedish software industry was not doing so well - what’s happened since then?
Originally posted by knackered: BTW, there seems to be a hell of a lot of swedish graphics programmers around these days…is buisness booming over there?
I worked over there for a few months a couple of years ago, and the general feeling was that the swedish software industry was not doing so well - what’s happened since then?
Uhm…Maybe the reason we’re not doing so great is that we hang around OpenGL forums (Grammar Check: fora? all day?
Seriously, it’s not as bad as it was just after the dot-com death, but it’s not exactly booming either.
Also, there’s traditionally been a large PC demo scene here in Sweden and during the winters you have PLENTY of time when it’s dark, so…I guess all them crazy ASM hackers had to go somewhere. Cool OpenGL demos are one good way. (A bad way would be Mental Institutions, where people fluent in Pentium IV assembly all eventually end up
Huh?
God forbid an american should pay reasonable taxes to support the less fortunate, eh?
Follow the bible to the letter, but you can ignore the “there but for the grace of god go I” bit.
Originally posted by knackered:
[b]
If you want dynamic per-vertex lights, then stick with the fixed pipeline glLights, as they are usually implemented much faster than anything you could do using vertex programs or the CPU.
[This message has been edited by knackered (edited 05-12-2003).][/b]
Ok, so glLights is faster then using vertex programs?