Cleanup, fixed clouds, removed 45-degree terrain sprites

This commit is contained in:
Joshua Barretto 2020-04-23 01:37:16 +01:00
parent e35dff2f4b
commit 1983fd8ec1
3 changed files with 2 additions and 6 deletions

View File

@ -32,7 +32,7 @@ vec2 cloud_at(vec3 pos) {
float density = max((value - CLOUD_THRESHOLD) - abs(pos.z - CLOUD_AVG_HEIGHT) / 200.0, 0.0) * CLOUD_DENSITY;
const float SHADE_GRADIENT = 1.5 / (CLOUD_AVG_HEIGHT - CLOUD_HEIGHT_MIN);
float shade = ((pos.z - CLOUD_AVG_HEIGHT) / (CLOUD_HEIGHT_MAX - CLOUD_HEIGHT_MIN)) * 10.5 + 0.7;
float shade = (pos.z - CLOUD_AVG_HEIGHT) / (CLOUD_HEIGHT_MAX - CLOUD_HEIGHT_MIN) * 5.0 + 0.3;
return vec2(shade, density / (1.0 + vsum(abs(pos - cam_pos.xyz)) / 5000));
}

View File

@ -21,10 +21,6 @@ out vec4 tgt_color;
#include <sky.glsl>
#include <light.glsl>
float vmin(vec3 v) {
return min(v.x, min(v.y, v.z));
}
void main() {
// First 3 normals are negative, next 3 are positive
vec3 normals[6] = vec3[](vec3(-1,0,0), vec3(1,0,0), vec3(0,-1,0), vec3(0,1,0), vec3(0,0,-1), vec3(0,0,1));

View File

@ -276,7 +276,7 @@ fn mesh_worker<V: BaseVol<Vox = Block> + RectRasterableVol + ReadVol + Debug>(
let seed = wpos.x as u64 * 3
+ wpos.y as u64 * 7
+ wpos.x as u64 * wpos.y as u64; // Awful PRNG
let ori = block.get_ori().unwrap_or((seed % 8) as u8);
let ori = block.get_ori().unwrap_or((seed % 4) as u8 * 2);
let instance = SpriteInstance::new(
Mat4::identity()