pastebin

Paste #irl -- näytä pelkkänä tekstinä -- uusi tämän pohjalta

Värjäys: Tyyli: ensimmäinen rivinumero: Tabin korvaus:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
1. Leave all the mapblock meshes as they are, but sort all meshbuffers with
   a transparent material before drawing them. The performance impact will
   be minor if the sorting is implemented well (maybe use some sort of
   incremental sorting scheme that only performs a few sorting steps per frame).

   There will still be many glitches with this approach, since the order that
   faces within a meshbuffer are drawn in can not be controlled.

2. Like 1., but when you generate a mesh, split meshbuffers with transparent
   materials so that each is a subset of the boundary of a convex shape.
   E.g. make each transparent MapNode a separate meshbuffer (to be completely
   precise, make each single box in node_box a separate meshbuffer).

   This sounds detrimental to performance.

3. Render all transparent faces into a separate frame buffer with the
   following render settings:
   - Z sorting enabled, so that near faces overwrite far ones
   - No alpha blending. Just write the unmodified R,G,B,A from the texture.
   When all transparent objects have been rendered, blit everything onto
   the main frame buffer with alpha blending. This will cause transparent
   objects that are "obscured" by another transparent object to be invisible.