Cell Dynamic Sky System

A modest attempt at development on AltSci Cell can be viewed below. Months now with very little progress is disappointing, but I suppose I'll continue on. A rant about how easy laziness is would probably not advance progress any better than the past rants, so I'll spare you.

Today, I came up with a few ideas on the way to and from Uwajimaya Asian market. The first is that the sky has a quantifiable set of properties even though it is very complex and interesting in reality. But complete quantification of every meteorological property of the sky is not my plan. I want a fairly reasonable dynamic sky so that the player is not faced with 24 hours of daylight and something to break up the blue sky and black night. Adding a sunrise and sunset is not the only thing that a developer can do. Adding a gradient to the sky also helps. Artists will tell you that the sky has a white part near the horizon. Some days the sky is very deep blue, some days it is very light blue. How can we decide? First lighten and darken the sky randomly by day. Secondly, use the time of day to decide the deepness of the color. The next thing is clouds. It's obvious that the sky will have clouds in it some days. How do you properly add clouds? One way is by adding the clouds to the texture. Another way is by having a transparent layer with different types of clouds. This way if you really want to have fun, you can make moving clouds. Of course you can make textured clouds move, but it might require extra work. The final thing is stars. Of course, it's easy to add stars to a sky, right? Well, you are going to have a bit of trouble depending on your choice of UV coordinates or if your sky is a box. It's possible to do it correctly, it's just a matter of work.
AltSci Cell Dynamic Sky System screenshot (Blender)

What else did I think about on the bus? There's a certain reflectivity of windows when you are greater than a certain distance from them. At first, I thought about environment mapping. Environment mapping is an expensive and very difficult technique. Don't argue with me on that. Anyone doing that, my hat is off to them. Env mapping looks excellent with cars, metal armor, and so on. Certainly many developers can say: "env map everything!" and get away with it. I just can't justify it for a simple window. So think about what it looks like. It looks like a little bit of dark color, grey color and white color that moves as you go past it. It reminds me of something: specular. Actually, that's exactly what specular is, reflection off shiny surfaces. So if I have a dynamic light source (I certainly will), I can crank up the specular (specular and diffuse on everything in my games will be extremely low) and get a shine effect on all the windows. But there's another effect that comes into play as you come closer to a window: you can see through it. Doesn't that just blast everything to smithereens? How can you see through a specular reflective window? Well, it's quite simply alpha. I can quite easily reduce the alpha of the window as a person gets closer and draw the interior of the shop behind it. Think of that: as you get close to a shop with a window, you can see through it. Not only is it technically correct, it also is quite efficient: transparency only on windows within a certain range, draw the insides of a building when inside that range.

Looking at the ground beneath the tall buildings, I noticed that the tall buildings cast a very large shadow on sunny days. One thing that I as an artist have decided is that shadows and such can be largely ignored, since on cloudy days (and to a lesser extent on sunny days) ambient light leaves no spot much darker than the next. Shading on the other hand is a quite important task, although ambient is still king. If you look at some screenshots I've taken, you'll see that I'm heavy on ambient. I've settled on materials with 60% ambient, 80% diffuse, and lights using 13% ambient and 4 diffuse directional lights. This gives a gradient between 90% and saturation depending on the angle. Also, there are no dark spots, which really makes the shading look ugly.

When I got off the bus, I decided that it would actually be pretty useful to take pictures of an entire block with both sides from the Ave. That way, I can draw architecture that looks quite reasonable and can take hints on how to do static lightmaps for the buildings. Static lightmaps are an interesting way to fake high quality lighting in a 3d scene. The idea is that the artist drawing the skin draws the pattern on the skin. Then using artistic talent draws shading onto the skin instead of actually lighting the model dynamically. You may have noticed in Javantea's Fate and almost all the pictures I have posted use very flat skins and dynamic lighting. My reason behind this is simply that I'm not skilled enough to do quality static lightmaps, so I just leave it be despite the lower quality. I've been looking for a tool that takes a model and a simple texture and makes a high quality lightmap for it. Blender seems like it would have such a thing, but I still am not very good at using it. One of my very difficult tasks is to create an importer and exporter for Blender. I've written a simple importer and exporter for static geometry without materials, but that's the easy part.

I got Blender export to AltSci working. You can see it working in the below image. The mountains and ground were exported from Blender. Both are static, but I consider that substantial progress compared to the past.
AltSci Cell Blender export working
I also uploaded a video of specular windows to show what I meant. It was rendered with Blender instead of AltSci Cell (OpenGL), so that's definitely not what it's going to look like in-game, but you get the effect. Note how the windows shine, but the building does not. The building has no specular reflection, the windows do. Getting this to actually happen correctly was fairly difficult for a fairly new user. Blender's object/mesh link system is difficult to get working correctly. The video is encoded with XviD codec using transcode. When I put stuff inside the building, I can make a video with the windows being semi-transparent and show you what the specular reflection plus transparency will look like. Eventually, when I get the window system into Cell, I'll make a video of the actual thing to show you what it looks like. I think it should look pretty nice.


Comments: 0

Leave a reply »

  • Leave a Reply
    Your gravatar
    Your Name