rvandoosselaer / Blocks

A block (voxel) engine for jMonkeyEngine
BSD 3-Clause "New" or "Revised" License
41 stars 14 forks source link

Add color keying to block material #36

Closed rvandoosselaer closed 4 years ago

rvandoosselaer commented 4 years ago

Add the ability to color (parts of) the textures of a block. By supplying an optional color-key map and a color.

This way you can dynamically change the color of a block:

TypeRegistry typeRegistry = BlocksConfig.getInstance().getTypeRegistry();
Material grassMaterial = typeRegistry.get(TypeIds.GRASS);
grassMaterial.setColor("KeyColor", ColorRGBA.Blue);

Separate these blend functions in a glsllib file. functions:

see: https://en.wikipedia.org/wiki/Blend_modes#Multiply_and_Screen

Update FluidDepth filter, add flag to switch between blend modes. (overlay/layer)