You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got inspired by fogleman's [Craft](https://github.com/fogleman/Craft), but my development process bent over visual features, not gameplay ones.
98
+
99
+
#### Rendering
100
+
101
+
A couple of rendering optimizations are implemented, such as rendering only exposed faces, using face culling not to draw back faces of triangles,
102
+
and frustum culling, which is not drawing chunks that are not visible.
103
+
104
+
Each chunk has 2 vertex buffers, one for water blocks, the other for everything else. Using separate buffer for water is nessessary to ensure the right
105
+
rendering order, so everything will be seen through transparent blocks.
106
+
107
+
Water has actual transparency, but there's also alpha testing (binary transparency). In shader the alpha value of fragment is checked, and if it's less than 0.5,
108
+
the fragment is discarded. Alpha testing allows to draw transparent glass, flowers, grass and tree leaves without usual problems that come with transaprency.
109
+
110
+
When block in some chunk is changed, the chunk buffers are being completely rebuilt.
111
+
112
+
To implement post-processing visual effects, such as depth of field, motion blur, gamma correction and saturation tweak,
113
+
I had to use separate framebuffer. So, the game is being rendered on a texture, then it's being rendered on yet another texture
114
+
and during that the depth of field is applied, and in the final shader pass all other effects are applied and this image is actually what the player (you)
115
+
sees. I really like the result, DoF and motion blur look very good.
0 commit comments