Added base block face brightness modifier
This commit is contained in:
parent
95f49dd277
commit
f90d3717c0
@ -36,10 +36,6 @@ namespace TrueCraft.Client.Modules
|
||||
ChunkRenderer.Start();
|
||||
|
||||
OpaqueEffect = new BasicEffect(Game.GraphicsDevice);
|
||||
OpaqueEffect.EnableDefaultLighting();
|
||||
OpaqueEffect.DirectionalLight0.SpecularColor = Color.Black.ToVector3();
|
||||
OpaqueEffect.DirectionalLight1.SpecularColor = Color.Black.ToVector3();
|
||||
OpaqueEffect.DirectionalLight2.SpecularColor = Color.Black.ToVector3();
|
||||
OpaqueEffect.TextureEnabled = true;
|
||||
OpaqueEffect.Texture = Game.TextureMapper.GetTexture("terrain.png");
|
||||
OpaqueEffect.FogEnabled = true;
|
||||
|
@ -88,13 +88,22 @@ namespace TrueCraft.Client.Rendering
|
||||
var quad = new VertexPositionNormalColorTexture[4];
|
||||
var unit = CubeMesh[(int)face];
|
||||
var normal = CubeNormals[(int)face];
|
||||
var faceColor = new Color(FaceBrightness[(int)face] * color.ToVector3());
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
quad[i] = new VertexPositionNormalColorTexture(offset + unit[i], normal, color, texture[textureOffset + i]);
|
||||
quad[i] = new VertexPositionNormalColorTexture(offset + unit[i], normal, faceColor, texture[textureOffset + i]);
|
||||
}
|
||||
return quad;
|
||||
}
|
||||
|
||||
protected static readonly float[] FaceBrightness =
|
||||
new float[]
|
||||
{
|
||||
0.6f, 0.6f, // North / South
|
||||
0.8f, 0.8f, // East / West
|
||||
1.0f, 0.5f // Top / Bottom
|
||||
};
|
||||
|
||||
protected enum CubeFace
|
||||
{
|
||||
PositiveZ = 0,
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\targets\Client.targets" />
|
||||
<PropertyGroup>
|
||||
@ -379,8 +379,5 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Modules\" />
|
||||
<Folder Include="Content\Audio\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
Reference in New Issue
Block a user