Grass needs to be tinted to biome colors #147

Closed
opened 2015-06-19 01:20:07 -04:00 by ddevault · 9 comments
ddevault commented 2015-06-19 01:20:07 -04:00 (Migrated from github.com)

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.

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. ![](https://sr.ht/951d.png) 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.
NSDex commented 2015-06-19 01:39:29 -04:00 (Migrated from github.com)

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.

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.
moorehousew commented 2015-06-19 07:58:06 -04:00 (Migrated from github.com)

We can stick with BasicEffect if I'm not mistaken by writing a custom vertex structure that implements IVertexType and gives us; position, normal, color, and texture coords. Then just replace everywhere we used VertexPositionNormalTexture with this new struct.

We can stick with `BasicEffect` if I'm not mistaken by writing a custom vertex structure that implements `IVertexType` and gives us; position, normal, color, and texture coords. Then just replace everywhere we used `VertexPositionNormalTexture` with this new struct.
ddevault commented 2015-06-19 09:06:37 -04:00 (Migrated from github.com)

But using the additional fields given by the new struct requires a custom shader, no?

But using the additional fields given by the new struct requires a custom shader, no?
moorehousew commented 2015-06-19 12:51:24 -04:00 (Migrated from github.com)

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 into BasicEffect, XNA just doesn't expose a pre-made vertex class that holds all those fields.

No, XNA automagically glues our vertex fields to their implementation using a custom `VertexDeclaration` instance provided by us. See [this article](https://msdn.microsoft.com/en-us/library/bb976065.aspx) on MSDN. Color, texture and lighting support is already baked into `BasicEffect`, XNA just doesn't expose a pre-made vertex class that holds all those fields.
ddevault commented 2015-06-19 12:53:52 -04:00 (Migrated from github.com)

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?

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?
moorehousew commented 2015-06-19 13:01:20 -04:00 (Migrated from github.com)

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.

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.
moorehousew commented 2015-06-19 13:05:06 -04:00 (Migrated from github.com)

See this article; AO is dead simple in a voxel-based game.

See [this article](http://0fps.net/2013/07/03/ambient-occlusion-for-minecraft-like-worlds/); AO is dead simple in a voxel-based game.
ddevault commented 2015-06-19 13:20:36 -04:00 (Migrated from github.com)

I guess at some point we'll just have to bite the bullet and write a shader.

I guess at some point we'll just have to bite the bullet and write a shader.
NSDex commented 2015-06-19 23:30:01 -04:00 (Migrated from github.com)

I haven't investigated the smooth lighting stuff in my decompiled minecraft but I believe AO is also baked into the vertex color.

I haven't investigated the smooth lighting stuff in my decompiled minecraft but I believe AO is also baked into the vertex color.
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: AstralTransRocketries/TrueCraft#147
No description provided.