Skip to content

Commit

Permalink
misc changes(added a bug list)
Browse files Browse the repository at this point in the history
  • Loading branch information
VaporWave committed Jul 12, 2020
1 parent f2d8971 commit 9f61f7b
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 8 deletions.
5 changes: 5 additions & 0 deletions known_bugs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
! BUGS
1: The edge of the lightmap creates a bright line
2: Normals are very slightly off
3: Hand isn't working
4: Shadows and the beginning of the night is very dark
2 changes: 1 addition & 1 deletion shaders/block.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; Leaves
block.18 = minecraft:leaves minecraft:leaves2
block.18 = minecraft:oak_leaves minecraft:spruce_leaves minecraft:birch_leaves minecraft:jungle_leaves minecraft:acacia_leaves minecraft:dark_oak_leaves

; Flowers
block.37 = minecraft:yellow_flower minecraft:red_flower
Expand Down
1 change: 1 addition & 0 deletions shaders/cfg/global.scfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define GAMMA 2.2
#define Vignette_Strength 1.6 //[0.0 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5]

#define TEXTURE_RESOLUTION 16 // [16 32 64 128 256 512 1024 2048]
4 changes: 2 additions & 2 deletions shaders/composite.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

//--// Misc

const float sunPathRotation = -40.0;
const int noiseTextureResolution = 64;
const float sunPathRotation = -30.0;
const int noiseTextureResolution = 128;

//--// Shadows

Expand Down
4 changes: 2 additions & 2 deletions shaders/composite2.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define REFLECTION_SAMPLES 1 // [0 1 2 4 8 16]
#define REFLECTION_BOUNCES 1 // [1 2]

//--// Whatever I end up naming this //------------------------------------------------------------------//
//--// Materials //--------------------------------------------------------------------------------------//

#include "/lib/materials.glsl"

Expand Down Expand Up @@ -369,7 +369,7 @@ void main() {
}
#endif

composite += surface.mat.emission * ILLUMINANCE_BLOCK;
composite += surface.mat.emission * LUMINANCE_BLOCK;

if (waterMask) {
composite = calculateWaterShading(surface);
Expand Down
11 changes: 11 additions & 0 deletions shaders/final.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ void tonemap(inout vec3 color) {
color /= color + 1.0;
color = pow(color, vec3(0.5 / GAMMA));
}

void vignette(inout vec3 color) {
float dist = distance(fragCoord, vec2(0.5)) * Vignette_Strength;

dist = pow(dist / 2.0, 1.1);

color * (1.0 - dist);
}

void dither(inout vec3 color) {
const mat4 pattern = mat4(
1, 9, 3, 11,
Expand All @@ -92,6 +101,8 @@ void main() {
#ifdef BLOOM
applyBloom(finalColor);
#endif

vignette(finalColor);

lowLightAdapt(finalColor);

Expand Down
2 changes: 1 addition & 1 deletion shaders/lib/light/block.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ vec3 calculateBlockLight(float mask) {
float dist = max((1 - mask) * 16 - 1, 0.0);
mask = mask / (dist * dist + 1);

vec3 light = ILLUMINANCE_BLOCK * vec3(1.00, 0.50, 0.20) * mask;
vec3 light = LUMINANCE_BLOCK * vec3(1.00, 0.50, 0.20) * mask;
return light;
}
4 changes: 2 additions & 2 deletions shaders/lib/lightingConstants.glsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Sun luminance is close to the exact value that will result in an illuminance of 128000 lux with what I have set for the apparent size of the sun.
// I might have gottent the luminance wrong tough.
// I might have gotten the luminance wrong tough.
#define LUMINANCE_SUN 6.61e6
#define ILLUMINANCE_SUN 128e3

Expand All @@ -14,4 +14,4 @@
#define ILLUMINANCE_SKY 7e3

// This value needs a lot of tuning. It also should really be LUMINANCE_BLOCK, but I'll change that later.
#define ILLUMINANCE_BLOCK 50
#define LUMINANCE_BLOCK 50

0 comments on commit 9f61f7b

Please sign in to comment.