mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-20 16:07:22 +08:00
make cloud movement based on world ticks. tiny end tweaks.
This commit is contained in:
parent
404fd9e99e
commit
36e6720d8e
@ -46,6 +46,8 @@ uniform int isEyeInWater;
|
|||||||
uniform vec2 texelSize;
|
uniform vec2 texelSize;
|
||||||
|
|
||||||
|
|
||||||
|
// uniform int worldTime;
|
||||||
|
|
||||||
#include "lib/Shadow_Params.glsl"
|
#include "lib/Shadow_Params.glsl"
|
||||||
#include "lib/color_transforms.glsl"
|
#include "lib/color_transforms.glsl"
|
||||||
#include "lib/color_dither.glsl"
|
#include "lib/color_dither.glsl"
|
||||||
|
@ -56,6 +56,8 @@ uniform ivec2 eyeBrightnessSmooth;
|
|||||||
#include "/lib/ROBOBO_sky.glsl"
|
#include "/lib/ROBOBO_sky.glsl"
|
||||||
#include "lib/sky_gradient.glsl"
|
#include "lib/sky_gradient.glsl"
|
||||||
|
|
||||||
|
// uniform int worldTime;
|
||||||
|
|
||||||
#define TIMEOFDAYFOG
|
#define TIMEOFDAYFOG
|
||||||
#include "lib/volumetricClouds.glsl"
|
#include "lib/volumetricClouds.glsl"
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ uniform float far;
|
|||||||
uniform float frameTime;
|
uniform float frameTime;
|
||||||
uniform float eyeAltitude;
|
uniform float eyeAltitude;
|
||||||
uniform int frameCounter;
|
uniform int frameCounter;
|
||||||
uniform int worldTime;
|
// uniform int worldTime;
|
||||||
vec3 sunVec = normalize(mat3(gbufferModelViewInverse) *sunPosition);
|
vec3 sunVec = normalize(mat3(gbufferModelViewInverse) *sunPosition);
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef TIMEOFDAYFOG
|
#ifdef TIMEOFDAYFOG
|
||||||
uniform int worldTime;
|
// uniform int worldTime;
|
||||||
void TimeOfDayFog(inout float Uniform, inout float Cloudy) {
|
void TimeOfDayFog(inout float Uniform, inout float Cloudy) {
|
||||||
|
|
||||||
float Time = (worldTime%24000)*1.0;
|
float Time = (worldTime%24000)*1.0;
|
||||||
|
@ -82,10 +82,21 @@ vec3 LightSourcePosition(vec3 WorldPos, vec3 CameraPos){
|
|||||||
Origin.y -= 200;
|
Origin.y -= 200;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Origin = WorldPos - CameraPos - ManualLightPos;
|
Origin = WorldPos - CameraPos ;
|
||||||
float nosie = (densityAtPosFog(Origin / 30 + sin(frameTimeCounter/5)*100)-0.15) * 15 ;
|
|
||||||
Origin.xz += vec2( sin(nosie),-cos(nosie) )*50;
|
#ifdef THE_ORB
|
||||||
Origin.y -= sin(nosie)*100;
|
if(ManualLightPos == 0.0){
|
||||||
|
#endif
|
||||||
|
|
||||||
|
float nosie = (densityAtPosFog(Origin / 30 + sin(frameTimeCounter/5)*100)-0.15) * 15 ;
|
||||||
|
Origin.xz += vec2( sin(nosie),-cos(nosie) )*50;
|
||||||
|
Origin.y -= sin(nosie)*100;
|
||||||
|
|
||||||
|
#ifdef THE_ORB
|
||||||
|
} else {
|
||||||
|
Origin -= ManualLightPos;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
float cellSize = 100.0;
|
float cellSize = 100.0;
|
||||||
vec3 cellPos = CameraPos - vec3(0,10,0) ;
|
vec3 cellPos = CameraPos - vec3(0,10,0) ;
|
||||||
@ -102,26 +113,29 @@ vec3 LightSourcePosition(vec3 WorldPos, vec3 CameraPos){
|
|||||||
///////////////// COLOR
|
///////////////// COLOR
|
||||||
vec3 LightSourceColor(float SwirlBounds){
|
vec3 LightSourceColor(float SwirlBounds){
|
||||||
|
|
||||||
vec3 Color = vec3(0.0);
|
vec3 Color = vec3(0.5, 0.5, 1.0);
|
||||||
|
|
||||||
if( SwirlBounds < 1.0) {
|
#ifndef THE_ORB
|
||||||
|
if( SwirlBounds < 1.0) {
|
||||||
|
// Color = vec3(0.5, 0.5, 1.0);
|
||||||
|
} else {
|
||||||
|
|
||||||
Color = vec3(0.5, 0.5, 1.0);
|
// #ifdef THE_ORB
|
||||||
|
// Color = vec3(ORB_R, ORB_G, ORB_B) * ORB_ColMult;
|
||||||
|
// #endif
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
|
// Color *= blackbody2(RandomPosition.y*4000 + 1000);
|
||||||
|
|
||||||
|
float Timing = dot(RandomPosition, vec3(1.0/3.0));
|
||||||
|
float Flash = max(sin(frameTimeCounter) * cos(Timing) ,0.0);
|
||||||
|
Color *= Flash;
|
||||||
|
}
|
||||||
|
#else
|
||||||
Color = vec3(ORB_R, ORB_G, ORB_B) * ORB_ColMult;
|
Color = vec3(ORB_R, ORB_G, ORB_B) * ORB_ColMult;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Color *= blackbody2(RandomPosition.y*4000 + 1000);
|
|
||||||
|
|
||||||
float Timing = dot(RandomPosition, vec3(1.0/3.0));
|
|
||||||
float Flash = max(sin(frameTimeCounter) * cos(Timing) ,0.0);
|
|
||||||
Color *= Flash;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return Color;
|
return Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,31 +151,30 @@ vec3 LightSourceShape(vec3 WorldPos){
|
|||||||
float SwirlBounds = clamp(sqrt(length(Origin) / 200.0 - 1.0) ,0.0,1.0);
|
float SwirlBounds = clamp(sqrt(length(Origin) / 200.0 - 1.0) ,0.0,1.0);
|
||||||
|
|
||||||
if( SwirlBounds < 1.0) {
|
if( SwirlBounds < 1.0) {
|
||||||
|
|
||||||
// vec3 Origin = WorldPos;
|
// vec3 Origin = WorldPos;
|
||||||
Origin.y -= 200;
|
Origin.y -= 200;
|
||||||
|
|
||||||
vec3 Origin2 = Origin;
|
vec3 Origin2 = Origin;
|
||||||
Origin2.y += 100 ;
|
Origin2.y = (Origin2.y + 100.0) * 0.8;
|
||||||
Origin2.y *= 0.8;
|
|
||||||
|
|
||||||
float Center = length(Origin);
|
float Center = length(Origin);
|
||||||
float AltCenter = length(Origin2);
|
float AltCenter = length(Origin2);
|
||||||
|
|
||||||
//////// STAGE 1
|
|
||||||
// when the ender dragon is alive, restrict the fog in this shape
|
|
||||||
// the max of a sphere is another smaller sphere. this creates a hollow sphere.
|
// the max of a sphere is another smaller sphere. this creates a hollow sphere.
|
||||||
Shapes.r = max(1.0 - AltCenter / 75.0, max(AltCenter / 150.0 - 1.0, 0.0));
|
Shapes.r = max(1.0 - AltCenter / 75.0, max(AltCenter / 150.0 - 1.0, 0.0));
|
||||||
|
|
||||||
|
// donut to make the hurricane shape
|
||||||
float radius = 200.0;
|
float radius = 200.0;
|
||||||
float thickness = 50.0 * radius;
|
float thickness = 25.0 * radius;
|
||||||
Shapes.r = (thickness - clamp(pow(sqrt(pow(Origin2.x,2) + pow(Origin2.z,2)) - radius,2) + pow(Origin2.y*0.75,2.0) - radius,0,thickness)) / thickness ;
|
Shapes.r = (thickness - clamp( pow( length( vec2(length(Origin2.xz) - radius, Origin2.y*0.75) ),2.0) - radius, 0.0, thickness) ) / thickness;
|
||||||
|
|
||||||
Shapes.r = max(Shapes.r, max(1.0 - AltCenter / 75.0, 0.0));
|
Shapes.r = max(Shapes.r, max(1.0 - AltCenter / 75.0, 0.0));
|
||||||
|
|
||||||
radius = 50.0;
|
|
||||||
thickness = 5.0 * radius;
|
// debug donut
|
||||||
Shapes.b = (thickness - clamp(pow(sqrt(pow(Origin2.x,2) + pow(Origin2.y,2)) - radius,2) + pow(Origin2.z*0.75,2.0) - radius,0,thickness)) / thickness ;
|
// radius = 50.0;
|
||||||
|
// thickness = 5.0 * radius;
|
||||||
|
// Shapes.b = (thickness - clamp( pow( length( vec2(length(Origin2.xy) - radius, Origin2.z*0.75) ),2.0) - radius, 0.0, thickness) ) / thickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Shapes;
|
return Shapes;
|
||||||
@ -180,25 +193,20 @@ float cloudVol(in vec3 pos, int LOD){
|
|||||||
vec3 samplePos2 = pos*vec3(1.0,1./48.,1.0);
|
vec3 samplePos2 = pos*vec3(1.0,1./48.,1.0);
|
||||||
|
|
||||||
// #ifndef THE_ORB
|
// #ifndef THE_ORB
|
||||||
// ender dragon battle area swirling effect.
|
float radiance = 2.39996 + samplePos.y + frameTimeCounter/10;
|
||||||
// if(EndSequence2 < 1.0){
|
mat2 rotationMatrix = mat2(vec2(cos(radiance), -sin(radiance)), vec2(sin(radiance), cos(radiance)));
|
||||||
float radiance = 2.39996 + samplePos.y + frameTimeCounter/10;
|
|
||||||
mat2 rotationMatrix = mat2(vec2(cos(radiance), -sin(radiance)), vec2(sin(radiance), cos(radiance)));
|
|
||||||
|
|
||||||
// make the swirl only happen within a radius
|
// make the swirl only happen within a radius
|
||||||
float SwirlBounds = clamp(sqrt(length(vec3(pos.x,pos.y-100,pos.z)) / 200.0 - 1.0) ,0.0,1.0);
|
float SwirlBounds = clamp(sqrt(length(vec3(pos.x,pos.y-100,pos.z)) / 200.0 - 1.0) ,0.0,1.0);
|
||||||
|
|
||||||
samplePos.xz = mix(samplePos.xz * rotationMatrix, samplePos.xz, SwirlBounds);
|
samplePos.xz = mix(samplePos.xz * rotationMatrix, samplePos.xz, SwirlBounds);
|
||||||
samplePos2.xz = mix(samplePos2.xz * rotationMatrix, samplePos2.xz, SwirlBounds);
|
samplePos2.xz = mix(samplePos2.xz * rotationMatrix, samplePos2.xz, SwirlBounds);
|
||||||
// }
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
samplePos2.y -= frameTimeCounter/15;
|
samplePos2.y -= frameTimeCounter/15;
|
||||||
|
|
||||||
float finalfog = 0;
|
float finalfog = 0.0;
|
||||||
|
|
||||||
finalfog += max(0.6-densityAtPosFog(samplePos * 16.0) * 2,0.0);
|
finalfog += max(0.6-densityAtPosFog(samplePos * 16.0) * 2,0.0);
|
||||||
// finalfog = exp(finalfog*5)-1;
|
|
||||||
|
|
||||||
float smallnoise = max(densityAtPosFog(samplePos2 * (160. - finalfog*3))-0.1,0.0);
|
float smallnoise = max(densityAtPosFog(samplePos2 * (160. - finalfog*3))-0.1,0.0);
|
||||||
finalfog -= ((1-smallnoise) - max(0.15 - abs(smallnoise * 2.0 - 0.55) * 0.5,0.0)*1.5) * 0.3;
|
finalfog -= ((1-smallnoise) - max(0.15 - abs(smallnoise * 2.0 - 0.55) * 0.5,0.0)*1.5) * 0.3;
|
||||||
@ -206,7 +214,6 @@ float cloudVol(in vec3 pos, int LOD){
|
|||||||
// make the eye of the swirl have no fog, so you can actually see.
|
// make the eye of the swirl have no fog, so you can actually see.
|
||||||
finalfog = max(finalfog - Shapes.r, 0.0);
|
finalfog = max(finalfog - Shapes.r, 0.0);
|
||||||
|
|
||||||
// dragon death sequence
|
|
||||||
// finalfog = Shapes.b;
|
// finalfog = Shapes.b;
|
||||||
|
|
||||||
|
|
||||||
@ -261,7 +268,6 @@ mat2x3 getVolumetricRays(float dither,vec3 fragpos,float dither2) {
|
|||||||
|
|
||||||
vec3 LightPos = LightSourcePosition(progressW, cameraPosition);
|
vec3 LightPos = LightSourcePosition(progressW, cameraPosition);
|
||||||
// float OrbMie = exp(length(LightPos) * -0.03) * 64.0;
|
// float OrbMie = exp(length(LightPos) * -0.03) * 64.0;
|
||||||
|
|
||||||
// float OrbMie = max(exp2(4.0 + length(LightPos) / -20),0.0);
|
// float OrbMie = max(exp2(4.0 + length(LightPos) / -20),0.0);
|
||||||
|
|
||||||
|
|
||||||
@ -284,9 +290,9 @@ mat2x3 getVolumetricRays(float dither,vec3 fragpos,float dither2) {
|
|||||||
vec3 CastedLight = LightColor * OrbMie * exp(CastLight * 15 * (LightColor*(1.0-CastLight/3)-1.50)) ;
|
vec3 CastedLight = LightColor * OrbMie * exp(CastLight * 15 * (LightColor*(1.0-CastLight/3)-1.50)) ;
|
||||||
CastedLight += (LightColor * vec3(1.0,1.3,1.0)) * exp(abs(densityVol*2.0 - 0.3) * 15 * (LightColor*CastLight)) * (max(OrbMie - density*10,0.0)/10);
|
CastedLight += (LightColor * vec3(1.0,1.3,1.0)) * exp(abs(densityVol*2.0 - 0.3) * 15 * (LightColor*CastLight)) * (max(OrbMie - density*10,0.0)/10);
|
||||||
|
|
||||||
// #ifdef THE_ORB
|
#ifdef THE_ORB
|
||||||
// density += clamp((1.0 - length(LightPos) / 10.0) * 10 ,0.0,1.0) ;
|
density += clamp((1.0 - length(LightPos) / 10.0) * 10 ,0.0,1.0) ;
|
||||||
// #endif
|
#endif
|
||||||
|
|
||||||
vec3 AmbientLight = fogColor * 0.05 * pow(exp(density * -2),20);
|
vec3 AmbientLight = fogColor * 0.05 * pow(exp(density * -2),20);
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ uniform sampler2D colortex4;//Skybox
|
|||||||
|
|
||||||
#define WEATHERCLOUDS
|
#define WEATHERCLOUDS
|
||||||
|
|
||||||
|
uniform int worldTime;
|
||||||
#include "/lib/climate_settings.glsl"
|
#include "/lib/climate_settings.glsl"
|
||||||
|
|
||||||
// #ifdef Daily_Weather
|
// #ifdef Daily_Weather
|
||||||
@ -32,7 +33,8 @@ float AltostratusHeight = 2000;
|
|||||||
|
|
||||||
|
|
||||||
float rainCloudwetness = rainStrength;
|
float rainCloudwetness = rainStrength;
|
||||||
float cloud_movement = frameTimeCounter * Cloud_Speed;
|
// float cloud_movement = frameTimeCounter * Cloud_Speed ;
|
||||||
|
float cloud_movement = (worldTime / 24.0) * Cloud_Speed ;
|
||||||
|
|
||||||
//3D noise from 2d texture
|
//3D noise from 2d texture
|
||||||
float densityAtPos(in vec3 pos){
|
float densityAtPos(in vec3 pos){
|
||||||
|
@ -22,22 +22,22 @@ blend.gbuffers_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
|||||||
|
|
||||||
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
|
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
|
||||||
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
# SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
||||||
blend.gbuffers_hand_water=SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
|
blend.gbuffers_hand_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
|
||||||
|
blend.gbuffers_damagedblock = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
||||||
|
|
||||||
blend.gbuffers_entities = off
|
blend.gbuffers_entities = off
|
||||||
blend.gbuffers_hand = off
|
blend.gbuffers_hand = off
|
||||||
blend.gbuffers_block= off
|
blend.gbuffers_block= off
|
||||||
blend.gbuffers_basic= off
|
blend.gbuffers_basic= off
|
||||||
blend.gbuffers_damagedblock= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
|
|
||||||
blend.gbuffers_skytextured=off
|
blend.gbuffers_skytextured=off
|
||||||
|
|
||||||
blend.gbuffers_water.colortex11 = off
|
blend.gbuffers_water.colortex11 = off
|
||||||
|
|
||||||
alphaTest.gbuffers_armor_glint=false
|
|
||||||
|
|
||||||
alphaTest.gbuffers_entities=GREATER 0.1
|
alphaTest.gbuffers_entities=GREATER 0.1
|
||||||
|
|
||||||
|
alphaTest.gbuffers_water=flase
|
||||||
|
alphaTest.gbuffers_armor_glint=false
|
||||||
alphaTest.gbuffers_weather=false
|
alphaTest.gbuffers_weather=false
|
||||||
alphaTest.gbuffers_water=false
|
|
||||||
alphaTest.gbuffers_skybasic=false
|
alphaTest.gbuffers_skybasic=false
|
||||||
alphaTest.gbuffers_skytextured=false
|
alphaTest.gbuffers_skytextured=false
|
||||||
alphaTest.gbuffers_hand=true
|
alphaTest.gbuffers_hand=true
|
||||||
@ -129,12 +129,12 @@ screen = [Direct_Light] [World] [Ambient_light] [Fog] [Post_Processing] [Clouds]
|
|||||||
screen.Sky = [Sky_coefficients] [Sun_and_Moon_Colors] sunPathRotation
|
screen.Sky = [Sky_coefficients] [Sun_and_Moon_Colors] sunPathRotation
|
||||||
|
|
||||||
screen.Sky_coefficients.columns=1
|
screen.Sky_coefficients.columns=1
|
||||||
screen.Sky_coefficients = Sky_Brightness sky_mieg sky_coefficientRayleighR sky_coefficientRayleighG sky_coefficientRayleighB sky_coefficientMieR sky_coefficientMieG sky_coefficientMieB
|
screen.Sky_coefficients = Sky_Brightness sky_mieg sky_coefficientRayleighR sky_coefficientRayleighG sky_coefficientRayleighB sky_coefficientMieR sky_coefficientMieG sky_coefficientMieB
|
||||||
|
|
||||||
### CLOUDS
|
### CLOUDS
|
||||||
screen.Clouds.columns=2
|
screen.Clouds.columns=2
|
||||||
# screen.Clouds = VOLUMETRIC_CLOUDS Altostratus cloud_LevelOfDetail cloud_ShadowLevelOfDetail CLOUDS_QUALITY cloudDensity cloudCoverage Rain_coverage fbmAmount fbmPower1 fbmPower2 Cloud_top_cutoff Cloud_base_cutoff Shadow_brightness self_shadow_samples CLOUDS_SHADOWS VL_CLOUDS_SHADOWS
|
# screen.Clouds = VOLUMETRIC_CLOUDS Altostratus cloud_LevelOfDetail cloud_ShadowLevelOfDetail CLOUDS_QUALITY cloudDensity cloudCoverage Rain_coverage fbmAmount fbmPower1 fbmPower2 Cloud_top_cutoff Cloud_base_cutoff Shadow_brightness self_shadow_samples CLOUDS_SHADOWS VL_CLOUDS_SHADOWS
|
||||||
screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_QUALITY Cumulus Altostratus Cumulus_coverage Alto_coverage Cumulus_density Alto_density Cumulus_height CLOUDS_SHADOWS Cloud_Speed Rain_coverage Cloud_Fog
|
screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_QUALITY Cumulus Altostratus Cumulus_coverage Alto_coverage Cumulus_density Alto_density Cumulus_height CLOUDS_SHADOWS Cloud_Speed Rain_coverage Cloud_Fog Daily_Weather
|
||||||
|
|
||||||
### FOG
|
### FOG
|
||||||
screen.Fog.columns=1
|
screen.Fog.columns=1
|
||||||
@ -201,7 +201,7 @@ screen = [Direct_Light] [World] [Ambient_light] [Fog] [Post_Processing] [Clouds]
|
|||||||
######## moonphase based weather
|
######## moonphase based weather
|
||||||
|
|
||||||
# in seconds...
|
# in seconds...
|
||||||
variable.int.TransitionTime = 5
|
variable.int.TransitionTime = 30
|
||||||
|
|
||||||
uniform.float.Cumulus_Cov = smooth(1, if( \
|
uniform.float.Cumulus_Cov = smooth(1, if( \
|
||||||
moonPhase == 0, 0.7, \
|
moonPhase == 0, 0.7, \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user