Closed foxostro closed 11 years ago
I pushed my work-in-progress ramp code to a new branch "ramps." This includes some screen shots.
Major bugs include a) ramps are not lit correctly, b) ramps look weird without inside and outside corner pieces, c) grass-dirt transition textures are weird. So, I honestly might abandon ramps and work on other pieces of the game such as trees and grass.
Ramps are now properly lit as of d2cc188f88e5c01880a7e08d9f0233637429fca1. The changes made to the lighting engine for this also simplify it quite a bit.
Next: inside and outside corner pieces, inverted ramps/corners, and culling hidden faces during geometry generation.
Ramps are basically done as of 03ee28e03da437808239622e5f65b3335a6ec775. There are a few couple of glitches which can be fixed later:
Instead of making a game engine with terrain that looks like Minecraft, the terrain generator should add ramps to natural to make smooth terrain. That is, generate an array of Boolean values for solid/empty as usual, and then make a pass across this array to add ramps to empty blocks that sit on top of solid blocks. The choice of ramp is made by examining the neighboring blocks in the cardinal directions north, south, east, west. Another pass may be made to smooth out the underside of overhangs.
The process of adding ramps only occurs during the generation of natural, I modified terrain. When the user edits terrain, ramps are not added or updated.
Light propagation across ramp blocks will require some careful thought. A good first pass is to treat all ramp blocks as being transparent to light.
The mesh generation algorithm will need modifications to deal with ramp blocks too.