fenomas / noa

Experimental voxel game engine.
MIT License
616 stars 91 forks source link

Is there away to change block color when placing it #82

Closed levlups closed 4 years ago

levlups commented 5 years ago

this will be used to place for example a grass block of different shades for shadows

like in this picture shadows

fenomas commented 5 years ago

Hi, so there is no feature like this currently. Here's the story on block colors at the moment.

When terrain is built, vertex colors are used for AO (shadows in corners) and for blocks whose material has a color but no texture. Blocks with a texture get white vertices.

It would be easy to change things such that vertex colors always get assigned even with textures, but I'm not certain whether that would color blocks the way you want.. it would depend on what going on with the different color channels (emissive etc).

As for lighting generally, to be honest I've not thought about it much as it's not needed for the game I'm personally working on. A more comprehensive approach to lighting, eg the way Minecraft does it with a 3D light map, would be possible but it's not something I'm planning on trying soon.