Less yellow light

This commit is contained in:
Paul Mathieu 2021-12-11 15:17:53 -08:00
parent 49e814d1bc
commit ce7f4f66c5

View File

@ -23,7 +23,7 @@ void main() {
lowp vec3 normal = mat3(modelview) * aNormal; lowp vec3 normal = mat3(modelview) * aNormal;
lowp vec3 lightDirection = - normalize(mat3(uView) * vec3(1.0, -0.3, -0.8)); lowp vec3 lightDirection = - normalize(mat3(uView) * vec3(1.0, -0.3, -0.8));
lowp float diffuseAmount = max(dot(lightDirection, normal), 0.0); lowp float diffuseAmount = max(dot(lightDirection, normal), 0.0);
lowp vec3 ambiant = vec3(0.7, 0.7, 0.2); lowp vec3 ambiant = 0.4 * vec3(1.0, 1.0, 0.9);
vLighting = ambiant + vec3(1.0, 1.0, 1.0) * diffuseAmount; vLighting = ambiant + vec3(1.0, 1.0, 1.0) * diffuseAmount;
vTextureCoord = aTextureCoord; vTextureCoord = aTextureCoord;
@ -48,7 +48,7 @@ void main() {
`; `;
/** Draw. /** Draw.
* *
* @param {WebGLRenderingContext} gl * @param {WebGLRenderingContext} gl
*/ */
function draw(gl, params, objects) { function draw(gl, params, objects) {
@ -230,7 +230,7 @@ function makeChunk(x, y) {
const height = Math.floor(64 + 64 * terrain[i * 16 + j]); const height = Math.floor(64 + 64 * terrain[i * 16 + j]);
// everything above is air // everything above is air
// that block is grass // that block is grass
// everything below is dirt // everything below is dirt
const offset = i * (16 * 256) + j * 256; const offset = i * (16 * 256) + j * 256;
const stoneHeight = Math.min(62, height); const stoneHeight = Math.min(62, height);
chunk.set(Array(stoneHeight).fill(BlockType.STONE), offset); chunk.set(Array(stoneHeight).fill(BlockType.STONE), offset);