mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-01-03 16:13:30 +08:00
Nightvision
This commit is contained in:
parent
158002d259
commit
3040061ea6
@ -53,7 +53,6 @@ uniform int frameCounter;
|
|||||||
uniform int isEyeInWater;
|
uniform int isEyeInWater;
|
||||||
uniform float far;
|
uniform float far;
|
||||||
uniform float near;
|
uniform float near;
|
||||||
uniform float nightVision;
|
|
||||||
uniform float frameTimeCounter;
|
uniform float frameTimeCounter;
|
||||||
uniform float rainStrength;
|
uniform float rainStrength;
|
||||||
uniform mat4 gbufferProjection;
|
uniform mat4 gbufferProjection;
|
||||||
|
@ -27,7 +27,6 @@ uniform sampler2DShadow shadow;
|
|||||||
uniform int frameCounter;
|
uniform int frameCounter;
|
||||||
uniform float rainStrength;
|
uniform float rainStrength;
|
||||||
uniform float eyeAltitude;
|
uniform float eyeAltitude;
|
||||||
uniform float nightVision;
|
|
||||||
uniform vec3 sunVec;
|
uniform vec3 sunVec;
|
||||||
flat varying vec3 WsunVec;
|
flat varying vec3 WsunVec;
|
||||||
uniform vec2 texelSize;
|
uniform vec2 texelSize;
|
||||||
|
@ -57,6 +57,10 @@ float tanh(float x){
|
|||||||
float ld(float depth) {
|
float ld(float depth) {
|
||||||
return (2.0 * near) / (far + near - depth * (far - near)); // (-depth * (far - near)) = (2.0 * near)/ld - far - near
|
return (2.0 * near) / (far + near - depth * (far - near)); // (-depth * (far - near)) = (2.0 * near)/ld - far - near
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uniform float nightVision;
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
gl_Position = ftransform()*0.5+0.5;
|
gl_Position = ftransform()*0.5+0.5;
|
||||||
@ -103,7 +107,7 @@ void main() {
|
|||||||
/// TOOO DAMN BLUE
|
/// TOOO DAMN BLUE
|
||||||
// // only need to sample one spot for this
|
// // only need to sample one spot for this
|
||||||
// averageSkyCol += 2.0*skyFromTex(normalize(vec3(0.0,1.0,0.0)),colortex4).rgb/150.;
|
// 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_Clouds = max(averageSkyCol_Clouds, minimimlight);
|
||||||
averageSkyCol = max(averageSkyCol, minimimlight);
|
averageSkyCol = max(averageSkyCol, minimimlight);
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ uniform sampler2DShadow shadow;
|
|||||||
uniform sampler2D colortex5;
|
uniform sampler2D colortex5;
|
||||||
uniform sampler2D depthtex1;
|
uniform sampler2D depthtex1;
|
||||||
|
|
||||||
uniform float nightVision;
|
|
||||||
|
|
||||||
uniform vec3 sunVec;
|
uniform vec3 sunVec;
|
||||||
uniform float frameTimeCounter;
|
uniform float frameTimeCounter;
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
|
|
||||||
#ifndef OVERWORLD
|
#ifndef OVERWORLD
|
||||||
uniform float lightningFlash;
|
uniform float lightningFlash;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
uniform float nightVision;
|
||||||
//// OVERWORLD ////
|
//// OVERWORLD ////
|
||||||
#ifdef OVERWORLD
|
#ifdef OVERWORLD
|
||||||
vec3 DoAmbientLighting (vec3 SkyColor, vec3 TorchColor, vec2 Lightmap, float skyLightDir){
|
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 ;
|
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;
|
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;
|
return SkyLight * skyLightDir + TorchLight;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ uniform sampler2D gaux1;
|
|||||||
uniform sampler2D depthtex1;
|
uniform sampler2D depthtex1;
|
||||||
uniform sampler2D colortex5;
|
uniform sampler2D colortex5;
|
||||||
|
|
||||||
uniform float nightVision;
|
|
||||||
|
|
||||||
uniform vec3 sunVec;
|
uniform vec3 sunVec;
|
||||||
uniform float frameTimeCounter;
|
uniform float frameTimeCounter;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user