starandserpent / java-TerraServer

Terra - Voxel octree of chunks, made for Rituals of the old
MIT License
17 stars 2 forks source link

Extra vertices in test scene #41

Open Pilvinen opened 5 years ago

Pilvinen commented 5 years ago

There are more vertices in a scene than there are supposed to be.

UI has been taken into account. The JME docs say officially that UI takes 914 vertices, but the actual number seems to be 924.

This has been tested by disabling all generation and creating an empty scene.

1) Create a scene with radius 1. 2) Test generator has:

    public void generate(GenerationTask task, GeneratorControl control, Void nothing) {
        BlockBuffer buf = control.getBuffer();
        System.out.println("x:" + task.getX() + " y:" + task.getY() + " z:" + task.getZ());
        for (int i = 0; i < DataConstants.CHUNK_MAX_BLOCKS; i++) {
            buf.write(dirt);
            buf.next();
        }
        index++;
        System.out.println(index);
    }

This should produce 8 chunks with a vertex count of 64.

Instead it produces 8 chunks with the vertice count of 1124. When we subtract the vertices the UI uses (924 vertices) that still leaves us with 200 vertices for the whole scene, or to put it in a different manner - the rather curious 25 vertices per chunk.

Visually inspected there are no extra vertices, edges, or faces visible.

Printing the index looks normal:

masterIndex: 0
world center: 0.0, 0.0, 0.0, scale: 2048.0
x:-8.0 y:-8.0 z:-8.0
1
x:8.0 y:-8.0 z:-8.0
2
x:-8.0 y:8.0 z:-8.0
3
x:8.0 y:8.0 z:-8.0
4
x:-8.0 y:-8.0 z:8.0
5
x:8.0 y:-8.0 z:8.0
6
x:-8.0 y:8.0 z:8.0
7
x:8.0 y:8.0 z:8.0
8
Pawlost commented 5 years ago

We are not sure about this