Rendering | Raycasting |
---|---|
Renders scene using Python bindings to modern OpenGL.
- Uses geometry shader to render single points as block faces.
- Has separate water layer for blending with underwater blocks. (implemented in deprecated
opengl_renderer
) - Computes and uses shadow map texture. (implemented in deprecated
opengl_renderer
) - Renders shadow map texture in projection appopieate for current view.
- Renders far chunks as part of sky box to provide high fps with large view distance.
In current implementation using 4000x3000
chunks of freshly generated Hermitcraft Season 7 seed (WLLBYUG
) has 4 frames per second.
Renders scene using custom raytracer. Vector manipulation is done in Python using Numpy, while the core raytracing is run on GPU using Microsoft AMP library.
- Raytraces all target pixels to find first block.
- Raytraces all pixels in direction of sun to find shadows.
- Performs light refraction according to Snell's Law while rendering underwater objects.
- Performs light reflection according to Schlick's approximation of Fresnel formula.
In current implementation huge limitation is size of buffer describing world, which needs to fit fully in GPU memory.
Official Minecraft server release.
Generated from Minecraft using following command:
java -cp minecraft_server.jar net.minecraft.data.Main --all
Read more: https://wiki.vg/Data_Generators
Generated using noxitu.minecraft.protocol.proxy_server
module.
Each of files has filename with format {x}-{z}-{section_mask}.bin
and contain Minecraft "Chunk Format" data (see: https://wiki.vg/Chunk_Format).
This module opens a server on :25566, that connects to server running on :25565. It then intercepts all chunk messages and stores each of them in data/chunks_raw/
directory. It also uses and stores data/biomes.npz
to provide life visualization of recieved chunks (this process can be quite slow, especially while generating new chunks).
Currently target server must be running in offline mode, since encryption is not supported.
For scraping following setup could be used:
- Set both server and client view distances to 32. This allows collecting
1024x1024
area without interaction. - Navigate world using
/tp
commands. To capture area of about4000x3000
around0, 0
:/tp -2048 300 -1536
to move to starting position,/tp ~1024 300 ~
to move to next block in same row,/tp -2048 300 ~1024
to move to start of next row.
Seeing how server strugles to generate chunks at decent speed this step probably could be replaced to generate data/chunks/*
in the future.
Generated using noxitu.minecraft.map.chunk_data
module using data/chunks_raw/*
as input.
Each of files has filename with format {x}_{z}_chunk.bin
and contain a uint16
numpy array with shape (256, 16, 16)
. Each entry describes ID from global palette (the same as in blocks.json
).
This directory together with a single viewport is used as input for noxitu.minecraft.raycasting.main
(via noxitu.minecraft.map.load
).
This will be removed soon.
Generated using noxitu.minecraft.renderer.create_face_buffer
module using data/chunks/*
as input (via noxitu.minecraft.map.load
).
Contains a buffer ready for rendering using GL_QUADS. Internally this buffer has shape (n, 4)
(4 vertices per face), and dtype [('vertices', '3int16'), ('colors', '3uint8')]
.
This buffer is limited only to visible faces - faces of opaque blocks with transparent blocks in front.
A single buffer is used as input for noxitu.minecraft.rendering.opengl_renderer
(deprecated).
Generated using noxitu.minecraft.renderer.create_face_buffer
module using data/chunks/*
as input (via noxitu.minecraft.map.load
).
Contains a buffer ready for rendering using GL_POINTS, preferably with geometry shader converting each point into square face. Internally this buffer has shape (n,)
, and dtype [('position', '3int16'), ('direction', 'uint8'), ('color', '3uint8')]
.
This buffer is limited only to visible faces - faces of opaque blocks with transparent blocks in front.
Direction is enum with following meaning:
- West face (negative x)
- East face (positive x)
- Bottom face (negative y)
- Top face (positive y)
- North face (negative z)
- South face (positive z)
A single buffer is used as input for noxitu.minecraft.rendering.main
.
Current viewport can be saved from noxitu.minecraft.rendering.main
(or noxitu.minecraft.rendering.opengl_renderer
) by pressing 4
.
Viewports are used as input for noxitu.minecraft.raycasting.main
.