PrismarineJS/prismarine-viewer

Biome blending for tints #197

AwesomestCode posted onGitHub

As of #25, we added biome tints. However, Vanilla has "biome blending," where the tints of blocks on the edges of biomes are blurred together to make the change between biomes more gradual/subtle. We do not; and this looks especially silly with trees (screenshot below).

<img width="1680" alt="Screen Shot 2021-06-23 at 1 43 41 PM" src="https://user-images.githubusercontent.com/53128754/123143907-13734080-d429-11eb-964f-de9b522be1f6.png">

This looks silly.

To reproduce

  • Travel to the coordinates in the screenshot on the MineWeb test server.
  • Observe the interesting colours.

A pre-requist for this would be to get the block accurate biome in mineflayer. Since 1.15 the server only send biomes values for squares of 4x4 blocks, the client has to interpolate to get the individual block biomes. prismarine-rng implement the VoronoiLayer code that does this interpolation https://github.com/PrismarineJS/prismarine-rng/blob/master/lib/biomes/layers.js#L561 but it needs to be integrated into mineflayer (and it should be computed on demand as it is not a trivial computation and biomes are rarely needed).

Once each block has a correct biome value, blending two tints is very straightforward, we just have to put a different tint on each vertex of the cube instead of the same on every vertices.

posted by Karang almost 4 years ago

I think we’ll still have to compute the blend a bit before putting the different colours on the vertices because the blending radius is usually larger than one block, right?

On Wed, Jun 23, 2021 at 14:35, Karang @.***> wrote:

A pre-requist for this would be to get the block accurate biome in mineflayer. Since 1.15 the server only send biomes values for squares of 4x4 blocks, the client has to interpolate to get the individual block biomes. prismarine-rng implement the VoronoiLayer code that does this interpolation https://github.com/PrismarineJS/prismarine-rng/blob/master/lib/biomes/layers.js#L561 but it needs to be integrated into mineflayer (and it should be computed on demand as it is not a trivial computation and biomes are rarely needed).

Once each block has a correct biome value, blending two tints is very straightforward, we just have to put a different tint on each vertex of the cube instead of the same on every vertices.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-viewer/issues/197#issuecomment-867068798, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMVK4MQGBVZW43CGRJ4YG4LTUISNXANCNFSM47GIW2TQ .

posted by AwesomestCode almost 4 years ago

Yes this part of the computation of the tint we put on each vertex.

posted by Karang almost 4 years ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests