DragonDev1906 / Minecraft-Overviewer

Render high-resolution maps of a Minecraft world with a Leaflet powered interface
https://overviewer.org/
GNU General Public License v3.0
2 stars 0 forks source link

Use moderngl to render full blocks #3

Open DragonDev1906 opened 4 years ago

DragonDev1906 commented 4 years ago

Render full blocks using moderngl. Mainly to test the functionality of moderngl and implement a system for easy extensibility.

The following image shows the blocks rendered using PIL 2020-03-25_14:56:28

DragonDev1906 commented 4 years ago

Progress so far:

grafik

grafik

DragonDev1906 commented 4 years ago

Translation and Scale of blocks (partial blocks) didn't work, showing an error in the projection matrix. This error should now be fixed

grafik

DragonDev1906 commented 4 years ago

Blocks can now have different textures on each face (additionally this is helpful for giving different textures to blocks)

grafik

DragonDev1906 commented 4 years ago

Which texture to use is now (2bad7595fae2e58f527de404544fd9c02ca2d742) read from the json files. For that to work the following two methods have to be implemented (currently they return dummy values):

DragonDev1906 commented 4 years ago

UVs from the model definition (json) are now used for rendering.

a4e865a84e6213c6075c928c1c83178712bd755b

grafik

DragonDev1906 commented 4 years ago

The rotation defined in blockstate files is now applied (rotating the entire block as minecraft does)

grafik

DragonDev1906 commented 4 years ago

The "uvlock" values is now used to ignore rotations on the block if set to true. This results in stairs (e.g. oak stairs) beeing rendered correctly c056a3c303095acfd2253231ae759acd06648251

grafik

DragonDev1906 commented 4 years ago

A single, directional light is now supported

8d4ebcf9da851fdd21b522220cafa47905540d8b

grafik

DragonDev1906 commented 4 years ago

Add support for rotated cubes (parts of blocks) (e.g. Lantern)

477a8c50797f4d20a5225978263611d757c8db37

grafik

DragonDev1906 commented 4 years ago

As shown in the first image the uvlock didn't quite work correctly. Because of the oak_planks texture this wasn't visible earlier but came up when the stairs were rendered with the sapling texture.

Fixed in d1a822b15dadd5968d6bda0099bee308ac89db78

grafik

grafik

DragonDev1906 commented 4 years ago

The rescale option in element["rotation"] is now used. This is for example used for saplings. In the current version of overviewer this option is not needed (for saplings at least) because their textures are always shown from straight on. Adding this option makes the system more future proof and it might work for resource packs using it with different rotations.

The black half is because of the light settings which are optimized for the isometric angle, not for viewing from only one direction as shown in the image.

Wiki: https://minecraft.gamepedia.com/Model#Example:_Sapling

Commit: 81912195c558a9fae9ee5c9ffed9850757b8aa78

Update 1: Unfortunatly this looks wierd when the texture tile is squashed together and rescale is enabled. Maybe there should be an option to disable rescale or better: don't squash the tile.

Update 2: Removed the rescale option in e4c44311180ef0674474dc9344f6b7bcdb57cb2e because it didn't work correctly and everything seemed to look better without it

grafik

grafik

DragonDev1906 commented 4 years ago

Correct rendering for non-existant faces (previously they used the texture with index 0

87f10a46fb85bb5c664d8faac12134386498c697

Below is an image of a cactus (with the oak_planks texture)

tilemap

DragonDev1906 commented 4 years ago

Here is an image of all currently rendered Blocks (using the oak_planks texture)

tilemap

DragonDev1906 commented 4 years ago

The blockstate/elements/./faces/./rotation parameter is now used. It rotates the texture on the face without changing what is displayed. Without this parameter some faces were rotated and scaled wrong.

d2bf84e42139a27f20be5118f491fa4336ac8b8d

Before: tilemap2

After: tilemap2

DragonDev1906 commented 4 years ago

The renderer is now pretty mutch finished for blocks using "variant"

tilemap

Tirpitz93 commented 4 years ago

Now with some more textures image

DragonDev1906 commented 4 years ago

All blocks seem to be rendered correctly.

Exception: Some blocks can't because the JSON file does not contain the required data (e.g. the bell block)

Commit: b0ce1d7d3fcd9e3298645f8c4cb5da4400451361

tilemap