Nightvision

This commit is contained in:
Xonk 2023-06-28 20:12:49 -04:00
parent 158002d259
commit 3040061ea6
6 changed files with 9 additions and 6 deletions

View File

@ -53,7 +53,6 @@ uniform int frameCounter;
uniform int isEyeInWater;
uniform float far;
uniform float near;
uniform float nightVision;
uniform float frameTimeCounter;
uniform float rainStrength;
uniform mat4 gbufferProjection;

View File

@ -27,7 +27,6 @@ uniform sampler2DShadow shadow;
uniform int frameCounter;
uniform float rainStrength;
uniform float eyeAltitude;
uniform float nightVision;
uniform vec3 sunVec;
flat varying vec3 WsunVec;
uniform vec2 texelSize;

View File

@ -57,6 +57,10 @@ float tanh(float x){
float ld(float depth) {
return (2.0 * near) / (far + near - depth * (far - near)); // (-depth * (far - near)) = (2.0 * near)/ld - far - near
}
uniform float nightVision;
void main() {
gl_Position = ftransform()*0.5+0.5;
@ -103,7 +107,7 @@ void main() {
/// TOOO DAMN BLUE
// // only need to sample one spot for this
// averageSkyCol += 2.0*skyFromTex(normalize(vec3(0.0,1.0,0.0)),colortex4).rgb/150.;
vec3 minimimlight = vec3(0.2,0.4,1.0) * MIN_LIGHT_AMOUNT*0.0005;
vec3 minimimlight = vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.0005 + nightVision);
averageSkyCol_Clouds = max(averageSkyCol_Clouds, minimimlight);
averageSkyCol = max(averageSkyCol, minimimlight);

View File

@ -28,7 +28,6 @@ uniform sampler2DShadow shadow;
uniform sampler2D colortex5;
uniform sampler2D depthtex1;
uniform float nightVision;
uniform vec3 sunVec;
uniform float frameTimeCounter;

View File

@ -3,7 +3,10 @@
#ifndef OVERWORLD
uniform float lightningFlash;
#endif
uniform float nightVision;
//// OVERWORLD ////
#ifdef OVERWORLD
vec3 DoAmbientLighting (vec3 SkyColor, vec3 TorchColor, vec2 Lightmap, float skyLightDir){
@ -20,7 +23,7 @@ vec3 DoAmbientLighting (vec3 SkyColor, vec3 TorchColor, vec2 Lightmap, float sky
SkyColor += vec3(Lightning_R,Lightning_G,Lightning_B) * 25.0 * skyLightDir * lightningFlash ;
float skyLM = (pow(Lightmap.y,15.0)*2.0 + pow(Lightmap.y,2.5))*0.5;
vec3 SkyLight = max(SkyColor * skyLM, vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.01) );
vec3 SkyLight = max(SkyColor * skyLM, vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.01 + nightVision) );
return SkyLight * skyLightDir + TorchLight;
}

View File

@ -22,7 +22,6 @@ uniform sampler2D gaux1;
uniform sampler2D depthtex1;
uniform sampler2D colortex5;
uniform float nightVision;
uniform vec3 sunVec;
uniform float frameTimeCounter;