mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2026-10-10 05:03:04 +08:00
instantly transition scene controller values if shader freshly loaded or window resizes
This commit is contained in:
@@ -61,7 +61,7 @@ uniform int isEyeInWater;
|
|||||||
|
|
||||||
uniform float dayChangeSmooth;
|
uniform float dayChangeSmooth;
|
||||||
uniform bool worldTimeChangeCheck;
|
uniform bool worldTimeChangeCheck;
|
||||||
|
uniform bool windowResizeCheck;
|
||||||
uniform int hideGUI;
|
uniform int hideGUI;
|
||||||
uniform float near;
|
uniform float near;
|
||||||
|
|
||||||
@@ -204,7 +204,9 @@ float HG_phase(float x, float g){
|
|||||||
}
|
}
|
||||||
|
|
||||||
vec3 doPixelTimer(in vec3 targetValue, in vec3 prevFrameValue){
|
vec3 doPixelTimer(in vec3 targetValue, in vec3 prevFrameValue){
|
||||||
|
// do not transition if the shader has just loaded or if the window resized.
|
||||||
|
if(frameCounter < 2 || windowResizeCheck) return targetValue;
|
||||||
|
|
||||||
// if the value is below the target value, add time. if the value is above the target value, subtract time.
|
// if the value is below the target value, add time. if the value is above the target value, subtract time.
|
||||||
// this polarity variable determines what direction on the numberline to go.
|
// this polarity variable determines what direction on the numberline to go.
|
||||||
vec3 polarity = floor(clamp((targetValue - prevFrameValue)*65000.0,-1.0,1.0));
|
vec3 polarity = floor(clamp((targetValue - prevFrameValue)*65000.0,-1.0,1.0));
|
||||||
|
|||||||
@@ -573,9 +573,12 @@ uniform.vec3.lightningEffect = vec3(lightningFlash, lightningFlash, lightningFla
|
|||||||
############################
|
############################
|
||||||
# force LUT accumulation to have a high blend factor after a certain amount of time
|
# force LUT accumulation to have a high blend factor after a certain amount of time
|
||||||
uniform.float.dayChangeSmooth = smooth(if(abs(smooth(worldDay, 0.05, 0.05) - worldDay) > 0.01, 0.0, 1.0), 300.0, 0.0)
|
uniform.float.dayChangeSmooth = smooth(if(abs(smooth(worldDay, 0.05, 0.05) - worldDay) > 0.01, 0.0, 1.0), 300.0, 0.0)
|
||||||
|
|
||||||
uniform.bool.worldTimeChangeCheck = abs(smooth(sunAngle, 1.0, 1.0) - sunAngle) > 0.01
|
uniform.bool.worldTimeChangeCheck = abs(smooth(sunAngle, 1.0, 1.0) - sunAngle) > 0.01
|
||||||
|
|
||||||
|
uniform.bool.windowResizeCheck = (abs(smooth(viewWidth, 1.0, 1.0) - viewWidth) > 0.01) || (abs(smooth(viewHeight, 1.0, 1.0) - viewHeight) > 0.01)
|
||||||
|
|
||||||
|
# uniform.int.randomInteger = randomInt()
|
||||||
|
|
||||||
#if WATER_ON_CAMERA_EFFECT_AMOUNT > 0
|
#if WATER_ON_CAMERA_EFFECT_AMOUNT > 0
|
||||||
variable.float.waterState = smooth(if(isEyeInWater == 1,1.0,0.0),0.1,0.1)
|
variable.float.waterState = smooth(if(isEyeInWater == 1,1.0,0.0),0.1,0.1)
|
||||||
variable.float.lerptime = if((waterState < 0.1 || waterState > 0.9), 100000000000000.0, 0.0)
|
variable.float.lerptime = if((waterState < 0.1 || waterState > 0.9), 100000000000000.0, 0.0)
|
||||||
|
|||||||
Reference in New Issue
Block a user