• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..13-Apr-2020-

win32/H13-Apr-2020-225155

README.mdH A D13-Apr-20203.4 KiB8665

cave_main.cH A D13-Apr-202015.5 KiB599452

cave_mesher.cH A D13-Apr-202028.1 KiB929695

cave_parse.cH A D13-Apr-202016.8 KiB633508

cave_parse.hH A D13-Apr-2020973 4230

cave_render.cH A D13-Apr-202028.8 KiB952725

caveview.dspH A D13-Apr-20204.6 KiB158131

caveview.dswH A D13-Apr-2020510 3019

caveview.hH A D13-Apr-20201.2 KiB5031

glext.hH A D13-Apr-2020712.7 KiB11,12510,581

glext_list.hH A D13-Apr-20201.2 KiB3430

main.cH A D13-Apr-20200 10

stb_gl.hH A D13-Apr-202037.2 KiB1,104849

stb_glprog.hH A D13-Apr-202019.8 KiB505307

README.md

1# FAQ
2
3### How to run it?
4
5There's no GUI. Find a directory with Minecraft Anvil files (.mca).
6Copy a Minecraft "terrain.png" into that directory (do a google
7image search). Run from that directory.
8
9### How accurate is this as a Minecraft viewer?
10
11Not very. Many Minecraft blocks are not handled correctly:
12
13*         No redstone, rails, or other "flat" blocks
14*         No signs, doors, fences, carpets, or other complicated geometry
15*         Stairs are turned into ramps
16*         Upper slabs turn into lower slabs
17*         Wood types only for blocks, not stairs, slabs, etc
18*         Colored glass becomes regular glass
19*         Glass panes become glass blocks
20*         Water is opaque
21*         Water level is incorrect
22*         No biome coloration
23*         Cactus is not shrunk, shows holes
24*         Chests are not shrunk
25*         Double-chests draw as two chests
26*         Pumpkins etc. are not rotated properly
27*         Torches are drawn hackily, do not attach to walls
28*         Incorrect textures for blocks that postdate terrain.png
29*         Transparent textures have black fringes due to non-premultiplied-alpha
30*         Skylight and block light are combined in a single value
31*         Only blocks at y=1..255 are shown (not y=0)
32*         If a 32x32x256 "quad-chunk" needs more than 800K quads, isn't handled (very unlikely)
33
34Some of these are due to engine limitations, and some of
35these are because I didn't make the effort since my
36goal was to make a demo for stb_voxel_render.h, not
37to make a proper Minecraft viewer.
38
39
40### Could this be turned into a proper Minecraft viewer?
41
42Yes and no. Yes, you could do it, but no, it wouldn't
43really resemble this code that much anymore.
44
45You could certainly use this engine to
46render the parts of Minecraft it works for, but many
47of the things it doesn't handle it can't handle at all
48(stairs, water, fences, carpets, etc) because it uses
49low-precision coordinates to store voxel data.
50
51You would have to render all of the stuff it doesn't
52handle through another rendering path. In a game (not
53a viewer) you would need such a path for movable entities
54like doors and carts anyway, so possibly handling other
55things that way wouldn't be so bad.
56
57Rails, ladders, and redstone lines could be implemented by
58using tex2 to overlay those effects, but you can't rotate
59tex1 and tex2 independently, so there may be cases where
60the underlying texture needs a different rotation from the
61overlaid texture, which would require separate rendering.
62Handling redstone's brightness being different from underlying
63block's brightness would require separate rendering.
64
65You can use the face-color effect to do biome coloration,
66but the change won't be smooth the way it is in Minecraft.
67
68
69### Why isn't building the mesh data faster?
70
71Partly because converting from minecraft data is expensive.
72
73Here is the approximate breakdown of an older version
74of this executable and lib that did the building single-threaded.
75
76*       25%   loading & parsing minecraft files (4/5ths of this is my crappy zlib)
77*       18%   converting from minecraft blockids & lighting to stb blockids & lighting
78*       10%   reordering from data[z][y]\[x] (minecraft-style) to data[y][x]\[z] (stb-style)
79*       40%   building mesh data
80*        7%   uploading mesh data to OpenGL
81
82I did do significant optimizations after the above, so the
83final breakdown is different, but it should give you some
84sense of the costs.
85
86