Progress 17: Depth, Volumes and CPU Picking
Landscape Depth
The landscape now has information in the Y axis(downward), as you dig the tiles change from soil to stone to granite. It’s kept quite simple at the moment but later I want to add further noise manipulation into the algorithm so that the player can find pockets of different types of rock as they dig.
Excavation Tool
I made some progress on creating tools which the player can use to manipulate the landscape. The excavation tool allows a player to select a rectangular region to dig downward on. At the moment the excavation is done instantly but later it will be dug out by players game units.
Volumes
I’ve added rudimentary support for voxel volumes.
CPU Picking
I had wrote before about GPU picking which worked reasonably well as a temp solution. However the problem is that because the cpu is just reading the positions buffer on gpu, you can’t pick any locations that are not visible on screen. As I was using the excavation tool this became problematic and made the tool unintuitive. Not only that, on my old and useless macbook pro the PBO(pixel buffer object) was still stalling the cpu despite PBO’s being non blocking. The new solution involves casting a ray from the camera through the terrain and calculating where there is an intersection. Works a treat, don’t know why I didn’t just do this before really.
Other Additions/Changes
- Refactored the worldgen noise sampler.
- Refactored the precipice mesh generator
- Fixed a bug where the world tiles were actually be rendered mirrored on the Z axis.
- Fixed the camera fog distance from showing unrendered geometry when zoomed in.
- Oncreen nodes now hold a component which links to the underlying world object.