Still trying to come up with a lighting scheme that doesn’t look awful. Among things I’ve tried:
- Flat-shading the triangles. To the extent that I want an old-school flat-shaded look to this, it failed — because old-school flat-shaded graphics generally had large, simple landscape features made of single polygons, not a noisy soup of thousands of tiny polygons. About 113,000 in the image above, incidentally.
- Blended normals for each point, aka Phong shading. Well, that’s what you see above. Pretty damn conventional at best and great at making the landscape look like a melted jumble of mush.
- Thresholding the light levels — having just two, light or dark, in the hopes that darkened areas will form the large, solid-color blocks seen in old-school 3D. With flat shading, this just means you get an incredible noise of single triangles scattering away from each darkened area. With Phong shading, you do get solid-ish areas… kind of… but they don’t seem to have any obvious connection with the terrain itself; they just look random.
- Thresholding the light levels to, say, four or five distinct levels. What you’re actually doing then is just solarizing the image, which always looks awful. Moving on.
So yeah. Now, one thing I’m also aware of is that the fractal generation algorithm is quite weak and suffers badly from creasing, as can be seen above. (The mathematical explanation for why a simple subdivision fractal creases is a bit tricky. But philosophically, it’s easy: since to generate this fractal we take each square, divide it into four smaller squares, then go to each of those smaller squares etc., etc., that means that when you are deciding what altitude to make a point inside one square, no data is getting across the border from any adjacent square. So there’s no reason for a sharp discontinuity in terrain direction not to appear at the border.) Improving that would probably make the terrain look better, at least.
B-u-u-u-u-t… I dunno. As I mentioned last time, not sure if ordinary lighting is the best way to go. What I really want to do is just call out the edges of terrain, so we get some depth, while still having lots of solid-color areas. Perhaps the answer to that is to have rim shading: look at the angle on the Y axis between the pixel and the camera, and then when that angle gets large enough, we start darkening the terrain. It’s as if there’s a powerful but narrow light mounted on the camera, illuminating the ground. To deal with (say) nighttime scenarios, just darken everything equally. So no, it wouldn’t be realistic, but combine it with some fogging and maybe even fake ambient occlusion (try to make narrow canyons, etc., darker through vertex colors) and we might be on the right track here.
As a side note, I’m now using GL vertex buffer objects, for absolutely no reason at all. Guess I figure that I’m going to be drawing a heck of a lot of landscape polygons and so it’s time to do it efficiently already.
Notes
-
mayflystudio posted this