Grass needs to be tinted to biome colors #147
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Biomes are entirely out of scope until feature parity is reached, but we should color them some shade of green so that non-default texture packs don't look like shit.
I think this will require a custom shader (rather than BasicEffect), and we should probably consider it around the same time we work on lighting.
I briefly touch on this subject in the Lighting wiki page. The biome tinting is part of the computation used to produce the vertex color.
We can stick with
BasicEffect
if I'm not mistaken by writing a custom vertex structure that implementsIVertexType
and gives us; position, normal, color, and texture coords. Then just replace everywhere we usedVertexPositionNormalTexture
with this new struct.But using the additional fields given by the new struct requires a custom shader, no?
No, XNA automagically glues our vertex fields to their implementation using a custom
VertexDeclaration
instance provided by us. See this article on MSDN. Color, texture and lighting support is already baked intoBasicEffect
, XNA just doesn't expose a pre-made vertex class that holds all those fields.Oh, that's super nifty. That makes things a lot easier. Will we be able to get away with implementing block light without a shader, then?
Yes we could, but I think it would be better to just eventually implement deferred rendering instead; A better use of per-vertex colors for lighting would be ambient occlusion.
See this article; AO is dead simple in a voxel-based game.
I guess at some point we'll just have to bite the bullet and write a shader.
I haven't investigated the smooth lighting stuff in my decompiled minecraft but I believe AO is also baked into the vertex color.