Sooo… I’ve been experimenting with lighting of spaceships for GSB 2. If you played the original game you might be aware that although it often looked pretty l33t, it also had a tendency to look a little ‘flat’. The lighting was always the same (apart from the odd ‘global’ shader effect, and it could certainly have had more depth. This is one of the things I wanted to address when re-doing the game. The original game just had simple sprites for ship hulls, and the new version is tons more complex and lets me do lots of magic. Basically, I combine sprites for the ships with normal maps, and specular maps and lightmaps, and use a shedload of different shaders and render targets to do all kinds of compositing voodoo. So here I present some early screenshots showing me monkeying around with the options I now have. It’s a GSB 1 ship (as a test) and it looks like ti has another one stuck to the front of it. This is a test of something else (secret!) but it shows how one ship can now cast a shadow on another (Not correctly positioned yet, but easily fixed…)

So here is a screenshot showing the bloom effect everywhere: (click to enlarge)

1

Here is one with the bloom effect turned down but the 3D bumpiness up a bit:

2

Here I turned down the exterior lighting, and may have moved the lighting direction too:

3

Now I’ve gone full-on moody lighting and likely moved the light again:

4

Now I’m in real ‘dark-battle lit only by the light of our warp engines mood:

5

You really need to see it all big screen (and moving!) to see the full effect of it all. And you also need to compare it to the original flat looking default-shaded sprites in GSB 1 to imagine the final effect with all the battle raging around it. I’m quite pleased with it so far, although there are loads of things that need improving and tweaking, and no doubt needs more optimizing. It’s a start though!

 

3 Responses to “Gratuitous Space Battles 2 Lighting”

  1. Metalfusion says:

    Having implemented a 2D deferred lighting system into my own game project just a month ago, this is quite interesting to see. I actually quessed that a normal-map based lighting would be a major feature in GSB2 when you mentioned having restructured your engine to be shader and render target based for all drawing.

    You mentioned specular and lightmaps. I quess the specular map is for the specular intensity parameters in the blinn-phong formula, but do you use a separate “lightmap” sprite for the per-pixel self-illumination information, so you can limit the shadowing effect on parts that emit light by themselves (such as the engines)?

    A problem I personally ran into is that scaling the normal map sprites results in alpha-blended pixels at the edges, and the vector orientation information becomes unreliable at those points. It requires a compromise between discarding all blended “normal” pixels (which results in loss of shadowing at the edge) and using them anyway with sometimes very noticeable glitching. The problem is also amplified by the need to rotate the normals with a pixel shader upon drawing to the normals render target so that they are all in the same coordinate space regardless of the sprite and camera orientation.

    The screenshots seem to show ambient and directional light, but do you plan on supporting point lights as well? Those would look seriously cool when attached to all plasma etc. projectiles that fly past the ships.

  2. cliffski says:

    I can’t do point lights as such, but I do use lightmaps from the point lights so they can illuminate, but not cast shadows. I’ll post more screenshots in time that will show how that looks (it’s pretty cool :D)

  3. ac says:

    I just learned that there’s MODDABILITY to the game. I love games that have moddability for the online/multiplayer component. I spent 2 years of Q2, 1-2 or BF1942, 2 on Eve (not so moddable, but I developed automated trading software for that one). The best mod I played on Star Craft morphed into Dota/LOL, one of the biggest online gaming phenomena recently. Infact I believe game developers should think they are developing a platform for the community and in future modders are the best paid people in the business and “games” or engines become a commodity/platform on which modders build the experiences that people really want to pay for. The fact all the best online experiences I’ve had (1942:DC mod, TMNF used maps, Q2 mods, Q1 mods etc) are to do with mods and not the levels the game devs shipped support this strongly.

    If I had known this was moddable (and the best mods were very visible) earlier I would have value this higher. I did infact virally market this game a bit but I didn’t know to mention it’s moddable and since the price was too high I didn’t really know what the online experience was so I was quite reserved in my pitch.