We got a lot done this week, both on the code and art side.
Code wise I prototyped a movie rendering system I would like to use for the start screen and battle scenes. I also re-implemented outlines and found a nice easy method for adding shadows.
Our outlines use the basic “extrude-along-normals” method where you duplicate the model and render it with your extruding shader. In case anyone is curious our outline shaders are below, feel free to use it for what ever you want.
var SHADER_OUTLINE_VERT = [
"void main() {",
"vec3 expanded = position + normal * vec3(0.09);",
"gl_Position = projectionMatrix * modelViewMatrix * vec4(expanded, 1.0);",
"}",
].join("\n");
var SHADER_OUTLINE_FRAG = [
"void main() {",
"gl_FragColor = vec4(20.0 / 255.0, 30.0 / 255.0, 39.0 / 255.0, 1);",
"}",
].join("\n");
You'll notice Three.js has an odd way of formating shaders, they are actually giant strings concated together.
Our unit shadows are a bit more interesting. I had considered using shadow maps (downside: expensive to compute), or a decal system (downside: complicated to program). What I settled on is rendering a simple plane with a fragment shader generating a darkened circle. The interesting bit is we draw this plane after we've drawn all the terrain so it never gets clip'd. Stuff below a unit always appears in the dark just like your eyes expect. The method's downside is you can see the shadow through buildings. In exchange we get fast high resolution shadows and we can support hundreds of units without breaking a sweat.
All this relates to the art news: we've redesigned our art style!
Klamp, an old time advance wars fan and talaented 3D artist, is to thank for the redesign. He gave us fantastic concrete advice on making the units pop from the terrain background. This is what prompted me to add the outlines and rethink the shadows.
The terrain is now less saturated and shifted in the red spectrum. The result is everything feels much warmer. The units now have bright sun highlights. I really have to give thanks to Klamp for his assistance and give mad props to Uberren for pulling the long hours to get this done in only a week.
To celabrate the new art style we've also redesigned
superbattlelands.com In the redesign we took the chance to elaborate on our intentions for Super Battlelands. We've also started a Tumblr (
http://superbattlelands.tumblr.com/) which Uberren promises he will update with inprogress and finished art stuff. I have to apologise, in our email threads rest a ton of nice art and render shots which I have just not been posting. Hopefully now those renders will see light on the Tumblr.