I'm working on a Minecraft clone at the moment as a way to learn more about procedural generation. I've got infinite generation going, Chunks that generates a single mesh each chunk from an array of Block data, the textures being handled from a texture atlas, and then some. As it is now I'm using actual Minecraft textures as placeholders, and what I'm looking to achieve is a similar result of grass/leaves/etc changing colours depending on the type of biome they're in. I'm not worried about the biomes yet, I'm currently stuck on actually just changing the colour.
Looking at the textures used for grass by Minecraft shows:
1. grass_top - Which is a greyscaled top face texture of grass
2. grass_side - A side face coloured showcasing dirt, and a bit of grass at the top
3. grass_side_overlay - The same as the previous texture, but the dirt is removed, and the image is greyscaled like the grass_top
What I have now which is a temparary solution I setup earlier prior to wanting to work on having different coloured grass/leaves/etc, is the side face always being grass_side, and the top being coloued in with a modified version of standard shader that allows vertex colour. Obviously this wouldn't be applicable since it would leave bits of dirt on the faces having grass_side as a texture with some discolouration.
I've thought of trying to overlay a secondary texture like the name of Minecrafts texture suggests, but that doesn't seem possible without modifying standard shader, nor am I entirely sure that would work or be optimal considering my textures come from a texture atlas.
So I'm wondering what kind of approaches can be looked at to solve this problem, and what might be considered the best, or most optimal way of achieving this result. I'm also wondering if there is a way this can be done without modifying standard shader.
↧