Page 1 of 1

New shader sample

Posted: Sat Mar 24, 2007 5:22 pm
by JensAyton
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.

Image

The shaders work with Oolite 1.67 and 1.67.1 for OS X, although the hull temperature glow is disabled.

http://wiki.alioth.net/images/3/3a/Shady-cobra.oxp.zip

Limitation: the laser glow for all four lasers is based on the laser currently in use, i.e. the last in-ship camera you selected.

Posted: Mon Mar 26, 2007 4:35 pm
by Uncle Reno
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.

Posted: Mon Mar 26, 2007 6:38 pm
by JensAyton
*mangles textures a bit*

Those are the forward side panels of the ship, or strips of them. I don’t know why it’s happening. It happens with the un-shady version, too.

Posted: Mon Mar 26, 2007 9:47 pm
by Uncle Reno
I've also seen the glow appearing through the fuel scoop housing when using the looking up at the bottom of your ship view.

Posted: Mon Mar 26, 2007 10:03 pm
by JensAyton
The glow map may appear around the edges, but I suspect what you’re seeing is the flasher. Again, Charlie’s fault. :-)

Posted: Tue Mar 27, 2007 7:21 am
by Uncle Reno
Well, if it's of any use/interest, there's a screenshot of it at http://www.box.net/shared/sqo187ljaa.

Posted: Tue Mar 27, 2007 9:15 am
by JensAyton
Yep, that’s the flasher.

Also, the shader isn’t being used in that shot.