New shader sample

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

New shader sample

Post 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.
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post 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.
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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.
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post 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.
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

The glow map may appear around the edges, but I suspect what you’re seeing is the flasher. Again, Charlie’s fault. :-)
User avatar
Uncle Reno
---- E L I T E ----
---- E L I T E ----
Posts: 648
Joined: Mon Apr 24, 2006 12:54 pm
Location: UK

Post by Uncle Reno »

Well, if it's of any use/interest, there's a screenshot of it at http://www.box.net/shared/sqo187ljaa.
"Get back or I unleash my lethal spotted batoid!!"

What I do when not reading the Oolite bulletin board!
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Yep, that’s the flasher.

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