|
|
8 vuotta sitten | |
|---|---|---|
| .. | ||
| win32 | 11 vuotta sitten | |
| README.md | 11 vuotta sitten | |
| cave_main.c | 11 vuotta sitten | |
| cave_mesher.c | 8 vuotta sitten | |
| cave_parse.c | 11 vuotta sitten | |
| cave_parse.h | 11 vuotta sitten | |
| cave_render.c | 9 vuotta sitten | |
| caveview.dsp | 11 vuotta sitten | |
| caveview.dsw | 11 vuotta sitten | |
| caveview.h | 10 vuotta sitten | |
| glext.h | 11 vuotta sitten | |
| glext_list.h | 11 vuotta sitten | |
| main.c | 11 vuotta sitten | |
| stb_gl.h | 11 vuotta sitten | |
| stb_glprog.h | 11 vuotta sitten | |
There's no GUI. Find a directory with Minecraft Anvil files (.mca). Copy a Minecraft "terrain.png" into that directory (do a google image search). Run from that directory.
Not very. Many Minecraft blocks are not handled correctly:
Some of these are due to engine limitations, and some of these are because I didn't make the effort since my goal was to make a demo for stb_voxel_render.h, not to make a proper Minecraft viewer.
Yes and no. Yes, you could do it, but no, it wouldn't really resemble this code that much anymore.
You could certainly use this engine to render the parts of Minecraft it works for, but many of the things it doesn't handle it can't handle at all (stairs, water, fences, carpets, etc) because it uses low-precision coordinates to store voxel data.
You would have to render all of the stuff it doesn't handle through another rendering path. In a game (not a viewer) you would need such a path for movable entities like doors and carts anyway, so possibly handling other things that way wouldn't be so bad.
Rails, ladders, and redstone lines could be implemented by using tex2 to overlay those effects, but you can't rotate tex1 and tex2 independently, so there may be cases where the underlying texture needs a different rotation from the overlaid texture, which would require separate rendering. Handling redstone's brightness being different from underlying block's brightness would require separate rendering.
You can use the face-color effect to do biome coloration, but the change won't be smooth the way it is in Minecraft.
Partly because converting from minecraft data is expensive.
Here is the approximate breakdown of an older version of this executable and lib that did the building single-threaded.
I did do significant optimizations after the above, so the final breakdown is different, but it should give you some sense of the costs.