Here’s a more complex shader example. It’s a version of Charlie’s Dream Team cobra, which uses all the data Oolite provides – laser heat, hull heat, engine power and time. It also implements per-pixel specular lighting, although with neither specular mapping nor smoothing this isn’t very obvious. If anyone feels like sending me a model with a specular map…
During the development of the shaders I discovered a problem: Oolite uses light 0 as the “showroom” light (for the demo and shipyard screens) and light 1 as the sun. There is no way in GLslang to know whether a light is enabled. My workaround for this is to ignore light 0 all the time, meaning the ship is illuminated from the direction of Lave’s sun relative to the station (!) during the demo screen.
The shaders work with Oolite 1.67 and 1.67.1 for OS X, although the hull temperature glow is disabled.
Looks great but a little point, out of left and right views there is a diagonal blue line in the bottom left and right hand corners respectively, should they be there? I can't see why they should be shown, they don't seem to match up to any part of the ship.
"Get back or I unleash my lethal spotted batoid!!"