mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2024-12-22 17:47:34 +08:00
Latest Dev
its very scary to look at
This commit is contained in:
parent
0b86387cac
commit
216db6b84d
@ -64,5 +64,4 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
layer.translucent=minecraft:glass_pane minecraft:glass
|
layer.translucent=minecraft:glass_pane minecraft:glass
|
||||||
|
|
||||||
# layer.solid = minecraft:tripwire minecraft:slime_block minecraft:nether_portal minecraft:honey_block minecraft:ice minecraft:black_stained_glass minecraft:black_stained_glass_pane minecraft:blue_stained_glass minecraft:blue_stained_glass_pane minecraft:brown_stained_glass minecraft:brown_stained_glass_pane minecraft:cyan_stained_glass minecraft:cyan_stained_glass_pane minecraft:gray_stained_glass minecraft:gray_stained_glass_pane minecraft:green_stained_glass minecraft:green_stained_glass_pane minecraft:light_blue_stained_glass minecraft:light_blue_stained_glass_pane minecraft:light_gray_stained_glass minecraft:light_gray_stained_glass_pane minecraft:lime_stained_glass minecraft:lime_stained_glass_pane minecraft:magenta_stained_glass minecraft:magenta_stained_glass_pane minecraft:orange_stained_glass minecraft:orange_stained_glass_pane minecraft:pink_stained_glass minecraft:pink_stained_glass_pane minecraft:purple_stained_glass minecraft:purple_stained_glass_pane minecraft:red_stained_glass minecraft:red_stained_glass_pane minecraft:white_stained_glass minecraft:white_stained_glass_pane minecraft:yellow_stained_glass minecraft:yellow_stained_glass_pane minecraft:glass_pane minecraft:glass
|
# layer.solid = minecraft:tripwire minecraft:slime_block minecraft:nether_portal minecraft:honey_block minecraft:ice minecraft:black_stained_glass minecraft:black_stained_glass_pane minecraft:blue_stained_glass minecraft:blue_stained_glass_pane minecraft:brown_stained_glass minecraft:brown_stained_glass_pane minecraft:cyan_stained_glass minecraft:cyan_stained_glass_pane minecraft:gray_stained_glass minecraft:gray_stained_glass_pane minecraft:green_stained_glass minecraft:green_stained_glass_pane minecraft:light_blue_stained_glass minecraft:light_blue_stained_glass_pane minecraft:light_gray_stained_glass minecraft:light_gray_stained_glass_pane minecraft:lime_stained_glass minecraft:lime_stained_glass_pane minecraft:magenta_stained_glass minecraft:magenta_stained_glass_pane minecraft:orange_stained_glass minecraft:orange_stained_glass_pane minecraft:pink_stained_glass minecraft:pink_stained_glass_pane minecraft:purple_stained_glass minecraft:purple_stained_glass_pane minecraft:red_stained_glass minecraft:red_stained_glass_pane minecraft:white_stained_glass minecraft:white_stained_glass_pane minecraft:yellow_stained_glass minecraft:yellow_stained_glass_pane minecraft:glass_pane minecraft:glass
|
@ -1,13 +1,14 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
#define TAA
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
|
|
||||||
// #define LabPBR_subsurface_scattering
|
|
||||||
flat varying vec3 WsunVec;
|
flat varying vec3 WsunVec;
|
||||||
flat varying vec2 TAA_Offset;
|
flat varying vec2 TAA_Offset;
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
#include "lib/Shadow_Params.glsl"
|
#include "lib/Shadow_Params.glsl"
|
||||||
|
|
||||||
uniform sampler2D depthtex1;
|
uniform sampler2D depthtex1;
|
||||||
uniform sampler2D colortex1;
|
uniform sampler2D colortex1;
|
||||||
uniform sampler2D colortex6; // Noise
|
uniform sampler2D colortex6; // Noise
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define TAA
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
flat varying vec2 TAA_Offset;
|
flat varying vec2 TAA_Offset;
|
||||||
flat varying vec3 WsunVec;
|
flat varying vec3 WsunVec;
|
||||||
|
|
||||||
@ -12,6 +14,7 @@ uniform vec3 sunPosition;
|
|||||||
uniform mat4 gbufferModelViewInverse;
|
uniform mat4 gbufferModelViewInverse;
|
||||||
#include "/lib/util.glsl"
|
#include "/lib/util.glsl"
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
||||||
vec2(-1.,3.)/8.,
|
vec2(-1.,3.)/8.,
|
||||||
vec2(5.0,1.)/8.,
|
vec2(5.0,1.)/8.,
|
||||||
@ -23,7 +26,7 @@ const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|||||||
void main() {
|
void main() {
|
||||||
TAA_Offset = offsets[frameCounter%8];
|
TAA_Offset = offsets[frameCounter%8];
|
||||||
#ifndef TAA
|
#ifndef TAA
|
||||||
TAA_Offset = vec2(0.0);
|
TAA_Offset = vec2(0.0);
|
||||||
#endif
|
#endif
|
||||||
gl_Position = ftransform();
|
gl_Position = ftransform();
|
||||||
#ifdef TAA_UPSCALING
|
#ifdef TAA_UPSCALING
|
||||||
@ -31,5 +34,4 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
#include "lib/settings.glsl"
|
||||||
//downsample 1st pass (half res) for bloom
|
//downsample 1st pass (half res) for bloom
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
uniform sampler2D colortex3;
|
uniform sampler2D colortex3;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
uniform float viewWidth;
|
uniform float viewWidth;
|
||||||
uniform float viewHeight;
|
uniform float viewHeight;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
#include "lib/settings.glsl"
|
||||||
//6 Horizontal gaussian blurs and horizontal downsampling
|
//6 Horizontal gaussian blurs and horizontal downsampling
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
uniform float viewWidth;
|
uniform float viewWidth;
|
||||||
uniform float viewHeight;
|
uniform float viewHeight;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
#include "lib/settings.glsl"
|
||||||
//6 Vertical gaussian blurs and vertical downsampling
|
//6 Vertical gaussian blurs and vertical downsampling
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
uniform float viewWidth;
|
uniform float viewWidth;
|
||||||
uniform float viewHeight;
|
uniform float viewHeight;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
//Merge and upsample the blurs into a 1/4 res bloom buffer
|
//Merge and upsample the blurs into a 1/4 res bloom buffer
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
uniform sampler2D colortex3;
|
uniform sampler2D colortex3;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
uniform float viewWidth;
|
uniform float viewWidth;
|
||||||
uniform float viewHeight;
|
uniform float viewHeight;
|
||||||
|
@ -1,29 +1,8 @@
|
|||||||
#version 120
|
#version 120
|
||||||
//Vignetting, applies bloom, applies exposure and tonemaps the final image
|
//Vignetting, applies bloom, applies exposure and tonemaps the final image
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define Fake_purkinje
|
|
||||||
#define BLOOMY_FOG 2.0 //[0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 6.0 10.0 15.0 20.0]
|
|
||||||
#define BLOOM_STRENGTH 4.0 //[0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0]
|
|
||||||
#define TONEMAP ToneMap_Hejl2015 // Tonemapping operator [Tonemap_Uchimura HableTonemap reinhard Tonemap_Lottes ACESFilm]
|
|
||||||
//#define USE_ACES_COLORSPACE_APPROXIMATION // Do the tonemap in another colorspace
|
|
||||||
|
|
||||||
#define Purkinje_strength 1.0 // Simulates how the eye is unable to see colors at low light intensities. 0 = No purkinje effect at low exposures [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#include "lib/settings.glsl"
|
||||||
#define Purkinje_R 0.4 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define Purkinje_G 0.7 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define Purkinje_B 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define Purkinje_Multiplier 5.0 // How much the purkinje effect increases brightness [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
|
||||||
|
|
||||||
|
|
||||||
//#define DOF //enable depth of field (blur on non-focused objects)
|
|
||||||
//#define HQ_DOF //Slow! Forces circular bokeh! Uses 4 times more samples with noise in order to remove sampling artifacts at great blur sizes.
|
|
||||||
//#define HEXAGONAL_BOKEH //disabled : circular blur shape - enabled : hexagonal blur shape
|
|
||||||
#define AUTOFOCUS // THE BRIGHTNESS SLIDER CAN CONTROL THE MANUAL FOCUS DISTANCE
|
|
||||||
//#define FAR_BLUR_ONLY // Removes DoF on objects closer to the camera than the focus point
|
|
||||||
|
|
||||||
//lens properties
|
|
||||||
#define focal 2.4 // Centimeters [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
|
||||||
#define aperture 0.8 // Centimeters [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
|
||||||
#define MANUAL_FOCUS 48.0 // If autofocus is turned off, sets the focus point (meters) [0.06948345122280154 0.07243975703425146 0.07552184450877376 0.07873506526686186 0.0820849986238988 0.08557746127787037 0.08921851740926011 0.09301448921066349 0.09697196786440505 0.10109782498721881 0.10539922456186433 0.10988363537639657 0.11455884399268773 0.11943296826671962 0.12451447144412296 0.129812176855438 0.1353352832366127 0.1410933807013415 0.1470964673929768 0.15335496684492847 0.1598797460796939 0.16668213447794653 0.17377394345044514 0.18116748694692214 0.18887560283756183 0.19691167520419406 0.20528965757990927 0.21402409717744744 0.22313016014842982 0.2326236579172927 0.2425210746356487 0.25283959580474646 0.26359713811572677 0.27481238055948964 0.2865047968601901 0.29869468928867837 0.3114032239145977 0.32465246735834974 0.3384654251067422 0.3528660814588489 0.36787944117144233 0.3835315728763107 0.39984965434484737 0.4168620196785084 0.4345982085070782 0.453089017280169 0.4723665527410147 0.49246428767540973 0.513417119032592 0.5352614285189903 0.5580351457700471 0.5817778142098083 0.6065306597126334 0.6323366621862497 0.6592406302004438 0.6872892787909722 0.7165313105737893 0.7470175003104326 0.7788007830714049 0.8119363461506349 0.8464817248906141 0.8824969025845955 0.9200444146293233 0.9591894571091382 1.0 1.0425469051899914 1.086904049521229 1.1331484530668263 1.1813604128656459 1.2316236423470497 1.2840254166877414 1.338656724353094 1.3956124250860895 1.4549914146182013 1.5168967963882134 1.5814360605671443 1.6487212707001282 1.7188692582893286 1.7920018256557555 1.8682459574322223 1.9477340410546757 2.030604096634748 2.117000016612675 2.2070718156067044 2.300975890892825 2.398875293967098 2.5009400136621287 2.6073472713092674 2.718281828459045 2.833936307694169 2.9545115270921065 3.080216848918031 3.211270543153561 3.347900166492527 3.4903429574618414 3.638846248353525 3.7936678946831774 3.955076722920577 4.123352997269821 4.298788906309526 4.4816890703380645 4.672371070304759 4.871165999245474 5.0784190371800815 5.29449005047003 5.51975421667673 5.754602676005731 5.999443210467818 6.254700951936329 6.5208191203301125 6.798259793203881 7.087504708082256 7.38905609893065 7.703437568215379 8.031194996067258 8.372897488127265 8.72913836372013 9.10053618607165 9.487735836358526 9.891409633455755 10.312258501325767 10.751013186076355 11.208435524800691 11.685319768402522 12.182493960703473 12.700821376227164 13.241202019156521 13.804574186067095 14.391916095149892 15.00424758475255 15.642631884188171 16.30817745988666 17.00203994009402 17.725424121461643 18.479586061009854 19.265835257097933 20.085536923187668 20.940114358348602 21.831051418620845 22.75989509352673 23.728258192205157 24.737822143832553 25.790339917193062 26.88763906446752 28.03162489452614 29.22428378123494 30.46768661252054 31.763992386181833 33.11545195869231 34.52441195350251 35.99331883562839 37.524723159600995 39.12128399815321 40.78577355933337 42.52108200006278 44.3302224444953 46.21633621589248 48.182698291098816 50.23272298708815 52.36996988945491 54.598150033144236 56.92113234615337 59.34295036739207 61.867809250367884 64.50009306485578 67.24437240923179 70.10541234668786 73.08818067910767 76.19785657297057 79.43983955226133 82.81975887399955 86.3434833026695 90.01713130052181 93.84708165144015 97.83998453682129 102.00277308269969 106.34267539816554 110.86722712598126 115.58428452718766 120.50203812241894 125.62902691361414 130.9741532108186 136.54669808981876 142.35633750745257 148.4131591025766 154.72767971186107 161.3108636308289 168.17414165184545 175.32943091211476 182.78915558614753 190.56626845863 198.67427341514983 ]
|
|
||||||
|
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
#define FinalR 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
|
||||||
#define FinalG 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
|
||||||
#define FinalB 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
|
||||||
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
flat varying vec4 exposure;
|
flat varying vec4 exposure;
|
||||||
|
@ -2,58 +2,11 @@
|
|||||||
//Render sky, volumetric clouds, direct lighting
|
//Render sky, volumetric clouds, direct lighting
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
#define Moon_temp 15000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000]
|
#include "lib/settings.glsl"
|
||||||
#define CAVE_LIGHT_LEAK_FIX // Hackish way to remove sunlight incorrectly leaking into the caves. Can inacurrately create shadows in some places
|
|
||||||
#define CLOUDS_SHADOWS
|
|
||||||
#define CLOUDS_QUALITY 0.5 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
|
||||||
#define TORCH_R 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define TORCH_G 0.75 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
#define ambient_colortype 0 // Toggle which method you want to change the color of ambient light with. [0 1]
|
|
||||||
#define ambient_temp 9000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 15000 50000]
|
|
||||||
#define ambient_brightness 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
|
||||||
#define AmbientLight_R 0.91 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define AmbientLight_G 0.86 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define AmbientLight_B 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
|
|
||||||
#define Sub_surface_scattering // (place the flashlight on your hand example here)
|
|
||||||
// #define LabPBR_subsurface_scattering
|
|
||||||
#define LabSSS_Curve 1.0 // i just really like how it looks at 2.0, so i made it an option. [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
|
||||||
#define Strong_SSS_strength 45 // [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2 3 4 5 6 7 8 9 10 15 20 30 35 40 45 50]
|
|
||||||
#define Medium_SSS_strength 30 // [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2 3 4 5 6 7 8 9 10 15 20 30 35 40 45 50]
|
|
||||||
|
|
||||||
#define indirect_effect 1 // Choose what effect is applied to indirect light. [0 1 2 3]
|
|
||||||
#define AO_Strength 0.8 // strength of shadowed areas [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
|
||||||
#define GI_Strength 5.0 // strength of bounced light areas [ 1 2 3 4 5 6 7 8 9 10]
|
|
||||||
// #define HQ_SSGI
|
|
||||||
|
|
||||||
|
|
||||||
// #define LabPBR_Emissives
|
|
||||||
#define Emissive_Brightness 10.0 // [1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 15. 20. 25. 30. 35. 40. 45. 50. 100.]
|
|
||||||
#define Emissive_Curve 2.0 // yes i blatantly copied kappa here. [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 2.6 2.7 2.8 2.9 3.0 ]
|
|
||||||
|
|
||||||
#define Puddle_Size 1.0 // [0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5]
|
|
||||||
#ifdef Specular_Reflections
|
|
||||||
#define Puddles // yes
|
|
||||||
#else
|
|
||||||
// #define Puddles // yes
|
|
||||||
#endif
|
|
||||||
// #define Porosity
|
|
||||||
|
|
||||||
|
|
||||||
// #define Allow_Vanilla_sky // allow the vanilla sky to appear. may appear broken with some resourcepacks.
|
|
||||||
|
|
||||||
// #define WhiteWorld // THIS IS A DEBUG VIEW. uses to see AO easier. used to see fake GI better (green light)
|
|
||||||
// #define ambientLight_only // THIS IS A DEBUG VIEW. turn the sunlight off. DOES NOT increase performance, the shadows are still working in the background
|
|
||||||
#define MIN_LIGHT_AMOUNT 1.0 //[0.0 0.5 1.0 1.5 2.0 3.0 4.0 5.0]
|
|
||||||
|
|
||||||
|
|
||||||
// #define Glass_Tint // multiply the background through glass by the color of the glass for a strong tint.
|
|
||||||
|
|
||||||
// #define Horrible_slope_normals // awful
|
|
||||||
|
|
||||||
|
const bool colortex5MipmapEnabled = true;
|
||||||
|
// const bool colortex4MipmapEnabled = true;
|
||||||
|
\
|
||||||
const bool shadowHardwareFiltering = true;
|
const bool shadowHardwareFiltering = true;
|
||||||
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
|
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
|
||||||
flat varying vec3 ambientUp;
|
flat varying vec3 ambientUp;
|
||||||
@ -178,10 +131,19 @@ vec3 blackbody2(float Temp)
|
|||||||
return srgbToLinear2(col);
|
return srgbToLinear2(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec3 normVec (vec3 vec){
|
||||||
|
return vec*inversesqrt(dot(vec,vec));
|
||||||
|
}
|
||||||
|
vec3 viewToWorld(vec3 viewPosition) {
|
||||||
|
vec4 pos;
|
||||||
|
pos.xyz = viewPosition;
|
||||||
|
pos.w = 0.0;
|
||||||
|
pos = gbufferModelViewInverse * pos;
|
||||||
|
return pos.xyz;
|
||||||
|
}
|
||||||
// #include "lib/settings.glsl"
|
// #include "lib/settings.glsl"
|
||||||
// #include "lib/biome_specifics.glsl"
|
// #include "lib/biome_specifics.glsl"
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
#include "lib/waterOptions.glsl"
|
|
||||||
#include "lib/Shadow_Params.glsl"
|
#include "lib/Shadow_Params.glsl"
|
||||||
#include "lib/color_transforms.glsl"
|
#include "lib/color_transforms.glsl"
|
||||||
#include "lib/sky_gradient.glsl"
|
#include "lib/sky_gradient.glsl"
|
||||||
@ -192,9 +154,6 @@ vec3 blackbody2(float Temp)
|
|||||||
// #include "/lib/climate_settings.glsl"
|
// #include "/lib/climate_settings.glsl"
|
||||||
|
|
||||||
|
|
||||||
vec3 normVec (vec3 vec){
|
|
||||||
return vec*inversesqrt(dot(vec,vec));
|
|
||||||
}
|
|
||||||
float lengthVec (vec3 vec){
|
float lengthVec (vec3 vec){
|
||||||
return sqrt(dot(vec,vec));
|
return sqrt(dot(vec,vec));
|
||||||
}
|
}
|
||||||
@ -279,13 +238,7 @@ vec2 tapLocation(int sampleNumber, float spinAngle,int nb, float nbRot,float r0)
|
|||||||
return vec2(cos_v, sin_v)*ssR;
|
return vec2(cos_v, sin_v)*ssR;
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 viewToWorld(vec3 viewPosition) {
|
|
||||||
vec4 pos;
|
|
||||||
pos.xyz = viewPosition;
|
|
||||||
pos.w = 0.0;
|
|
||||||
pos = gbufferModelViewInverse * pos;
|
|
||||||
return pos.xyz;
|
|
||||||
}
|
|
||||||
void waterVolumetrics(inout vec3 inColor, vec3 rayStart, vec3 rayEnd, float estEndDepth, float estSunDepth, float rayLength, float dither, vec3 waterCoefs, vec3 scatterCoef, vec3 ambient, vec3 lightSource, float VdotL){
|
void waterVolumetrics(inout vec3 inColor, vec3 rayStart, vec3 rayEnd, float estEndDepth, float estSunDepth, float rayLength, float dither, vec3 waterCoefs, vec3 scatterCoef, vec3 ambient, vec3 lightSource, float VdotL){
|
||||||
inColor *= exp(-rayLength * waterCoefs); //No need to take the integrated value
|
inColor *= exp(-rayLength * waterCoefs); //No need to take the integrated value
|
||||||
int spCount = rayMarchSampleCount;
|
int spCount = rayMarchSampleCount;
|
||||||
@ -433,6 +386,24 @@ vec2 tapLocation_alternate(
|
|||||||
|
|
||||||
return vec2(cos_v, sin_v)*ssR;
|
return vec2(cos_v, sin_v)*ssR;
|
||||||
}
|
}
|
||||||
|
vec2 hash21(float p)
|
||||||
|
{
|
||||||
|
vec3 p3 = fract(vec3(p) * vec3(.1031, .1030, .0973));
|
||||||
|
p3 += dot(p3, p3.yzx + 33.33);
|
||||||
|
return fract((p3.xx+p3.yz)*p3.zy);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
vec2 vogel_disk_7[7] = vec2[](
|
||||||
|
vec2(0.2506005557551467 , -0.08481388042204699) ,
|
||||||
|
vec2(-0.3579961502930998 , 0.22787736539225004) ,
|
||||||
|
vec2(0.035586177529474045, -0.6801399443380787) ,
|
||||||
|
vec2(0.4135705583782951 , 0.4763465923710499) ,
|
||||||
|
vec2(-0.8061879331972175 , -0.2244701335533563) ,
|
||||||
|
vec2(0.7312484456783402 , -0.560572449689252) ,
|
||||||
|
vec2(-0.26682165385093876, 0.8457724502394341)
|
||||||
|
);
|
||||||
|
|
||||||
void ssAO(inout vec3 lighting, vec3 fragpos,float mulfov, vec2 noise, vec3 normal, vec2 texcoord, vec3 ambientCoefs, vec2 lightmap, float sunlight){
|
void ssAO(inout vec3 lighting, vec3 fragpos,float mulfov, vec2 noise, vec3 normal, vec2 texcoord, vec3 ambientCoefs, vec2 lightmap, float sunlight){
|
||||||
|
|
||||||
ivec2 pos = ivec2(gl_FragCoord.xy);
|
ivec2 pos = ivec2(gl_FragCoord.xy);
|
||||||
@ -458,12 +429,14 @@ void ssAO(inout vec3 lighting, vec3 fragpos,float mulfov, vec2 noise, vec3 norma
|
|||||||
for (int j = 0; j < 7 ;j++) {
|
for (int j = 0; j < 7 ;j++) {
|
||||||
|
|
||||||
vec2 sp = tapLocation_alternate(j, 0.0, 7, 20, randomDir);
|
vec2 sp = tapLocation_alternate(j, 0.0, 7, 20, randomDir);
|
||||||
float thing = sp.y < 0.0 && clamp(floor(abs(NormalSpecific.y)*2.0),0.0,1.0) < 1.0 ? rd * 10: rd;
|
// vec2 sp = vogel_disk_7[j];
|
||||||
|
// float thing = sp.y < 0.0 && clamp(floor(abs(NormalSpecific.y)*2.0),0.0,1.0) < 1.0 ? rd * 10: rd;
|
||||||
|
|
||||||
|
|
||||||
vec2 sampleOffset = sp*thing;
|
// vec2 sampleOffset = sp*thing;
|
||||||
vec2 sampleOffset2 = sp*rd ;
|
// vec2 sampleOffset2 = sp*rd ;
|
||||||
sampleOffset = min(sampleOffset, sampleOffset2);
|
// sampleOffset = min(sampleOffset, sampleOffset2);
|
||||||
|
vec2 sampleOffset = sp*rd;
|
||||||
|
|
||||||
ivec2 offset = ivec2(gl_FragCoord.xy + sampleOffset*vec2(viewWidth,viewHeight*aspectRatio)*RENDER_SCALE);
|
ivec2 offset = ivec2(gl_FragCoord.xy + sampleOffset*vec2(viewWidth,viewHeight*aspectRatio)*RENDER_SCALE);
|
||||||
|
|
||||||
@ -485,8 +458,8 @@ void ssAO(inout vec3 lighting, vec3 fragpos,float mulfov, vec2 noise, vec3 norma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
occlusion *= mix(2.5, 2.0 , clamp(floor(abs(NormalSpecific.y)*2.0),0.0,1.0));
|
// occlusion *= mix(2.5, 2.0 , clamp(floor(abs(NormalSpecific.y)*2.0),0.0,1.0));
|
||||||
occlusion = max(1.0 - occlusion/n, 0.0);
|
occlusion = max(1.0 - (occlusion*2.0)/n, 0.0);
|
||||||
// float skylight = clamp(abs(ambientCoefs.y+1),0.5,1.25) * clamp(abs(ambientCoefs.y+0.5),1.0,1.25);
|
// float skylight = clamp(abs(ambientCoefs.y+1),0.5,1.25) * clamp(abs(ambientCoefs.y+0.5),1.0,1.25);
|
||||||
float skylight = clamp(abs(ambientCoefs.y+1),0.5,2.0) ;
|
float skylight = clamp(abs(ambientCoefs.y+1),0.5,2.0) ;
|
||||||
// lighting *= 0.5;
|
// lighting *= 0.5;
|
||||||
@ -494,6 +467,76 @@ void ssAO(inout vec3 lighting, vec3 fragpos,float mulfov, vec2 noise, vec3 norma
|
|||||||
|
|
||||||
lighting = lighting*max(occlusion,pow(lightmap.x,4));
|
lighting = lighting*max(occlusion,pow(lightmap.x,4));
|
||||||
}
|
}
|
||||||
|
vec3 DoContrast(vec3 Color){
|
||||||
|
|
||||||
|
float Contrast = log(50.0);
|
||||||
|
|
||||||
|
return clamp(mix(vec3(0.5), Color, Contrast) ,0,255);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ssDO(inout vec3 lighting, vec3 fragpos,float mulfov, vec2 noise, vec3 normal, vec3 RPnormal, vec2 texcoord, vec3 ambientCoefs, vec2 lightmap, float sunlight){
|
||||||
|
const int Samples = 7;
|
||||||
|
vec3 Radiance = vec3(0);
|
||||||
|
float occlusion = 0.0;
|
||||||
|
|
||||||
|
ivec2 pos = ivec2(gl_FragCoord.xy);
|
||||||
|
const float tan70 = tan(70.*3.14/180.);
|
||||||
|
|
||||||
|
// float dist = 1.0 + clamp(fragpos.z*fragpos.z/50.0,0,2); // shrink sample size as distance increases
|
||||||
|
|
||||||
|
float mulfov2 = gbufferProjection[1][1]/(tan70 );
|
||||||
|
float maxR2 = fragpos.z*fragpos.z*mulfov2*2.*5/50.0;
|
||||||
|
|
||||||
|
|
||||||
|
float rd = mulfov2 * 0.1 ;
|
||||||
|
|
||||||
|
|
||||||
|
vec2 acc = -(TAA_Offset*(texelSize/2))*RENDER_SCALE ;
|
||||||
|
|
||||||
|
vec3 NormalSpecific = viewToWorld(normal);
|
||||||
|
|
||||||
|
|
||||||
|
for (int j = 0; j < Samples ;j++) {
|
||||||
|
|
||||||
|
vec2 sp = tapLocation_alternate(j, 0.0, 7, 20, blueNoise());
|
||||||
|
float thing = sp.y < 0.0 && clamp(floor(abs(NormalSpecific.y)*2.0),0.0,1.0) < 1.0 ? rd * 10: rd;
|
||||||
|
|
||||||
|
|
||||||
|
vec2 sampleOffset = sp*thing;
|
||||||
|
vec2 sampleOffset2 = sp*rd ;
|
||||||
|
sampleOffset = sampleOffset2;
|
||||||
|
|
||||||
|
ivec2 offset = ivec2(gl_FragCoord.xy + sampleOffset*vec2(viewWidth,viewHeight*aspectRatio)*RENDER_SCALE);
|
||||||
|
|
||||||
|
if (offset.x >= 0 && offset.y >= 0 && offset.x < viewWidth*RENDER_SCALE.x && offset.y < viewHeight*RENDER_SCALE.y ) {
|
||||||
|
vec3 t0 = toScreenSpace(vec3(offset*texelSize+acc+0.5*texelSize,texelFetch2D(depthtex1,offset,0).x) * vec3(1.0/RENDER_SCALE, 1.0) );
|
||||||
|
|
||||||
|
|
||||||
|
vec3 vec = t0.xyz - fragpos;
|
||||||
|
float dsquared = dot(vec,vec);
|
||||||
|
|
||||||
|
float NdotV2 = clamp(dot(vec*inversesqrt(dsquared), normalize(RPnormal)),0.,1.);
|
||||||
|
|
||||||
|
if (dsquared < maxR2){
|
||||||
|
// float NdotV = clamp(dot(vec*inversesqrt(dsquared), normalize(normal)),0.,1.);
|
||||||
|
// occlusion += NdotV * clamp(1.0-dsquared/maxR2,0.0,1.0);
|
||||||
|
|
||||||
|
|
||||||
|
vec3 previousPosition = mat3(gbufferModelViewInverse) * t0 + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
||||||
|
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
||||||
|
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
||||||
|
|
||||||
|
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0){
|
||||||
|
Radiance += NdotV2*texture2D(colortex5,previousPosition.xy).rgb ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lighting = vec3(1) + Radiance/Samples;
|
||||||
|
}
|
||||||
|
|
||||||
vec3 RT(vec3 dir, vec3 position, float noise, float stepsizes){
|
vec3 RT(vec3 dir, vec3 position, float noise, float stepsizes){
|
||||||
float dist = 1.0 + clamp(position.z*position.z/50.0,0,2); // shrink sample size as distance increases
|
float dist = 1.0 + clamp(position.z*position.z/50.0,0,2); // shrink sample size as distance increases
|
||||||
@ -553,6 +596,7 @@ vec3 TangentToWorld(vec3 N, vec3 H, float roughness){
|
|||||||
return vec3((T * H.x) + (B * H.y) + (N * H.z));
|
return vec3((T * H.x) + (B * H.y) + (N * H.z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void rtAO(inout vec3 lighting, vec3 normal, vec2 noise, vec3 fragpos, float lightmap, float inShadow){
|
void rtAO(inout vec3 lighting, vec3 normal, vec2 noise, vec3 fragpos, float lightmap, float inShadow){
|
||||||
int nrays = 4;
|
int nrays = 4;
|
||||||
float occlude = 0.0;
|
float occlude = 0.0;
|
||||||
@ -574,23 +618,70 @@ void rtAO(inout vec3 lighting, vec3 normal, vec2 noise, vec3 fragpos, float ligh
|
|||||||
|
|
||||||
// vec3 lightDir = normalize(vec3(0.2,0.8,0.2));
|
// vec3 lightDir = normalize(vec3(0.2,0.8,0.2));
|
||||||
// float skyLightDir = dot(rayDir,lightDir); // the positons where the occlusion happens
|
// float skyLightDir = dot(rayDir,lightDir); // the positons where the occlusion happens
|
||||||
|
|
||||||
float skyLightDir = rayDir.y > 0.0 ? 1.0 : max(rayDir.y,1.0-indoor); // the positons where the occlusion happens
|
float skyLightDir = rayDir.y > 0.0 ? 1.0 : max(rayDir.y,1.0-indoor); // the positons where the occlusion happens
|
||||||
if (rayHit.z > 1.0) occlude += max(rayDir.y,1-AO_Strength);
|
// if (rayHit.z > 1.0) occlude += skyLightDir;
|
||||||
|
|
||||||
|
occlude += normalize(rayHit.z - 1.0) / (1.1-rayDir.y);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// occlude = mix( occlude,1, inShadow);
|
// occlude = mix( occlude,1, inShadow);
|
||||||
// occlude = occlude*0.5 + 0.5;
|
// occlude = occlude*0.5 + 0.5;
|
||||||
lighting *= 2.5;
|
// lighting *= 2.5;
|
||||||
lighting *= mix(occlude/nrays,1.0,0) ;
|
lighting *= occlude/nrays;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// void rtGI(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, float lightmap, vec3 albedo, float inShadow){
|
||||||
|
// int nrays = RAY_COUNT;
|
||||||
|
// vec3 intRadiance = vec3(0.0);
|
||||||
|
// vec3 occlude = vec3(0.0);
|
||||||
|
|
||||||
|
// lighting *= 1.50;
|
||||||
|
// float indoor = clamp(pow(lightmap,2)*2,0.0,AO_Strength);
|
||||||
|
|
||||||
|
// for (int i = 0; i < nrays; i++){
|
||||||
|
// int seed = (frameCounter%40000)*nrays+i;
|
||||||
|
// vec2 ij = fract(R2_samples(seed) + noise );
|
||||||
|
|
||||||
|
// vec3 rayDir = TangentToWorld(normal, normalize(cosineHemisphereSample(ij,1.0)) ,1.0);
|
||||||
|
|
||||||
|
// #ifdef HQ_SSGI
|
||||||
|
// vec3 rayHit = rayTrace_GI( mat3(gbufferModelView) * rayDir, fragpos, blueNoise(), 50.); // ssr rt
|
||||||
|
// #else
|
||||||
|
// vec3 rayHit = RT(mat3(gbufferModelView)*rayDir, fragpos, blueNoise(), 30.); // choc sspt
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// float skyLightDir = rayDir.y > 0.0 ? 1.0 : max(rayDir.y,1.0-indoor); // the positons where the occlusion happens
|
||||||
|
|
||||||
|
// if (rayHit.z < 1.){
|
||||||
|
// vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rayHit) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
||||||
|
// previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
||||||
|
// previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
||||||
|
// if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0)
|
||||||
|
|
||||||
|
// intRadiance = DoContrast(texture2D(colortex5,previousPosition.xy).rgb) ;
|
||||||
|
// else
|
||||||
|
// intRadiance += lighting*skyLightDir; // make sure ambient light exists but at screen edges when you turn
|
||||||
|
|
||||||
|
|
||||||
|
// }else{
|
||||||
|
// intRadiance += lighting*skyLightDir;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// lighting = intRadiance/nrays;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
void rtGI(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, float lightmap, vec3 albedo, float inShadow){
|
void rtGI(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, float lightmap, vec3 albedo, float inShadow){
|
||||||
int nrays = RAY_COUNT;
|
int nrays = RAY_COUNT;
|
||||||
vec3 intRadiance = vec3(0.0);
|
vec3 intRadiance = vec3(0.0);
|
||||||
vec3 occlude = vec3(0.0);
|
vec3 occlusion = vec3(0.0);
|
||||||
|
vec3 sunlight =vec3(0);
|
||||||
|
|
||||||
lighting *= 1.50;
|
// lighting *= 1.50;
|
||||||
float indoor = clamp(pow(lightmap,2)*2,0.0,AO_Strength);
|
float indoor = clamp(pow(lightmap,2)*2,0.0,AO_Strength);
|
||||||
|
|
||||||
for (int i = 0; i < nrays; i++){
|
for (int i = 0; i < nrays; i++){
|
||||||
@ -604,24 +695,51 @@ void rtGI(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, float lightm
|
|||||||
#else
|
#else
|
||||||
vec3 rayHit = RT(mat3(gbufferModelView)*rayDir, fragpos, blueNoise(), 30.); // choc sspt
|
vec3 rayHit = RT(mat3(gbufferModelView)*rayDir, fragpos, blueNoise(), 30.); // choc sspt
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// float skyLightDir = rayDir.y > 0.0 ? 1.0 : max(rayDir.y,1.0-indoor); // the positons where the occlusion happens
|
||||||
|
|
||||||
|
// vec3 AO = lighting * (normalize(rayHit.z - 1.0) / (1.1-rayDir.y));
|
||||||
|
if (rayHit.z < 1){
|
||||||
|
vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rayHit)+ gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
||||||
|
|
||||||
float skyLightDir = rayDir.y > 0.0 ? 1.0 : max(rayDir.y,1.0-indoor); // the positons where the occlusion happens
|
|
||||||
|
|
||||||
if (rayHit.z < 1.){
|
|
||||||
vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rayHit) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
|
||||||
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
||||||
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
||||||
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0)
|
|
||||||
intRadiance = 0 + texture2D(colortex5,previousPosition.xy).rgb * GI_Strength ;
|
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0){
|
||||||
else
|
intRadiance = DoContrast(texture2D(colortex5,previousPosition.xy).rgb ) ;
|
||||||
intRadiance += lighting*skyLightDir; // make sure ambient light exists but at screen edges when you turn
|
}
|
||||||
|
|
||||||
}else{
|
|
||||||
intRadiance += lighting*skyLightDir;
|
|
||||||
}
|
}
|
||||||
|
occlusion = lighting * (normalize(rayHit.z - 1.0)/(1.1-rayDir.y));
|
||||||
|
|
||||||
|
// sunlight = lightCol.rgb * min( normalize(rayHit.z - 1.0) / (1.001-dot(rayDir,WsunVec) ) ,0.1) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if (rayHit.z < 1.){
|
||||||
|
// vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rayHit) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
||||||
|
// previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
||||||
|
// previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
||||||
|
// if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0){
|
||||||
|
// intRadiance += DoContrast(texture2D(colortex5,previousPosition.xy).rgb) ;
|
||||||
|
// }else{
|
||||||
|
// intRadiance += lighting;
|
||||||
|
// }
|
||||||
|
// // occlude += 1.0;
|
||||||
|
|
||||||
|
// }else{
|
||||||
|
// intRadiance += lighting;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// occlude = (lighting/nrays)*(normalize(rayHit.z - 1.0) / (1.1-rayDir.y));
|
||||||
|
|
||||||
}
|
}
|
||||||
lighting = intRadiance/nrays;
|
lighting = occlusion + intRadiance/nrays;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float GetCloudShadow(vec3 eyePlayerPos){
|
float GetCloudShadow(vec3 eyePlayerPos){
|
||||||
vec3 p3 = (eyePlayerPos + cameraPosition) - Cloud_Height;
|
vec3 p3 = (eyePlayerPos + cameraPosition) - Cloud_Height;
|
||||||
vec3 cloudPos = p3*Cloud_Size + WsunVec/abs(WsunVec.y) * ((3250 - 3250*0.35) - p3.y*Cloud_Size) ;
|
vec3 cloudPos = p3*Cloud_Size + WsunVec/abs(WsunVec.y) * ((3250 - 3250*0.35) - p3.y*Cloud_Size) ;
|
||||||
@ -687,6 +805,7 @@ void GriAndEminShadowFix(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
@ -708,8 +827,9 @@ void main() {
|
|||||||
float z = texture2D(depthtex1,texcoord).x;
|
float z = texture2D(depthtex1,texcoord).x;
|
||||||
|
|
||||||
vec3 fragpos = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z));
|
vec3 fragpos = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z));
|
||||||
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos;
|
||||||
vec3 np3 = normVec(p3);
|
vec3 np3 = normVec(p3);
|
||||||
|
p3 += gbufferModelViewInverse[3].xyz;
|
||||||
|
|
||||||
float iswaterstuff = texture2D(colortex7,texcoord).a ;
|
float iswaterstuff = texture2D(colortex7,texcoord).a ;
|
||||||
bool iswater = iswaterstuff > 0.99;
|
bool iswater = iswaterstuff > 0.99;
|
||||||
@ -755,10 +875,6 @@ void main() {
|
|||||||
vec3 filtered = vec3(1.412,1.0,0.0);
|
vec3 filtered = vec3(1.412,1.0,0.0);
|
||||||
if (!hand) filtered = texture2D(colortex3,texcoord).rgb;
|
if (!hand) filtered = texture2D(colortex3,texcoord).rgb;
|
||||||
|
|
||||||
#ifdef WhiteWorld
|
|
||||||
albedo = vec3(1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float Diffuse_final = 1.0;
|
float Diffuse_final = 1.0;
|
||||||
|
|
||||||
vec3 ambientCoefs = slope_normal/dot(abs(slope_normal),vec3(1.));
|
vec3 ambientCoefs = slope_normal/dot(abs(slope_normal),vec3(1.));
|
||||||
@ -895,7 +1011,7 @@ void main() {
|
|||||||
|
|
||||||
#ifdef Variable_Penumbra_Shadows
|
#ifdef Variable_Penumbra_Shadows
|
||||||
SSS = clamp(SSS, diffuseSun*shading, 1.0);
|
SSS = clamp(SSS, diffuseSun*shading, 1.0);
|
||||||
SSS = (phaseg(clamp(dot(np3, WsunVec),0.0,1.0), 0.5) * 10.0 + 0.25 ) * SSS ;
|
SSS = (phaseg(clamp(dot(np3, WsunVec),0.0,1.0), 0.5) * 10.0 + 1.0 ) * SSS ;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
SSS = 0.0;
|
SSS = 0.0;
|
||||||
@ -955,17 +1071,19 @@ void main() {
|
|||||||
ambientLight *= skylight;
|
ambientLight *= skylight;
|
||||||
#endif
|
#endif
|
||||||
#if indirect_effect == 1
|
#if indirect_effect == 1
|
||||||
ambientLight *= mix(1.0 - exp2(-5 * pow(1-vanilla_AO,2)), 1.0, diffuseSun*shading) ;
|
// ambientLight *= mix(1.0 - exp2(-5 * pow(1-vanilla_AO,2)), 1.0, diffuseSun*shading) ;
|
||||||
if (!hand) ssAO(ambientLight, fragpos, 1.0, blueNoise(gl_FragCoord.xy).rg, FlatNormals , texcoord, ambientCoefs, lightmap.xy, diffuseSun*shading ) ;
|
if (!hand) ssAO(ambientLight, fragpos, 1.0, blueNoise(gl_FragCoord.xy).rg, FlatNormals , texcoord, ambientCoefs, lightmap.xy, diffuseSun*shading ) ;
|
||||||
#endif
|
#endif
|
||||||
#if indirect_effect == 2
|
#if indirect_effect == 2
|
||||||
if (!hand) rtAO(ambientLight, slope_normal, blueNoise(gl_FragCoord.xy).rg, fragpos, lightmap.y, diffuseSun*shading);
|
if (!hand) rtAO(ambientLight, slope_normal, blueNoise(gl_FragCoord.xy).rg, fragpos, lightmap.y, diffuseSun*shading);
|
||||||
#endif
|
#endif
|
||||||
#if indirect_effect == 3
|
#if indirect_effect == 3
|
||||||
if (!hand) rtGI(ambientLight, slope_normal, blueNoise(gl_FragCoord.xy).rg, fragpos, lightmap.y, albedo, diffuseSun*shading);
|
if (!hand) rtGI(ambientLight, slope_normal, blueNoise(gl_FragCoord.xy).rg, fragpos, lightmap.y, (directLightCol/127.0), diffuseSun*shading);
|
||||||
|
#endif
|
||||||
|
#if indirect_effect == 4
|
||||||
|
if (!hand) ssDO(ambientLight, fragpos, 1.0, blueNoise(gl_FragCoord.xy).rg, FlatNormals, worldToView(slope_normal) , texcoord, ambientCoefs, lightmap.xy, diffuseSun*shading ) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Indirect_lighting = ambientLight;
|
|
||||||
|
|
||||||
vec3 waterabsorb_speculars = vec3(1);
|
vec3 waterabsorb_speculars = vec3(1);
|
||||||
|
|
||||||
@ -1034,15 +1152,20 @@ void main() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
// do this after water and stuff is done because yea
|
||||||
|
|
||||||
|
Indirect_lighting = ambientLight;
|
||||||
//combine all light sources
|
//combine all light sources
|
||||||
|
Direct_lighting = (Diffuse_final + SSS) * (directLightCol/127.0) ;
|
||||||
// Direct_lighting = max(Diffuse_final ,SSS) * (directLightCol/127.0) ;
|
// Direct_lighting = max(Diffuse_final ,SSS) * (directLightCol/127.0) ;
|
||||||
Direct_lighting = max(Diffuse_final ,SSS) * (directLightCol/127.0) ;
|
|
||||||
gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * albedo;
|
gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * albedo;
|
||||||
|
|
||||||
// do this after water and stuff is done because yea
|
|
||||||
#ifdef Specular_Reflections
|
#ifdef Specular_Reflections
|
||||||
MaterialReflections(gl_FragData[0].rgb, SpecularTex.r, SpecularTex.ggg, albedo, WsunVec, lightCol.rgb * waterabsorb_speculars, Diffuse_final , lightmap.y, slope_normal, np3, fragpos, vec3(blueNoise(gl_FragCoord.xy).rg, interleaved_gradientNoise()), hand);
|
vec3 fragpos_spec = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0));
|
||||||
|
vec3 p3_spec = mat3(gbufferModelViewInverse) * fragpos_spec;
|
||||||
|
vec3 np3_spec = normVec(p3_spec);
|
||||||
|
|
||||||
|
MaterialReflections(texcoord, gl_FragData[0].rgb, SpecularTex.r, SpecularTex.ggg, albedo, WsunVec, lightCol.rgb * waterabsorb_speculars, Diffuse_final , lightmap.y, slope_normal, np3, fragpos, vec3(blueNoise(gl_FragCoord.xy).rg, interleaved_gradientNoise()), hand);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LabPBR_Emissives
|
#ifdef LabPBR_Emissives
|
||||||
@ -1081,10 +1204,5 @@ void main() {
|
|||||||
if (isEyeInWater == 0) waterVolumetrics(gl_FragData[0].rgb, fragpos0, fragpos, estimatedDepth, estimatedSunDepth, Vdiff, noise, totEpsilon, scatterCoef, ambientColVol, lightColVol, dot(np3, WsunVec));
|
if (isEyeInWater == 0) waterVolumetrics(gl_FragData[0].rgb, fragpos0, fragpos, estimatedDepth, estimatedSunDepth, Vdiff, noise, totEpsilon, scatterCoef, ambientColVol, lightColVol, dot(np3, WsunVec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// gl_FragData[0].rgb = vec3(1) * viewToWorld(FlatNormals);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* RENDERTARGETS:3 */
|
/* RENDERTARGETS:3 */
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define TAA
|
#include "lib/settings.glsl"
|
||||||
#define SEPARATE_AO
|
|
||||||
flat varying vec3 WsunVec;
|
flat varying vec3 WsunVec;
|
||||||
flat varying vec3 avgAmbient;
|
flat varying vec3 avgAmbient;
|
||||||
flat varying vec3 ambientUp;
|
flat varying vec3 ambientUp;
|
||||||
|
@ -1,16 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
//Render sky, volumetric clouds, direct lighting
|
//Render sky, volumetric clouds, direct lighting
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
// #define BorderFog // aaaaaaaaaaaaaaaaaaaaaaa
|
|
||||||
|
|
||||||
#define fog_coefficientRayleighR 5.8 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientRayleighG 1.35 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientRayleighB 3.31 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
#define fog_coefficientMieR 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientMieG 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientMieB 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
uniform vec2 texelSize;
|
uniform vec2 texelSize;
|
||||||
uniform sampler2D depthtex0;
|
uniform sampler2D depthtex0;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
flat varying float tempOffsets;
|
flat varying float tempOffsets;
|
||||||
uniform int frameCounter;
|
uniform int frameCounter;
|
||||||
flat varying vec2 TAA_Offset;
|
flat varying vec2 TAA_Offset;
|
||||||
|
@ -1,40 +1,8 @@
|
|||||||
#version 120
|
#version 120
|
||||||
//Volumetric fog rendering
|
//Volumetric fog rendering
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define CLOUDS_SHADOWS
|
|
||||||
#define VL_CLOUDS_SHADOWS // Casts shadows from clouds on VL (slow)
|
|
||||||
#define CLOUDS_SHADOWS_STRENGTH 1.0 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
|
||||||
#define VL_SAMPLES 8 //[4 6 8 10 12 14 16 20 24 30 40 50]
|
|
||||||
#define Ambient_Mult 1.0 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.5 2.0 3.0 4.0 5.0 6.0 10.0]
|
|
||||||
#define SEA_LEVEL 70 //[0 10 20 30 40 50 60 70 80 90 100 110 120 130 150 170 190] //The volumetric light uses an altitude-based fog density, this is where fog density is the highest, adjust this value according to your world.
|
|
||||||
#define ATMOSPHERIC_DENSITY 1.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 4.0 5.0 7.5 10.0 12.5 15.0 20.]
|
|
||||||
#define fog_mieg1 0.40 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
#define fog_mieg2 0.10 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
#define fog_coefficientRayleighR 5.8 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientRayleighG 1.35 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientRayleighB 3.31 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
#define fog_coefficientMieR 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientMieG 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientMieB 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
#define Cloudy_Fog_Density 5.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define Uniform_Fog_Density 1.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
#define uniformfog_fade 10 // does not change rain or cave fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
#define cloudyfog_fade 10 // does not change rain or cave fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
|
|
||||||
#define RainFog_amount 5 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
|
|
||||||
#define CaveFog_amount 5 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
|
|
||||||
#define cloudray_amount 0.2 // rain boost this [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
|
|
||||||
#define UniformFog_amount 1.0 // [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 10.0 20.0 30.0 50.0 100.0 150.0 200.0]
|
|
||||||
#define CloudyFog_amount 1.0 // [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 10 20 30 40 50 100 500 10000]
|
|
||||||
#define TimeOfDayFog_multiplier 1.0 // Influence of time of day on fog amount [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
|
||||||
#define Haze_amount 1.0 // [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
|
||||||
// #define fog_selfShadowing // make the fog cast a shadow onto itself
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
flat varying vec4 lightCol;
|
flat varying vec4 lightCol;
|
||||||
flat varying vec3 ambientUp;
|
flat varying vec3 ambientUp;
|
||||||
@ -72,7 +40,6 @@ uniform int isEyeInWater;
|
|||||||
uniform vec2 texelSize;
|
uniform vec2 texelSize;
|
||||||
|
|
||||||
|
|
||||||
#include "lib/waterOptions.glsl"
|
|
||||||
#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"
|
||||||
@ -172,7 +139,7 @@ mat2x3 getVolumetricRays(
|
|||||||
vec3 dV = fragposition-start;
|
vec3 dV = fragposition-start;
|
||||||
vec3 dVWorld = (wpos-gbufferModelViewInverse[3].xyz);
|
vec3 dVWorld = (wpos-gbufferModelViewInverse[3].xyz);
|
||||||
|
|
||||||
float maxLength = min(length(dVWorld),far*5)/length(dVWorld);
|
float maxLength = min(length(dVWorld),far)/length(dVWorld);
|
||||||
dV *= maxLength;
|
dV *= maxLength;
|
||||||
dVWorld *= maxLength;
|
dVWorld *= maxLength;
|
||||||
|
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define TAA
|
|
||||||
#define VL_CLOUDS_SHADOWS // Casts shadows from clouds on VL (slow)
|
#include "lib/settings.glsl"
|
||||||
#define BASE_FOG_AMOUNT 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 10.0 20.0 30.0 50.0 100.0 150.0 200.0] Base fog amount amount (does not change the "cloudy" fog)
|
|
||||||
#define CLOUDY_FOG_AMOUNT 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
|
||||||
#define FOG_TOD_MULTIPLIER 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0] //Influence of time of day on fog amount
|
|
||||||
#define FOG_RAIN_MULTIPLIER 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0] //Influence of rain on fog amount
|
|
||||||
|
|
||||||
flat varying vec4 lightCol;
|
flat varying vec4 lightCol;
|
||||||
flat varying vec3 ambientUp;
|
flat varying vec3 ambientUp;
|
||||||
|
@ -1,19 +1,8 @@
|
|||||||
#version 120
|
#version 120
|
||||||
//Horizontal bilateral blur for volumetric fog + Forward rendered objects + Draw volumetric fog
|
//Horizontal bilateral blur for volumetric fog + Forward rendered objects + Draw volumetric fog
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
#define SEA_LEVEL 70 //[0 10 20 30 40 50 60 70 80 90 100 110 120 130 150 170 190] //The volumetric light uses an altitude-based fog density, this is where fog density is the highest, adjust this value according to your world.
|
|
||||||
#define Refraction
|
|
||||||
|
|
||||||
|
|
||||||
#define Cave_fog // cave fog....
|
|
||||||
#define CaveFogFallOff 1.3 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
|
||||||
|
|
||||||
#define CaveFogColor_R 0.1 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define CaveFogColor_G 0.2 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define CaveFogColor_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
// #define display_LUT // aaaaaaaaaaaaaaaaaaaaaaa
|
|
||||||
flat varying vec3 zMults;
|
flat varying vec3 zMults;
|
||||||
flat varying vec2 TAA_Offset;
|
flat varying vec2 TAA_Offset;
|
||||||
|
|
||||||
@ -68,7 +57,6 @@ uniform float darknessLightFactor;
|
|||||||
uniform float nightVision;
|
uniform float nightVision;
|
||||||
|
|
||||||
#include "lib/waterBump.glsl"
|
#include "lib/waterBump.glsl"
|
||||||
#include "lib/waterOptions.glsl"
|
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
#include "lib/sky_gradient.glsl"
|
#include "lib/sky_gradient.glsl"
|
||||||
@ -97,7 +85,7 @@ vec3 toScreenSpace(vec3 p) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "lib/specular.glsl"
|
// #include "lib/specular.glsl"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
flat varying vec4 lightCol;
|
flat varying vec4 lightCol;
|
||||||
flat varying vec3 WsunVec;
|
flat varying vec3 WsunVec;
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
uniform sampler2D colortex3;
|
uniform sampler2D colortex3;
|
||||||
// Compute 3x3 min max for TAA
|
// Compute 3x3 min max for TAA
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
|
@ -3,19 +3,11 @@
|
|||||||
|
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
|
|
||||||
|
|
||||||
//TAA OPTIONS
|
//TAA OPTIONS
|
||||||
//#define NO_CLIP //Removes all anti-ghosting techniques used and creates a sharp image (good for still screenshots)
|
|
||||||
#define BLEND_FACTOR 0.05 //[0.01 0.02 0.03 0.04 0.05 0.06 0.08 0.1 0.12 0.14 0.16] higher values = more flickering but sharper image, lower values = less flickering but the image will be blurrier
|
|
||||||
#define MOTION_REJECTION 0.0 //[0.0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.5] //Higher values=sharper image in motion at the cost of flickering
|
|
||||||
#define ANTI_GHOSTING 0.0 //[0.0 0.25 0.5 0.75 1.0] High values reduce ghosting but may create flickering
|
|
||||||
#define FLICKER_REDUCTION 0.5 //[0.0 0.25 0.5 0.75 1.0] High values reduce flickering but may reduce sharpness
|
|
||||||
#define CLOSEST_VELOCITY //improves edge quality in motion at the cost of performance
|
|
||||||
|
|
||||||
// #define SCREENSHOT_MODE // go render mode and accumulate frames for as long as you want for max image quality.
|
|
||||||
// #define SPLIT_RENDER // AAAAAAAAAAAAAAAA
|
|
||||||
|
|
||||||
const int noiseTextureResolution = 32;
|
const int noiseTextureResolution = 32;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
flat varying float exposureA;
|
flat varying float exposureA;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
//downsample 1st pass (half res) for bloom
|
//downsample 1st pass (half res) for bloom
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
uniform sampler2D colortex5;
|
uniform sampler2D colortex5;
|
||||||
// uniform sampler2D colortex8;
|
// uniform sampler2D colortex8;
|
||||||
uniform vec2 texelSize;
|
uniform vec2 texelSize;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
uniform float viewWidth;
|
uniform float viewWidth;
|
||||||
uniform float viewHeight;
|
uniform float viewHeight;
|
||||||
|
@ -1,18 +1,8 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
//Prepares sky textures (2 * 256 * 256), computes light values and custom lightmaps
|
//Prepares sky textures (2 * 256 * 256), computes light values and custom lightmaps
|
||||||
#define Ambient_Mult 1.0 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.5 2.0 3.0 4.0 5.0 6.0 10.0]
|
|
||||||
#define Sky_Brightness 1.0 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.5 2.0 3.0 4.0 5.0 6.0 10.0]
|
|
||||||
|
|
||||||
#define MIN_LIGHT_AMOUNT 1.0 //[0.0 0.5 1.0 1.5 2.0 3.0 4.0 5.0]
|
|
||||||
#define TORCH_AMOUNT 1.0 //[0.0 0.5 0.75 1. 1.2 1.4 1.6 1.8 2.0]
|
|
||||||
#define TORCH_R 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define TORCH_G 0.75 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define ambient_temp 9000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 15000 50000]
|
|
||||||
|
|
||||||
|
|
||||||
flat varying vec3 ambientUp;
|
flat varying vec3 ambientUp;
|
||||||
flat varying vec3 ambientLeft;
|
flat varying vec3 ambientLeft;
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define EXPOSURE_MULTIPLIER 1.0 //[0.25 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.1 1.2 1.3 1.4 1.5 2.0 3.0 4.0]
|
|
||||||
#define AUTO_EXPOSURE //Highly recommended to keep it on unless you want to take screenshots
|
#include "lib/settings.glsl"
|
||||||
#define Manual_exposure_value 1.0 // [0.000553 0.000581 0.000611 0.000642 0.000675 0.000710 0.000746 0.000784 0.000825 0.000867 0.000911 0.000958 0.001007 0.001059 0.001113 0.001170 0.001230 0.001294 0.001360 0.001430 0.001503 0.001580 0.001661 0.001746 0.001836 0.001930 0.002029 0.002133 0.002242 0.002357 0.002478 0.002605 0.002739 0.002879 0.003027 0.003182 0.003345 0.003517 0.003697 0.003887 0.004086 0.004296 0.004516 0.004748 0.004991 0.005247 0.005516 0.005799 0.006096 0.006409 0.006737 0.007083 0.007446 0.007828 0.008229 0.008651 0.009095 0.009561 0.010051 0.010567 0.011108 0.011678 0.012277 0.012906 0.013568 0.014264 0.014995 0.015764 0.016572 0.017422 0.018315 0.019254 0.020241 0.021279 0.022370 0.023517 0.024723 0.025991 0.027323 0.028724 0.030197 0.031745 0.033373 0.035084 0.036883 0.038774 0.040762 0.042852 0.045049 0.047358 0.049787 0.052339 0.055023 0.057844 0.060810 0.063927 0.067205 0.070651 0.074273 0.078081 0.082084 0.086293 0.090717 0.095369 0.100258 0.105399 0.110803 0.116484 0.122456 0.128734 0.135335 0.142274 0.149568 0.157237 0.165298 0.173773 0.182683 0.192049 0.201896 0.212247 0.223130 0.234570 0.246596 0.259240 0.272531 0.286504 0.301194 0.316636 0.332871 0.349937 0.367879 0.386741 0.406569 0.427414 0.449328 0.472366 0.496585 0.522045 0.548811 0.576949 0.606530 0.637628 0.670320 0.704688 0.740818 0.778800 0.818730 0.860707 0.904837 0.951229 1.0 1.051271 1.105170 1.161834 1.221402 1.284025 1.349858 1.419067 1.491824 1.568312 1.648721 1.733253 1.822118 1.915540 2.013752 2.117000 2.225540 2.339646 2.459603 2.585709 2.718281 2.857651 3.004166 3.158192 3.320116 3.490342 3.669296 3.857425 4.055199 4.263114 4.481689 4.711470 4.953032 5.206979 5.473947 5.754602 6.049647 6.359819 6.685894 7.028687 7.389056 7.767901 8.166169 8.584858 9.025013 9.487735 9.974182 10.48556 11.02317 11.58834 12.18249 ]
|
|
||||||
#define Exposure_Speed 1.0 //[0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 2.25 2.5 2.75 3.0 4.0 5.0]
|
|
||||||
#define DoF_Adaptation_Speed 1.00 // [0.20 0.21 0.23 0.24 0.25 0.27 0.29 0.30 0.32 0.34 0.36 0.39 0.41 0.43 0.46 0.49 0.52 0.55 0.59 0.62 0.66 0.70 0.74 0.79 0.84 0.89 0.94 1.00 1.06 1.13 1.20 1.27 1.35 1.43 1.52 1.61 1.71 1.82 1.93 2.05 2.18 2.31 2.45 2.60 2.76 2.93 3.11 3.30 3.51 3.72 3.95 4.19 4.45 4.73 5.02 5.33 5.65 6.00]
|
|
||||||
#define CLOUDS_SHADOWS
|
|
||||||
#define BASE_FOG_AMOUNT 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 10.0 20.0 30.0 50.0 100.0 150.0 200.0] Base fog amount amount (does not change the "cloudy" fog)
|
|
||||||
#define CLOUDY_FOG_AMOUNT 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
|
||||||
#define FOG_TOD_MULTIPLIER 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0] //Influence of time of day on fog amount
|
|
||||||
#define FOG_RAIN_MULTIPLIER 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0] //Influence of rain on fog amount
|
|
||||||
#include "lib/res_params.glsl"
|
#include "lib/res_params.glsl"
|
||||||
flat varying vec3 ambientUp;
|
flat varying vec3 ambientUp;
|
||||||
flat varying vec3 ambientLeft;
|
flat varying vec3 ambientLeft;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
//Computes volumetric clouds at variable resolution (default 1/4 res)
|
//Computes volumetric clouds at variable resolution (default 1/4 res)
|
||||||
#define HQ_CLOUDS //Renders detailled clouds for viewport
|
|
||||||
#define CLOUDS_QUALITY 0.5 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
|
||||||
#define TAA
|
|
||||||
|
|
||||||
flat varying vec3 sunColor;
|
flat varying vec3 sunColor;
|
||||||
flat varying vec3 moonColor;
|
flat varying vec3 moonColor;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define CLOUDS_QUALITY 0.5 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
|
|
||||||
flat varying vec3 sunColor;
|
flat varying vec3 sunColor;
|
||||||
flat varying vec3 moonColor;
|
flat varying vec3 moonColor;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
uniform sampler2D colortex4;
|
uniform sampler2D colortex4;
|
||||||
uniform sampler2D depthtex1;
|
uniform sampler2D depthtex1;
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
uniform vec2 texelSize;
|
uniform vec2 texelSize;
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
#version 120
|
#version 120
|
||||||
//Vignetting, applies bloom, applies exposure and tonemaps the final image
|
//Vignetting, applies bloom, applies exposure and tonemaps the final image
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
//#define BICUBIC_UPSCALING //Provides a better interpolation when using a render quality different of 1.0, slower
|
|
||||||
#define CONTRAST_ADAPTATIVE_SHARPENING
|
#include "lib/settings.glsl"
|
||||||
#define SHARPENING 0.35 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
#define SATURATION 0.00 // Negative values desaturates colors, Positive values saturates color, 0 is no change [-1.0 -0.98 -0.96 -0.94 -0.92 -0.9 -0.88 -0.86 -0.84 -0.82 -0.8 -0.78 -0.76 -0.74 -0.72 -0.7 -0.68 -0.66 -0.64 -0.62 -0.6 -0.58 -0.56 -0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4 -0.38 -0.36 -0.34 -0.32 -0.3 -0.28 -0.26 -0.24 -0.22 -0.2 -0.18 -0.16 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 ]
|
|
||||||
#define CROSSTALK 0.0 // Desaturates bright colors and preserves saturation in darker areas (inverted if negative). Helps avoiding almsost fluorescent colors [-1.0 -0.98 -0.96 -0.94 -0.92 -0.9 -0.88 -0.86 -0.84 -0.82 -0.8 -0.78 -0.76 -0.74 -0.72 -0.7 -0.68 -0.66 -0.64 -0.62 -0.6 -0.58 -0.56 -0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4 -0.38 -0.36 -0.34 -0.32 -0.3 -0.28 -0.26 -0.24 -0.22 -0.2 -0.18 -0.16 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 ]
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
|
|
||||||
uniform sampler2D colortex7;
|
uniform sampler2D colortex7;
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#define FinalR 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
|
||||||
#define FinalG 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
|
||||||
#define FinalB 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
|
||||||
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
flat varying vec4 exposure;
|
flat varying vec4 exposure;
|
||||||
|
@ -19,7 +19,7 @@ uniform mat4 gbufferModelView;
|
|||||||
uniform mat4 shadowModelView;
|
uniform mat4 shadowModelView;
|
||||||
uniform mat4 shadowProjection;
|
uniform mat4 shadowProjection;
|
||||||
uniform vec3 cameraPosition;
|
uniform vec3 cameraPosition;
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "lib/Shadow_Params.glsl"
|
#include "lib/Shadow_Params.glsl"
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
#include "lib/sky_gradient.glsl"
|
#include "lib/sky_gradient.glsl"
|
||||||
@ -99,7 +99,13 @@ void main() {
|
|||||||
|
|
||||||
vec4 TEXTURE = texture2D(texture, lmtexcoord.xy)*color;
|
vec4 TEXTURE = texture2D(texture, lmtexcoord.xy)*color;
|
||||||
|
|
||||||
|
#ifdef WEATHER
|
||||||
|
gl_FragData[1].a = TEXTURE.a; // for bloomy rain
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef WEATHER
|
#ifndef WEATHER
|
||||||
|
|
||||||
|
gl_FragData[1].a = 0.0; // for bloomy rain
|
||||||
gl_FragData[0] = TEXTURE;
|
gl_FragData[0] = TEXTURE;
|
||||||
vec2 tempOffset = offsets[framemod8];
|
vec2 tempOffset = offsets[framemod8];
|
||||||
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
||||||
@ -142,8 +148,6 @@ void main() {
|
|||||||
vec3 DirectLight = DirectLightCol * phase * lightleakfix;
|
vec3 DirectLight = DirectLightCol * phase * lightleakfix;
|
||||||
|
|
||||||
gl_FragData[0].rgb = (AmbientLight + DirectLight) * albedo;
|
gl_FragData[0].rgb = (AmbientLight + DirectLight) * albedo;
|
||||||
#endif
|
|
||||||
|
|
||||||
gl_FragData[1].a = TEXTURE.a; // for bloomy rain
|
#endif
|
||||||
// gl_FragData[1].a = 1;
|
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
// #version 120
|
// #version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,26 +1,10 @@
|
|||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
#extension GL_ARB_shader_texture_lod : enable
|
||||||
//#define Specular_Reflections // reflections on blocks. REQUIRES A PBR RESOURCEPACK.
|
|
||||||
//#define POM
|
#include "lib/settings.glsl"
|
||||||
#define POM_MAP_RES 128.0 // [16.0 32.0 64.0 128.0 256.0 512.0 1024.0] Increase to improve POM quality
|
|
||||||
#define POM_DEPTH 0.1 // [0.025 0.05 0.075 0.1 0.125 0.15 0.20 0.25 0.30 0.50 0.75 1.0] //Increase to increase POM strength
|
|
||||||
#define MAX_ITERATIONS 50 // [5 10 15 20 25 30 40 50 60 70 80 90 100 125 150 200 400] //Improves quality at grazing angles (reduces performance)
|
|
||||||
#define MAX_DIST 25.0 // [5.0 10.0 15.0 20.0 25.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 125.0 150.0 200.0 400.0] //Increases distance at which POM is calculated
|
|
||||||
//#define USE_LUMINANCE_AS_HEIGHTMAP //Can generate POM on any texturepack (may look weird in some cases)
|
|
||||||
#define Texture_MipMap_Bias -1.00 // Uses a another mip level for textures. When reduced will increase texture detail but may induce a lot of shimmering. [-5.00 -4.75 -4.50 -4.25 -4.00 -3.75 -3.50 -3.25 -3.00 -2.75 -2.50 -2.25 -2.00 -1.75 -1.50 -1.25 -1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
|
|
||||||
#define DISABLE_ALPHA_MIPMAPS //Disables mipmaps on the transparency of alpha-tested things like foliage, may cost a few fps in some cases
|
|
||||||
|
|
||||||
|
|
||||||
#define SSAO // screen-space ambient occlusion.
|
|
||||||
#define texture_ao // ambient occlusion on the texture
|
|
||||||
|
|
||||||
#define Puddle_Size 1.0 // [0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5]
|
|
||||||
#ifdef Specular_Reflections
|
|
||||||
#define Puddles // yes
|
|
||||||
#else
|
|
||||||
// #define Puddles // yes
|
|
||||||
#endif
|
|
||||||
// #define Porosity
|
|
||||||
|
|
||||||
#ifndef USE_LUMINANCE_AS_HEIGHTMAP
|
#ifndef USE_LUMINANCE_AS_HEIGHTMAP
|
||||||
#ifndef MC_NORMAL_MAP
|
#ifndef MC_NORMAL_MAP
|
||||||
@ -37,7 +21,6 @@ varying float VanillaAO;
|
|||||||
|
|
||||||
const float mincoord = 1.0/4096.0;
|
const float mincoord = 1.0/4096.0;
|
||||||
const float maxcoord = 1.0-mincoord;
|
const float maxcoord = 1.0-mincoord;
|
||||||
const vec3 intervalMult = vec3(1.0, 1.0, 1.0/POM_DEPTH)/POM_MAP_RES * 1.0;
|
|
||||||
|
|
||||||
const float MAX_OCCLUSION_DISTANCE = MAX_DIST;
|
const float MAX_OCCLUSION_DISTANCE = MAX_DIST;
|
||||||
const float MIX_OCCLUSION_DISTANCE = MAX_DIST*0.9;
|
const float MIX_OCCLUSION_DISTANCE = MAX_DIST*0.9;
|
||||||
@ -245,6 +228,9 @@ float densityAtPosSNOW(in vec3 pos){
|
|||||||
vec2 xy = texture2D(noisetex, coord).yx;
|
vec2 xy = texture2D(noisetex, coord).yx;
|
||||||
return mix(xy.r,xy.g, f.y);
|
return mix(xy.r,xy.g, f.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
@ -272,7 +258,7 @@ void main() {
|
|||||||
vec3 worldpos = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz + cameraPosition;
|
vec3 worldpos = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz + cameraPosition;
|
||||||
|
|
||||||
|
|
||||||
float lightmap = clamp( (lmtexcoord.w-0.66) * 5.0,0.,1.);
|
float lightmap = clamp( (lmtexcoord.w-0.8) * 10.0,0.,1.);
|
||||||
|
|
||||||
float rainfall = 0. ;
|
float rainfall = 0. ;
|
||||||
float Puddle_shape = 0.;
|
float Puddle_shape = 0.;
|
||||||
@ -283,9 +269,15 @@ void main() {
|
|||||||
#ifdef WORLD
|
#ifdef WORLD
|
||||||
#ifdef Puddles
|
#ifdef Puddles
|
||||||
rainfall = rainStrength ;
|
rainfall = rainStrength ;
|
||||||
Puddle_shape = 1.0 - max(texture2D(noisetex, worldpos.xz * (0.015 * Puddle_Size)).b - (1.0-lightmap) ,0.0);
|
// Puddle_shape = (1.0 - max(texture2D(noisetex, worldpos.xz * (0.015 * Puddle_Size)).b - (1.0-lightmap) ,0.0) * clamp( viewToWorld(normal).y*0.5+0.5 ,0.0,1.0)) * rainfall;
|
||||||
puddle_shiny = clamp( pow(1.0-Puddle_shape,2.0)*2,0.25,1.) ;
|
|
||||||
puddle_normal = clamp( pow(Puddle_shape,5.0) * 50. ,0.,1.) ;
|
|
||||||
|
Puddle_shape = (1.0 - clamp(exp(-15 * pow(texture2D(noisetex, worldpos.xz * (0.015 * Puddle_Size) ).b ,5)),0,1)) * lightmap ;
|
||||||
|
|
||||||
|
Puddle_shape *= clamp( viewToWorld(normal).y*0.5+0.5 ,0.0,1.0);
|
||||||
|
Puddle_shape *= rainfall;
|
||||||
|
// puddle_shiny = clamp( pow(1.0-Puddle_shape,2.0)*2,0.25,1.) * rainfall;
|
||||||
|
// puddle_normal = clamp( pow(Puddle_shape,5.0) * 50. ,0.,1.) * rainfall;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -334,118 +326,120 @@ void main() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// color
|
////////////////////////////////
|
||||||
vec4 data0 = texture2DGradARB(texture, adjustedTexCoord.xy,dcdx,dcdy);
|
//////////////////////////////// ALBEDO
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
#ifdef DISABLE_ALPHA_MIPMAPS
|
vec4 Albedo = texture2DGradARB(texture, adjustedTexCoord.xy,dcdx,dcdy);
|
||||||
data0.a = texture2DGradARB(texture, adjustedTexCoord.xy,vec2(0.),vec2(0.0)).a;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
data0.rgb *= color.rgb;
|
|
||||||
float avgBlockLum = luma(texture2DLod(texture, adjustedTexCoord.xy,128).rgb*color.rgb);
|
|
||||||
data0.rgb = clamp(data0.rgb*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
|
||||||
|
|
||||||
|
#ifdef DISABLE_ALPHA_MIPMAPS
|
||||||
|
Albedo.a = texture2DGradARB(texture, adjustedTexCoord.xy,vec2(0.),vec2(0.0)).a;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WORLD
|
#ifdef WORLD
|
||||||
if (data0.a > 0.1) data0.a = normalMat.a;
|
if (Albedo.a > 0.1) Albedo.a = normalMat.a;
|
||||||
else data0.a = 0.0;
|
else Albedo.a = 0.0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAND
|
#ifdef HAND
|
||||||
if (data0.a > 0.1) data0.a = 0.75;
|
if (Albedo.a > 0.1) Albedo.a = 0.75;
|
||||||
else data0.a = 0.0;
|
else Albedo.a = 0.0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// normal
|
////////////////////////////////
|
||||||
#ifdef MC_NORMAL_MAP
|
//////////////////////////////// NORMAL
|
||||||
vec3 normalTex = texture2DGradARB(normals, adjustedTexCoord.xy, dcdx,dcdy).rgb;
|
////////////////////////////////
|
||||||
normalTex.xy = normalTex.xy*2.0-1.0;
|
|
||||||
normalTex.z = clamp(sqrt(1.0 - dot(normalTex.xy, normalTex.xy)),0.0,1.0);
|
|
||||||
|
|
||||||
normal = applyBump(tbnMatrix,normalTex, mix(1.0,puddle_normal,rainfall));
|
#ifdef MC_NORMAL_MAP
|
||||||
#endif
|
vec3 NormalTex = texture2DGradARB(normals, adjustedTexCoord.xy, dcdx,dcdy).rgb;
|
||||||
|
NormalTex.xy = NormalTex.xy*2.0-1.0;
|
||||||
|
NormalTex.z = clamp(sqrt(1.0 - dot(NormalTex.xy, NormalTex.xy)),0.0,1.0);
|
||||||
|
|
||||||
// specular
|
normal = applyBump(tbnMatrix,NormalTex, mix(1.0,Puddle_shape,rainfall));
|
||||||
gl_FragData[2] = texture2DGradARB(specular, adjustedTexCoord.xy,dcdx,dcdy);
|
#endif
|
||||||
|
|
||||||
// finalize
|
////////////////////////////////
|
||||||
vec4 data1 = clamp(encode(viewToWorld(normal), lmtexcoord.zw),0.,1.0);
|
//////////////////////////////// SPECULAR
|
||||||
gl_FragData[0] = vec4(encodeVec2(data0.x,data1.x),encodeVec2(data0.y,data1.y),encodeVec2(data0.z,data1.z),encodeVec2(data1.w,data0.w));
|
////////////////////////////////
|
||||||
|
|
||||||
gl_FragData[1].a = 0.0;
|
gl_FragData[2] = texture2DGradARB(specular, adjustedTexCoord.xy,dcdx,dcdy);
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//////////////////////////////// FINALIZE
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
vec4 data1 = clamp(encode(viewToWorld(normal), lmtexcoord.zw),0.,1.0);
|
||||||
|
gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x),encodeVec2(Albedo.y,data1.y),encodeVec2(Albedo.z,data1.z),encodeVec2(data1.w,Albedo.w));
|
||||||
|
|
||||||
|
gl_FragData[1].a = 0.0;
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//////////////////////////////// NORMAL
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
// float Snow = texture2D(noisetex, worldpos.xz/100, Texture_MipMap_Bias).r;
|
|
||||||
// Snow = clamp( exp(pow(Snow,2) * -25) ,0,1) ;
|
|
||||||
// Snow *= clamp(pow(lmtexcoord.w,25)*5 ,0,1);
|
|
||||||
|
|
||||||
// #ifdef ENTITIES
|
|
||||||
// Snow = 0;
|
|
||||||
// #endif
|
|
||||||
// #ifdef HAND
|
|
||||||
// Snow = 0;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// normal
|
|
||||||
#ifdef MC_NORMAL_MAP
|
#ifdef MC_NORMAL_MAP
|
||||||
vec4 normalTex = texture2D(normals, lmtexcoord.xy, Texture_MipMap_Bias).rgba;
|
vec4 NormalTex = texture2D(normals, lmtexcoord.xy, Texture_MipMap_Bias).rgba;
|
||||||
normalTex.xy = normalTex.xy*2.0-1.0;
|
NormalTex.xy = NormalTex.xy*2.0-1.0;
|
||||||
normalTex.z = clamp(sqrt(1.0 - dot(normalTex.xy, normalTex.xy)),0.0,1.0) ;
|
NormalTex.z = clamp(sqrt(1.0 - dot(NormalTex.xy, NormalTex.xy)),0.0,1.0) ;
|
||||||
|
|
||||||
normal = applyBump(tbnMatrix, normalTex.xyz, mix(1.0,puddle_normal, rainfall) );
|
normal = applyBump(tbnMatrix, NormalTex.xyz, mix(1.0,1.0-Puddle_shape,rainfall) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Snow *= clamp(viewToWorld(normal).y,0.0,1.0);
|
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//////////////////////////////// SPECULAR
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
vec4 SpecularTex = texture2D(specular, lmtexcoord.xy, Texture_MipMap_Bias).rgba;
|
||||||
|
|
||||||
// specular
|
SpecularTex.r = max(SpecularTex.r, Puddle_shape);
|
||||||
vec4 specular = texture2D(specular, lmtexcoord.xy, Texture_MipMap_Bias).rgba;
|
SpecularTex.g = max(SpecularTex.g, Puddle_shape*0.04);
|
||||||
vec4 specular_modded = vec4( max(specular.r,puddle_shiny), max(specular.g, puddle_shiny*0.1),specular.ba);
|
|
||||||
|
|
||||||
gl_FragData[2].rgba = mix(specular, specular_modded, rainfall);
|
gl_FragData[2] = SpecularTex;
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//////////////////////////////// ALBEDO
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
// gl_FragData[2].rg = mix(gl_FragData[2].rg, vec2(0.8,0.3), Snow);
|
vec4 Albedo = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color;
|
||||||
|
|
||||||
|
#ifdef WhiteWorld
|
||||||
|
Albedo.rgb = vec3(1.0);
|
||||||
|
#endif
|
||||||
|
|
||||||
// color
|
#ifdef DISABLE_ALPHA_MIPMAPS
|
||||||
vec4 data0 = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias) * color ;
|
Albedo.a = texture2DLod(texture,lmtexcoord.xy,0).a;
|
||||||
// data0.rgb *= pow(VanillaAO.r,25);
|
#endif
|
||||||
|
|
||||||
#ifdef Puddles
|
#ifdef Puddles
|
||||||
|
float porosity = 0.35;
|
||||||
float porosity = specular.z >= 64.5/255.0 ? 0.0 : (specular.z*255.0/64.0)*0.65;
|
#ifdef Porosity
|
||||||
#ifndef Porosity
|
porosity = specular.z >= 64.5/255.0 ? 0.0 : (specular.z*255.0/64.0)*0.65;
|
||||||
porosity = 0.5;
|
#endif
|
||||||
#endif
|
if(SpecularTex.g < 229.5/255.0) Albedo.rgb = mix(Albedo.rgb, vec3(0), Puddle_shape*porosity);
|
||||||
|
|
||||||
data0.rgb = mix(data0.rgb, vec3(0), puddle_shiny*porosity*rainfall);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
|
||||||
data0.rgb = clamp(data0.rgb*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
|
||||||
|
|
||||||
#ifndef ENTITIES
|
|
||||||
if(TESTMASK.r==255) data0.rgb = vec3(0);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DISABLE_ALPHA_MIPMAPS
|
|
||||||
data0.a = texture2DLod(texture,lmtexcoord.xy,0).a;
|
|
||||||
#endif
|
|
||||||
#ifdef WORLD
|
#ifdef WORLD
|
||||||
if (data0.a > 0.1) data0.a = normalMat.a;
|
if (Albedo.a > 0.1) Albedo.a = normalMat.a;
|
||||||
else data0.a = 0.0;
|
else Albedo.a = 0.0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAND
|
#ifdef HAND
|
||||||
if (data0.a > 0.1) data0.a = 0.75;
|
if (Albedo.a > 0.1) Albedo.a = 0.75;
|
||||||
else data0.a = 0.0;
|
else Albedo.a = 0.0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//////////////////////////////// FINALIZE
|
||||||
|
////////////////////////////////
|
||||||
|
|
||||||
|
// #ifndef ENTITIES
|
||||||
|
// if(TESTMASK.r==255) Albedo.rgb = vec3(0);
|
||||||
|
// #endif
|
||||||
|
|
||||||
// finalize
|
|
||||||
vec4 data1 = clamp(blueNoise()/255.0 + encode(viewToWorld(normal), lmtexcoord.zw),0.0,1.0);
|
vec4 data1 = clamp(blueNoise()/255.0 + encode(viewToWorld(normal), lmtexcoord.zw),0.0,1.0);
|
||||||
gl_FragData[0] = vec4(encodeVec2(data0.x,data1.x), encodeVec2(data0.y,data1.y), encodeVec2(data0.z,data1.z), encodeVec2(data1.w,data0.w));
|
gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w));
|
||||||
|
|
||||||
#ifdef WORLD
|
#ifdef WORLD
|
||||||
gl_FragData[1].a = 0.0;
|
gl_FragData[1].a = 0.0;
|
||||||
@ -453,13 +447,5 @@ void main() {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gl_FragData[4] = vec4(FlatNormals* 0.5 + 0.5,VanillaAO);
|
gl_FragData[4] = vec4(FlatNormals* 0.5 + 0.5,VanillaAO);
|
||||||
|
|
||||||
|
|
||||||
// #ifdef ENTITIES
|
|
||||||
// #ifdef WORLD
|
|
||||||
// gl_FragData[3].xyz = test_motionVectors;
|
|
||||||
// #endif
|
|
||||||
// #endif
|
|
||||||
// gl_FragData[0].rgb = vec3(0,255,0);
|
|
||||||
}
|
}
|
@ -1,17 +1,7 @@
|
|||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
#define WAVY_PLANTS
|
|
||||||
#define WAVY_STRENGTH 1.0 //[0.1 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0]
|
|
||||||
#define WAVY_SPEED 1.0 //[0.001 0.01 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1.0 1.25 1.5 2.0 3.0 4.0]
|
|
||||||
#define SEPARATE_AO
|
|
||||||
//#define POM
|
|
||||||
//#define USE_LUMINANCE_AS_HEIGHTMAP //Can generate POM on any texturepack (may look weird in some cases)
|
|
||||||
// #define RTAO // I recommend turning ambientOcclusionLevel to zero with this on. like ssao, but rt, nicer, noiser, and slower. SSAO will turn OFF when this is ON
|
|
||||||
#define indirect_effect 1 // 0 = none. 1 = SSAO. 2 = RTAO. 3 = SSGI. [0 1 2 3]
|
|
||||||
|
|
||||||
#define Variable_Penumbra_Shadows //Makes the shadows more blurry the more distant they are to objects (costs fps)
|
|
||||||
#define mob_SSS
|
|
||||||
#define misc_block_SSS
|
|
||||||
|
|
||||||
#ifndef USE_LUMINANCE_AS_HEIGHTMAP
|
#ifndef USE_LUMINANCE_AS_HEIGHTMAP
|
||||||
#ifndef MC_NORMAL_MAP
|
#ifndef MC_NORMAL_MAP
|
||||||
|
@ -10,47 +10,11 @@ varying vec3 tangent;
|
|||||||
varying vec4 tangent_other;
|
varying vec4 tangent_other;
|
||||||
varying vec3 viewVector;
|
varying vec3 viewVector;
|
||||||
varying float dist;
|
varying float dist;
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
#define CLOUDS_SHADOWS
|
|
||||||
#define VL_CLOUDS_SHADOWS // Casts shadows from clouds on VL (slow)
|
|
||||||
#define SCREENSPACE_REFLECTIONS //can be really expensive at high resolutions/render quality, especially on ice
|
|
||||||
#define SSR_STEPS 30 //[10 15 20 25 30 35 40 50 100 200 400]
|
|
||||||
#define SUN_MICROFACET_SPECULAR // If enabled will use realistic rough microfacet model, else will just reflect the sun. No performance impact.
|
|
||||||
#define USE_QUARTER_RES_DEPTH // Uses a quarter resolution depth buffer to raymarch screen space reflections, improves performance but may introduce artifacts
|
|
||||||
#define saturate(x) clamp(x,0.0,1.0)
|
|
||||||
#define Dirt_Amount 0.14 //How much dirt there is in water [0.0 0.04 0.08 0.12 0.16 0.2 0.24 0.28 0.32 0.36 0.4 0.44 0.48 0.52 0.56 0.6 0.64 0.68 0.72 0.76 0.8 0.84 0.88 0.92 0.96 1.0 1.04 1.08 1.12 1.16 1.2 1.24 1.28 1.32 1.36 1.4 1.44 1.48 1.52 1.56 1.6 1.64 1.68 1.72 1.76 1.8 1.84 1.88 1.92 1.96 2.0 ]
|
|
||||||
|
|
||||||
#define Dirt_Scatter_R 0.6 //How much dirt diffuses red [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_G 0.6 //How much dirt diffuses green [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_B 0.6 //How much dirt diffuses blue [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
|
|
||||||
#define Dirt_Absorb_R 1.65 //How much dirt absorbs red [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_G 1.85 //How much dirt absorbs green [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_B 2.05 //How much dirt absorbs blue [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
|
|
||||||
#define Water_Absorb_R 0.2629 //How much water absorbs red [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_G 0.0565 //How much water absorbs green [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_B 0.01011 //How much water absorbs blue [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Texture_MipMap_Bias -1.00 // Uses a another mip level for textures. When reduced will increase texture detail but may induce a lot of shimmering. [-5.00 -4.75 -4.50 -4.25 -4.00 -3.75 -3.50 -3.25 -3.00 -2.75 -2.50 -2.25 -2.00 -1.75 -1.50 -1.25 -1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
|
|
||||||
|
|
||||||
#define ambient_colortype 0 // 0 = temperature. 1 = rgb sliders [0 1]
|
|
||||||
#define ambient_temp 9000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 15000 50000]
|
|
||||||
|
|
||||||
#define AmbientLight_R 0.91 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define AmbientLight_G 0.86 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define AmbientLight_B 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
|
|
||||||
// #define BorderFog // aaaaaaaaaaaaaaaaaaaaaaa
|
|
||||||
|
|
||||||
#define MIN_LIGHT_AMOUNT 1.0 //[0.0 0.5 1.0 1.5 2.0 3.0 4.0 5.0]
|
|
||||||
|
|
||||||
|
|
||||||
// #define Glass_Tint // multiply the background through glass by the color of the glass for a strong tint.
|
|
||||||
|
|
||||||
// #define ambientLight_only // THIS IS A DEBUG VIEW. turn the sunlight off. DOES NOT increase performance, the shadows are still working in the background
|
|
||||||
//#define Vanilla_like_water // vanilla water texture along with shader water stuff
|
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
uniform sampler2D noisetex;
|
uniform sampler2D noisetex;
|
||||||
uniform sampler2DShadow shadow;
|
uniform sampler2DShadow shadow;
|
||||||
@ -397,8 +361,8 @@ void main() {
|
|||||||
vec3 fragC = gl_FragCoord.xyz*vec3(texelSize,1.0);
|
vec3 fragC = gl_FragCoord.xyz*vec3(texelSize,1.0);
|
||||||
vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0));
|
vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0));
|
||||||
gl_FragData[0] = texture2D(texture, lmtexcoord.xy,-5)*color;
|
gl_FragData[0] = texture2D(texture, lmtexcoord.xy,-5)*color;
|
||||||
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
// float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
||||||
gl_FragData[0].rgb = clamp((gl_FragData[0].rgb)*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
// gl_FragData[0].rgb = clamp((gl_FragData[0].rgb)*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
||||||
|
|
||||||
vec3 albedo = toLinear(gl_FragData[0].rgb);
|
vec3 albedo = toLinear(gl_FragData[0].rgb);
|
||||||
|
|
||||||
@ -460,6 +424,7 @@ void main() {
|
|||||||
diffuseSun = clamp((-15 + diffuseSun*255.0) / 240.0 ,0.0,1.0);
|
diffuseSun = clamp((-15 + diffuseSun*255.0) / 240.0 ,0.0,1.0);
|
||||||
|
|
||||||
vec3 direct = texelFetch2D(gaux1,ivec2(6,37),0).rgb/127.0;
|
vec3 direct = texelFetch2D(gaux1,ivec2(6,37),0).rgb/127.0;
|
||||||
|
|
||||||
#ifdef ambientLight_only
|
#ifdef ambientLight_only
|
||||||
direct = vec3(0);
|
direct = vec3(0);
|
||||||
#endif
|
#endif
|
||||||
@ -589,10 +554,12 @@ void main() {
|
|||||||
// reflected = vec3(0);
|
// reflected = vec3(0);
|
||||||
|
|
||||||
float alpha0 = gl_FragData[0].a;
|
float alpha0 = gl_FragData[0].a;
|
||||||
|
|
||||||
// //correct alpha channel with fresnel
|
// //correct alpha channel with fresnel
|
||||||
gl_FragData[0].a = -gl_FragData[0].a*fresnel+gl_FragData[0].a+fresnel;
|
gl_FragData[0].a = -gl_FragData[0].a*fresnel+gl_FragData[0].a+fresnel;
|
||||||
gl_FragData[0].rgb = clamp(color/gl_FragData[0].a*alpha0*(1.0-fresnel)*0.1+reflected/gl_FragData[0].a*0.1,0.0,65100.0);
|
gl_FragData[0].rgb = clamp(color/gl_FragData[0].a*alpha0*(1.0-fresnel)*0.1+reflected/gl_FragData[0].a*0.1,0.0,65100.0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (gl_FragData[0].r > 65000.) gl_FragData[0].rgba = vec4(0.);
|
if (gl_FragData[0].r > 65000.) gl_FragData[0].rgba = vec4(0.);
|
||||||
|
|
||||||
#ifdef BorderFog
|
#ifdef BorderFog
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// #version 120
|
// #version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
|
|
||||||
@ -31,7 +31,6 @@ flat varying vec3 WsunVec;
|
|||||||
uniform float sunElevation;
|
uniform float sunElevation;
|
||||||
|
|
||||||
varying vec4 tangent_other;
|
varying vec4 tangent_other;
|
||||||
#define SHADOW_MAP_BIAS 0.8
|
|
||||||
|
|
||||||
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
|
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
varying vec4 lmtexcoord;
|
varying vec4 lmtexcoord;
|
||||||
varying vec4 color;
|
varying vec4 color;
|
||||||
@ -26,35 +26,6 @@ vec3 toLinear(vec3 sRGB){
|
|||||||
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
|
||||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
|
||||||
vec3 toScreenSpace(vec3 p) {
|
|
||||||
vec4 iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw);
|
|
||||||
vec3 p3 = p * 2. - 1.;
|
|
||||||
vec4 fragposition = iProjDiag * p3.xyzz + gbufferProjectionInverse[3];
|
|
||||||
return fragposition.xyz / fragposition.w;
|
|
||||||
}
|
|
||||||
float interleaved_gradientNoise(){
|
|
||||||
vec2 coord = gl_FragCoord.xy;
|
|
||||||
float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y));
|
|
||||||
return noise;
|
|
||||||
}
|
|
||||||
|
|
||||||
float facos(float sx){
|
|
||||||
float x = clamp(abs( sx ),0.,1.);
|
|
||||||
float a = sqrt( 1. - x ) * ( -0.16882 * x + 1.56734 );
|
|
||||||
return sx > 0. ? a : 3.14159265359 - a;
|
|
||||||
}
|
|
||||||
#define SHADOW_MAP_BIAS 0.8
|
|
||||||
float calcDistort(vec2 worlpos){
|
|
||||||
|
|
||||||
vec2 pos = worlpos * 1.165;
|
|
||||||
vec2 posSQ = pos*pos;
|
|
||||||
|
|
||||||
float distb = pow(posSQ.x*posSQ.x*posSQ.x + posSQ.y*posSQ.y*posSQ.y, 1.0 / 6.0);
|
|
||||||
return 1.08695652/((1.0 - SHADOW_MAP_BIAS) + distb * SHADOW_MAP_BIAS);
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
@ -72,10 +43,6 @@ void main() {
|
|||||||
|
|
||||||
vec3 col = albedo*exp(-exposure*3.);
|
vec3 col = albedo*exp(-exposure*3.);
|
||||||
|
|
||||||
|
|
||||||
gl_FragData[0].rgb = col*color.a;
|
gl_FragData[0].rgb = col*color.a;
|
||||||
gl_FragData[0].a = gl_FragData[0].a*0.1;
|
gl_FragData[0].a = gl_FragData[0].a*0.1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
#include "lib/settings.glsl"
|
||||||
#include "/lib/res_params.glsl"
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,66 +1,19 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
#include "lib/settings.glsl"
|
||||||
|
|
||||||
varying vec4 lmtexcoord;
|
varying vec4 lmtexcoord;
|
||||||
varying vec4 color;
|
varying vec4 color;
|
||||||
varying vec4 normalMat;
|
|
||||||
|
|
||||||
#define SHADOW_MAP_BIAS 0.8
|
|
||||||
|
|
||||||
uniform sampler2D texture;
|
uniform sampler2D texture;
|
||||||
uniform sampler2D gaux1;
|
uniform sampler2D gaux1;
|
||||||
|
|
||||||
uniform vec4 lightCol;
|
|
||||||
uniform vec3 sunVec;
|
|
||||||
uniform vec3 upVec;
|
|
||||||
|
|
||||||
uniform vec2 texelSize;
|
|
||||||
uniform float skyIntensityNight;
|
|
||||||
uniform float skyIntensity;
|
|
||||||
uniform float sunElevation;
|
|
||||||
uniform float rainStrength;
|
|
||||||
uniform mat4 gbufferProjectionInverse;
|
|
||||||
uniform mat4 gbufferModelViewInverse;
|
|
||||||
uniform mat4 shadowModelView;
|
|
||||||
uniform mat4 shadowProjection;
|
|
||||||
|
|
||||||
//faster and actually more precise than pow 2.2
|
//faster and actually more precise than pow 2.2
|
||||||
vec3 toLinear(vec3 sRGB){
|
vec3 toLinear(vec3 sRGB){
|
||||||
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
|
||||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
|
||||||
vec3 toScreenSpace(vec3 p) {
|
|
||||||
vec4 iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw);
|
|
||||||
vec3 p3 = p * 2. - 1.;
|
|
||||||
vec4 fragposition = iProjDiag * p3.xyzz + gbufferProjectionInverse[3];
|
|
||||||
return fragposition.xyz / fragposition.w;
|
|
||||||
}
|
|
||||||
float interleaved_gradientNoise(){
|
|
||||||
vec2 coord = gl_FragCoord.xy;
|
|
||||||
float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y));
|
|
||||||
return noise;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
float facos(float sx){
|
|
||||||
float x = clamp(abs( sx ),0.,1.);
|
|
||||||
float a = sqrt( 1. - x ) * ( -0.16882 * x + 1.56734 );
|
|
||||||
return sx > 0. ? a : 3.14159265359 - a;
|
|
||||||
}
|
|
||||||
#define SHADOW_MAP_BIAS 0.8
|
|
||||||
float calcDistort(vec2 worlpos){
|
|
||||||
|
|
||||||
vec2 pos = worlpos * 1.165;
|
|
||||||
vec2 posSQ = pos*pos;
|
|
||||||
|
|
||||||
float distb = pow(posSQ.x*posSQ.x*posSQ.x + posSQ.y*posSQ.y*posSQ.y, 1.0 / 6.0);
|
|
||||||
return 1.08695652/((1.0 - SHADOW_MAP_BIAS) + distb * SHADOW_MAP_BIAS);
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
@ -69,22 +22,14 @@ float calcDistort(vec2 worlpos){
|
|||||||
/* DRAWBUFFERS:2 */
|
/* DRAWBUFFERS:2 */
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
|
vec4 Albedo = texture2D(texture, lmtexcoord.xy)*color;
|
||||||
|
Albedo.a = 1.0;
|
||||||
|
|
||||||
gl_FragData[0] = texture2D(texture, lmtexcoord.xy)*color;
|
float exposure = texelFetch2D(gaux1,ivec2(10,37),0).r;
|
||||||
gl_FragData[0].a = 1.0;
|
Albedo.rgb *= 25.0 ;
|
||||||
|
Albedo.rgb *= clamp(0.5-exposure,0.05,1.0);
|
||||||
vec3 albedo = toLinear(gl_FragData[0].rgb);
|
|
||||||
|
|
||||||
float torch_lightmap = lmtexcoord.z;
|
|
||||||
float exposure = texelFetch2D(gaux1,ivec2(10,37),0).r;
|
|
||||||
vec3 diffuseLight = torch_lightmap*vec3(20.,30.,50.)*2./10. ;
|
|
||||||
|
|
||||||
vec3 color = diffuseLight*albedo/exposure*5.0;
|
|
||||||
|
|
||||||
|
|
||||||
gl_FragData[0].rgb = clamp(color*0.01,0,1);
|
gl_FragData[0] = Albedo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,553 +1,4 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
|
||||||
|
|
||||||
varying vec4 lmtexcoord;
|
// #define WORLD
|
||||||
varying vec4 color;
|
#include "gbuffers_all_translucent.fsh"
|
||||||
varying vec4 normalMat;
|
|
||||||
varying vec3 binormal;
|
|
||||||
uniform sampler2D normals;
|
|
||||||
varying vec3 tangent;
|
|
||||||
varying vec4 tangent_other;
|
|
||||||
varying vec3 viewVector;
|
|
||||||
varying float dist;
|
|
||||||
#include "/lib/res_params.glsl"
|
|
||||||
|
|
||||||
#define CLOUDS_SHADOWS
|
|
||||||
#define VL_CLOUDS_SHADOWS // Casts shadows from clouds on VL (slow)
|
|
||||||
#define SCREENSPACE_REFLECTIONS //can be really expensive at high resolutions/render quality, especially on ice
|
|
||||||
#define SSR_STEPS 30 //[10 15 20 25 30 35 40 50 100 200 400]
|
|
||||||
#define SUN_MICROFACET_SPECULAR // If enabled will use realistic rough microfacet model, else will just reflect the sun. No performance impact.
|
|
||||||
#define USE_QUARTER_RES_DEPTH // Uses a quarter resolution depth buffer to raymarch screen space reflections, improves performance but may introduce artifacts
|
|
||||||
#define saturate(x) clamp(x,0.0,1.0)
|
|
||||||
#define Dirt_Amount 0.14 //How much dirt there is in water [0.0 0.04 0.08 0.12 0.16 0.2 0.24 0.28 0.32 0.36 0.4 0.44 0.48 0.52 0.56 0.6 0.64 0.68 0.72 0.76 0.8 0.84 0.88 0.92 0.96 1.0 1.04 1.08 1.12 1.16 1.2 1.24 1.28 1.32 1.36 1.4 1.44 1.48 1.52 1.56 1.6 1.64 1.68 1.72 1.76 1.8 1.84 1.88 1.92 1.96 2.0 ]
|
|
||||||
|
|
||||||
#define Dirt_Scatter_R 0.6 //How much dirt diffuses red [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_G 0.6 //How much dirt diffuses green [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_B 0.6 //How much dirt diffuses blue [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
|
|
||||||
#define Dirt_Absorb_R 1.65 //How much dirt absorbs red [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_G 1.85 //How much dirt absorbs green [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_B 2.05 //How much dirt absorbs blue [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
|
|
||||||
#define Water_Absorb_R 0.2629 //How much water absorbs red [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_G 0.0565 //How much water absorbs green [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_B 0.01011 //How much water absorbs blue [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Texture_MipMap_Bias -1.00 // Uses a another mip level for textures. When reduced will increase texture detail but may induce a lot of shimmering. [-5.00 -4.75 -4.50 -4.25 -4.00 -3.75 -3.50 -3.25 -3.00 -2.75 -2.50 -2.25 -2.00 -1.75 -1.50 -1.25 -1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
|
|
||||||
|
|
||||||
#define ambient_colortype 0 // Toggle which method you want to change the color of ambient light with. [0 1]
|
|
||||||
#define ambient_temp 9000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 15000 50000]
|
|
||||||
|
|
||||||
#define AmbientLight_R 0.91 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define AmbientLight_G 0.86 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
#define AmbientLight_B 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MIN_LIGHT_AMOUNT 1.0 //[0.0 0.5 1.0 1.5 2.0 3.0 4.0 5.0]
|
|
||||||
//#define Vanilla_like_water // vanilla water texture along with shader water stuff
|
|
||||||
uniform sampler2D texture;
|
|
||||||
uniform sampler2D noisetex;
|
|
||||||
uniform sampler2DShadow shadow;
|
|
||||||
uniform sampler2D gaux2;
|
|
||||||
uniform sampler2D gaux1;
|
|
||||||
uniform sampler2D depthtex1;
|
|
||||||
|
|
||||||
uniform vec4 lightCol;
|
|
||||||
uniform float nightVision;
|
|
||||||
|
|
||||||
uniform vec3 sunVec;
|
|
||||||
uniform float frameTimeCounter;
|
|
||||||
uniform float lightSign;
|
|
||||||
uniform float near;
|
|
||||||
uniform float far;
|
|
||||||
uniform float moonIntensity;
|
|
||||||
uniform float sunIntensity;
|
|
||||||
uniform vec3 sunColor;
|
|
||||||
uniform vec3 nsunColor;
|
|
||||||
uniform vec3 upVec;
|
|
||||||
uniform float sunElevation;
|
|
||||||
uniform float fogAmount;
|
|
||||||
uniform vec2 texelSize;
|
|
||||||
uniform float rainStrength;
|
|
||||||
uniform float skyIntensityNight;
|
|
||||||
uniform float skyIntensity;
|
|
||||||
flat varying vec3 WsunVec;
|
|
||||||
uniform mat4 gbufferPreviousModelView;
|
|
||||||
uniform vec3 previousCameraPosition;
|
|
||||||
uniform int framemod8;
|
|
||||||
uniform sampler2D specular;
|
|
||||||
uniform int frameCounter;
|
|
||||||
uniform int isEyeInWater;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "lib/Shadow_Params.glsl"
|
|
||||||
#include "lib/color_transforms.glsl"
|
|
||||||
#include "lib/projections.glsl"
|
|
||||||
#include "lib/sky_gradient.glsl"
|
|
||||||
#include "lib/waterBump.glsl"
|
|
||||||
#include "lib/clouds.glsl"
|
|
||||||
#include "lib/stars.glsl"
|
|
||||||
#include "lib/volumetricClouds.glsl"
|
|
||||||
|
|
||||||
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|
||||||
vec2(-1.,3.)/8.,
|
|
||||||
vec2(5.0,1.)/8.,
|
|
||||||
vec2(-3,-5.)/8.,
|
|
||||||
vec2(-5.,5.)/8.,
|
|
||||||
vec2(-7.,-1.)/8.,
|
|
||||||
vec2(3,7.)/8.,
|
|
||||||
vec2(7.,-7.)/8.);
|
|
||||||
float interleaved_gradientNoise(float temporal){
|
|
||||||
vec2 coord = gl_FragCoord.xy;
|
|
||||||
float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y)+temporal);
|
|
||||||
return noise;
|
|
||||||
}
|
|
||||||
vec3 srgbToLinear2(vec3 srgb){
|
|
||||||
return mix(
|
|
||||||
srgb / 12.92,
|
|
||||||
pow(.947867 * srgb + .0521327, vec3(2.4) ),
|
|
||||||
step( .04045, srgb )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
vec3 blackbody2(float Temp)
|
|
||||||
{
|
|
||||||
float t = pow(Temp, -1.5);
|
|
||||||
float lt = log(Temp);
|
|
||||||
|
|
||||||
vec3 col = vec3(0.0);
|
|
||||||
col.x = 220000.0 * t + 0.58039215686;
|
|
||||||
col.y = 0.39231372549 * lt - 2.44549019608;
|
|
||||||
col.y = Temp > 6500. ? 138039.215686 * t + 0.72156862745 : col.y;
|
|
||||||
col.z = 0.76078431372 * lt - 5.68078431373;
|
|
||||||
col = clamp(col,0.0,1.0);
|
|
||||||
col = Temp < 1000. ? col * Temp * 0.001 : col;
|
|
||||||
|
|
||||||
return srgbToLinear2(col);
|
|
||||||
}
|
|
||||||
|
|
||||||
float blueNoise(){
|
|
||||||
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 * frameCounter);
|
|
||||||
}
|
|
||||||
float invLinZ (float lindepth){
|
|
||||||
return -((2.0*near/lindepth)-far-near)/(far-near);
|
|
||||||
}
|
|
||||||
float ld(float dist) {
|
|
||||||
return (2.0 * near) / (far + near - dist * (far - near));
|
|
||||||
}
|
|
||||||
vec3 nvec3(vec4 pos){
|
|
||||||
return pos.xyz/pos.w;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec4 nvec4(vec3 pos){
|
|
||||||
return vec4(pos.xyz, 1.0);
|
|
||||||
}
|
|
||||||
vec3 rayTrace(vec3 dir,vec3 position,float dither, float fresnel, bool inwater){
|
|
||||||
|
|
||||||
float quality = mix(15,SSR_STEPS,fresnel);
|
|
||||||
vec3 clipPosition = toClipSpace3(position);
|
|
||||||
float rayLength = ((position.z + dir.z * far*sqrt(3.)) > -near) ?
|
|
||||||
(-near -position.z) / dir.z : far*sqrt(3.);
|
|
||||||
vec3 direction = normalize(toClipSpace3(position+dir*rayLength)-clipPosition); //convert to clip space
|
|
||||||
direction.xy = normalize(direction.xy);
|
|
||||||
|
|
||||||
//get at which length the ray intersects with the edge of the screen
|
|
||||||
vec3 maxLengths = (step(0.,direction)-clipPosition) / direction;
|
|
||||||
float mult = min(min(maxLengths.x,maxLengths.y),maxLengths.z);
|
|
||||||
|
|
||||||
|
|
||||||
vec3 stepv = direction * mult / quality*vec3(RENDER_SCALE,1.0);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3 spos = clipPosition*vec3(RENDER_SCALE,1.0) + stepv*dither;
|
|
||||||
float minZ = clipPosition.z;
|
|
||||||
float maxZ = spos.z+stepv.z*0.5;
|
|
||||||
|
|
||||||
spos.xy += offsets[framemod8]*texelSize*0.5/RENDER_SCALE;
|
|
||||||
|
|
||||||
for (int i = 0; i <= int(quality); i++) {
|
|
||||||
#ifdef USE_QUARTER_RES_DEPTH
|
|
||||||
// decode depth buffer
|
|
||||||
float sp = sqrt(texelFetch2D(gaux1,ivec2(spos.xy/texelSize/4),0).w/65000.0);
|
|
||||||
sp = invLinZ(sp);
|
|
||||||
if(sp <= max(maxZ,minZ) && sp >= min(maxZ,minZ)){
|
|
||||||
return vec3(spos.xy/RENDER_SCALE,sp);
|
|
||||||
}
|
|
||||||
spos += stepv;
|
|
||||||
#else
|
|
||||||
float sp = texelFetch2D(depthtex1,ivec2(spos.xy/texelSize),0).r;
|
|
||||||
if(sp <= max(maxZ,minZ) && sp >= min(maxZ,minZ)){
|
|
||||||
return vec3(spos.xy/RENDER_SCALE,sp);
|
|
||||||
}
|
|
||||||
spos += stepv;
|
|
||||||
#endif
|
|
||||||
//small bias
|
|
||||||
minZ = maxZ-0.00004/ld(spos.z);
|
|
||||||
if(inwater) minZ = maxZ-0.0004/ld(spos.z);
|
|
||||||
maxZ += stepv.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
return vec3(1.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
float facos(float sx){
|
|
||||||
float x = clamp(abs( sx ),0.,1.);
|
|
||||||
float a = sqrt( 1. - x ) * ( -0.16882 * x + 1.56734 );
|
|
||||||
return sx > 0. ? a : pi - a;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float bayer2(vec2 a){
|
|
||||||
a = floor(a);
|
|
||||||
return fract(dot(a,vec2(0.5,a.y*0.75)));
|
|
||||||
}
|
|
||||||
|
|
||||||
float cdist(vec2 coord) {
|
|
||||||
return max(abs(coord.s-0.5),abs(coord.t-0.5))*2.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define PW_DEPTH 1.0 //[0.5 1.0 1.5 2.0 2.5 3.0]
|
|
||||||
#define PW_POINTS 1 //[2 4 6 8 16 32]
|
|
||||||
#define bayer4(a) (bayer2( .5*(a))*.25+bayer2(a))
|
|
||||||
#define bayer8(a) (bayer4( .5*(a))*.25+bayer2(a))
|
|
||||||
#define bayer16(a) (bayer8( .5*(a))*.25+bayer2(a))
|
|
||||||
#define bayer32(a) (bayer16(.5*(a))*.25+bayer2(a))
|
|
||||||
#define bayer64(a) (bayer32(.5*(a))*.25+bayer2(a))
|
|
||||||
#define bayer128(a) fract(bayer64(.5*(a))*.25+bayer2(a))
|
|
||||||
vec3 getParallaxDisplacement(vec3 posxz, float iswater,float bumpmult,vec3 viewVec) {
|
|
||||||
float waveZ = mix(20.0,0.25,iswater);
|
|
||||||
float waveM = mix(0.0,4.0,iswater);
|
|
||||||
|
|
||||||
vec3 parallaxPos = posxz;
|
|
||||||
vec2 vec = viewVector.xy * (1.0 / float(PW_POINTS)) * 22.0 * PW_DEPTH;
|
|
||||||
float waterHeight = getWaterHeightmap(posxz.xz, waveM, waveZ, iswater) ;
|
|
||||||
|
|
||||||
parallaxPos.xz += waterHeight * vec;
|
|
||||||
|
|
||||||
return parallaxPos;
|
|
||||||
|
|
||||||
}
|
|
||||||
vec2 tapLocation(int sampleNumber,int nb, float nbRot,float jitter,float distort)
|
|
||||||
{
|
|
||||||
float alpha = (sampleNumber+jitter)/nb;
|
|
||||||
float angle = jitter*6.28 + alpha * nbRot * 6.28;
|
|
||||||
|
|
||||||
float sin_v, cos_v;
|
|
||||||
|
|
||||||
sin_v = sin(angle);
|
|
||||||
cos_v = cos(angle);
|
|
||||||
|
|
||||||
return vec2(cos_v, sin_v)*sqrt(alpha);
|
|
||||||
}
|
|
||||||
//Low discrepancy 2D sequence, integration error is as low as sobol but easier to compute : http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/
|
|
||||||
vec2 R2_samples(int n){
|
|
||||||
vec2 alpha = vec2(0.75487765, 0.56984026);
|
|
||||||
return fract(alpha * n);
|
|
||||||
}
|
|
||||||
vec4 hash44(vec4 p4)
|
|
||||||
{
|
|
||||||
p4 = fract(p4 * vec4(.1031, .1030, .0973, .1099));
|
|
||||||
p4 += dot(p4, p4.wzxy+33.33);
|
|
||||||
return fract((p4.xxyz+p4.yzzw)*p4.zywx);
|
|
||||||
}
|
|
||||||
vec3 TangentToWorld(vec3 N, vec3 H)
|
|
||||||
{
|
|
||||||
vec3 UpVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
||||||
vec3 T = normalize(cross(UpVector, N));
|
|
||||||
vec3 B = cross(N, T);
|
|
||||||
|
|
||||||
return vec3((T * H.x) + (B * H.y) + (N * H.z));
|
|
||||||
}
|
|
||||||
float GGX (vec3 n, vec3 v, vec3 l, float r, float F0) {
|
|
||||||
r*=r;r*=r;
|
|
||||||
|
|
||||||
vec3 h = l + v;
|
|
||||||
float hn = inversesqrt(dot(h, h));
|
|
||||||
|
|
||||||
float dotLH = clamp(dot(h,l)*hn,0.,1.);
|
|
||||||
float dotNH = clamp(dot(h,n)*hn,0.,1.);
|
|
||||||
float dotNL = clamp(dot(n,l),0.,1.);
|
|
||||||
float dotNHsq = dotNH*dotNH;
|
|
||||||
|
|
||||||
float denom = dotNHsq * r - dotNHsq + 1.;
|
|
||||||
float D = r / (3.141592653589793 * denom * denom);
|
|
||||||
float F = F0 + (1. - F0) * exp2((-5.55473*dotLH-6.98316)*dotLH);
|
|
||||||
float k2 = .25 * r;
|
|
||||||
|
|
||||||
return dotNL * D * F / (dotLH*dotLH*(1.0-k2)+k2);
|
|
||||||
}
|
|
||||||
float square(float x){
|
|
||||||
return x*x;
|
|
||||||
}
|
|
||||||
|
|
||||||
float gSimple(float dp, float roughness){
|
|
||||||
float k = roughness + 1;
|
|
||||||
k *= k/8.0;
|
|
||||||
return dp / (dp * (1.0-k) + k);
|
|
||||||
}
|
|
||||||
vec3 GGX2(vec3 n, vec3 v, vec3 l, float r, vec3 F0) {
|
|
||||||
float alpha = square(r);
|
|
||||||
|
|
||||||
vec3 h = normalize(l + v);
|
|
||||||
|
|
||||||
float dotLH = clamp(dot(h,l),0.,1.);
|
|
||||||
float dotNH = clamp(dot(h,n),0.,1.);
|
|
||||||
float dotNL = clamp(dot(n,l),0.,1.);
|
|
||||||
float dotNV = clamp(dot(n,v),0.,1.);
|
|
||||||
float dotVH = clamp(dot(h,v),0.,1.);
|
|
||||||
|
|
||||||
|
|
||||||
float D = alpha / (3.141592653589793*square(square(dotNH) * (alpha - 1.0) + 1.0));
|
|
||||||
float G = gSimple(dotNV, r) * gSimple(dotNL, r);
|
|
||||||
vec3 F = F0 + (1. - F0) * exp2((-5.55473*dotVH-6.98316)*dotVH);
|
|
||||||
|
|
||||||
return dotNL * F * (G * D / (4 * dotNV * dotNL + 1e-7));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 applyBump(mat3 tbnMatrix, vec3 bump){
|
|
||||||
float bumpmult = 1.0;
|
|
||||||
bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult);
|
|
||||||
return normalize(bump*tbnMatrix);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define fsign(a) (clamp((a)*1e35,0.,1.)*2.-1.)
|
|
||||||
float triangularize(float dither)
|
|
||||||
{
|
|
||||||
float center = dither*2.0-1.0;
|
|
||||||
dither = center*inversesqrt(abs(center));
|
|
||||||
return clamp(dither-fsign(center),0.0,1.0);
|
|
||||||
}
|
|
||||||
vec3 fp10Dither(vec3 color,float dither){
|
|
||||||
const vec3 mantissaBits = vec3(6.,6.,5.);
|
|
||||||
vec3 exponent = floor(log2(color));
|
|
||||||
return color + dither*exp2(-mantissaBits)*exp2(exponent);
|
|
||||||
}
|
|
||||||
float R2_dither(){
|
|
||||||
vec2 alpha = vec2(0.75487765, 0.56984026);
|
|
||||||
return fract(alpha.x * gl_FragCoord.x + alpha.y * gl_FragCoord.y + 1.0/1.6180339887 * frameCounter) ;
|
|
||||||
}
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
/* DRAWBUFFERS:271 */
|
|
||||||
void main() {
|
|
||||||
if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize.y < RENDER_SCALE.y ) {
|
|
||||||
|
|
||||||
vec2 specularstuff = texture2D(specular, lmtexcoord.xy, Texture_MipMap_Bias).rg;
|
|
||||||
|
|
||||||
// color
|
|
||||||
vec2 tempOffset = offsets[framemod8];
|
|
||||||
float iswater = normalMat.w;
|
|
||||||
|
|
||||||
vec3 fragC = gl_FragCoord.xyz*vec3(texelSize,1.0);
|
|
||||||
vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0));
|
|
||||||
|
|
||||||
vec3 np3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz + cameraPosition;
|
|
||||||
|
|
||||||
gl_FragData[0] = texture2D(texture, lmtexcoord.xy)*color;
|
|
||||||
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
|
||||||
gl_FragData[0].rgb = clamp((gl_FragData[0].rgb)*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
|
||||||
vec3 albedo = toLinear(gl_FragData[0].rgb);
|
|
||||||
|
|
||||||
#ifndef Vanilla_like_water
|
|
||||||
if (iswater > 0.4) {
|
|
||||||
albedo = vec3(0.42,0.6,0.7);
|
|
||||||
gl_FragData[0] = vec4(0.42,0.6,0.7,0.7);
|
|
||||||
}
|
|
||||||
if (iswater > 0.9) {
|
|
||||||
gl_FragData[0] = vec4(0.0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// normals
|
|
||||||
vec3 normal = normalMat.xyz;
|
|
||||||
|
|
||||||
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
|
||||||
mat3 tbnMatrix = mat3(tangent.x, binormal.x, normal.x,
|
|
||||||
tangent.y, binormal.y, normal.y,
|
|
||||||
tangent.z, binormal.z, normal.z);
|
|
||||||
if (iswater > 0.4){
|
|
||||||
float bumpmult = 1.;
|
|
||||||
if (iswater > 0.9) bumpmult = 1.;
|
|
||||||
float parallaxMult = bumpmult;
|
|
||||||
|
|
||||||
vec3 posxz = p3+cameraPosition;
|
|
||||||
posxz.xz-=posxz.y;
|
|
||||||
|
|
||||||
if (iswater < 0.9) posxz.xz *= 3.0;
|
|
||||||
|
|
||||||
vec3 bump;
|
|
||||||
posxz.xyz = getParallaxDisplacement(posxz,iswater,bumpmult,normalize(tbnMatrix*fragpos));
|
|
||||||
bump = normalize(getWaveHeight(posxz.xz,iswater));
|
|
||||||
bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult);
|
|
||||||
normal = normalize(bump * tbnMatrix);
|
|
||||||
}else {
|
|
||||||
vec3 normalTex = texture2D(normals, lmtexcoord.xy, Texture_MipMap_Bias).rgb;
|
|
||||||
|
|
||||||
normalTex.xy = normalTex.xy*2.0-1.0;
|
|
||||||
normalTex.z = clamp(sqrt(1.0 - dot(normalTex.xy, normalTex.xy)),0.0,1.0);
|
|
||||||
normal = applyBump(tbnMatrix,normalTex);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Direct light
|
|
||||||
|
|
||||||
float NdotL = lightSign*dot(normal,sunVec);
|
|
||||||
float NdotU = dot(upVec,normal);
|
|
||||||
float diffuseSun = clamp(NdotL,0.0f,1.0f);
|
|
||||||
|
|
||||||
vec3 direct = texelFetch2D(gaux1,ivec2(6,37),0).rgb/3.1415;
|
|
||||||
vec3 directlightcol = direct;
|
|
||||||
float shading = 1.0;
|
|
||||||
float cloudShadow = 1.0;
|
|
||||||
//compute shadows only if not backface
|
|
||||||
if(diffuseSun > 0.001) {
|
|
||||||
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
|
||||||
vec3 projectedShadowPosition = mat3(shadowModelView) * p3 + shadowModelView[3].xyz;
|
|
||||||
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
|
||||||
|
|
||||||
//apply distortion
|
|
||||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
|
||||||
projectedShadowPosition.xy *= distortFactor;
|
|
||||||
//do shadows only if on shadow map
|
|
||||||
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution){
|
|
||||||
const float threshMul = max(2048.0/shadowMapResolution*shadowDistance/128.0,0.95);
|
|
||||||
float distortThresh = (sqrt(1.0-diffuseSun*diffuseSun)/diffuseSun+0.7)/distortFactor;
|
|
||||||
float diffthresh = distortThresh/6000.0*threshMul;
|
|
||||||
|
|
||||||
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5);
|
|
||||||
|
|
||||||
shading = 0.0;
|
|
||||||
float noise = blueNoise();
|
|
||||||
float rdMul = 4.0/shadowMapResolution;
|
|
||||||
for(int i = 0; i < 9; i++){
|
|
||||||
vec2 offsetS = tapLocation(i,9, 1.618,noise,0.0);
|
|
||||||
|
|
||||||
float weight = 1.0+(i+noise)*rdMul/9.0*shadowMapResolution;
|
|
||||||
shading += shadow2D(shadow,vec3(projectedShadowPosition + vec3(rdMul*offsetS,-diffthresh*weight))).x/9.0;
|
|
||||||
}
|
|
||||||
direct *= shading;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
vec3 campos = (p3 + cameraPosition)-319 ;
|
|
||||||
#ifdef VOLUMETRIC_CLOUDS
|
|
||||||
#ifdef CLOUDS_SHADOWS
|
|
||||||
// get cloud position
|
|
||||||
vec3 cloudPos = campos*Cloud_Size + WsunVec/abs(WsunVec.y) * (2250 - campos.y*Cloud_Size);
|
|
||||||
// get the cloud density and apply it
|
|
||||||
cloudShadow = getCloudDensity(cloudPos, 1);
|
|
||||||
cloudShadow = exp(-cloudShadow*sqrt(cloudDensity)*25);
|
|
||||||
|
|
||||||
// make these turn to zero when occluded by the cloud shadow
|
|
||||||
direct *= cloudShadow;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#if ambient_colortype == 0
|
|
||||||
vec3 colortype = blackbody2(ambient_temp);
|
|
||||||
#else
|
|
||||||
vec3 colortype = vec3(AmbientLight_R,AmbientLight_G,AmbientLight_B) ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vec3 ambientLight = texture2D(gaux1,(lmtexcoord.zw*15.+0.5)*texelSize).rgb * colortype;
|
|
||||||
|
|
||||||
directlightcol *= (iswater > 0.9 ? 0.2: 1.0)*diffuseSun*lmtexcoord.w;
|
|
||||||
|
|
||||||
|
|
||||||
vec3 diffuseLight = (directlightcol + ambientLight)/5;
|
|
||||||
vec3 color = diffuseLight * albedo * 8./150./3.0 ;
|
|
||||||
|
|
||||||
if (iswater > 0.0){
|
|
||||||
|
|
||||||
float roughness = iswater > 0.4 ? 0.0 : specularstuff.r > 0.0 ? pow(1.0-specularstuff.r,2.0) : 0.05*(1.0-gl_FragData[0].a );
|
|
||||||
float f0 = iswater > 0.4 || specularstuff.g > 0.9 ? 0.02 : specularstuff.g;
|
|
||||||
float F0 = f0;
|
|
||||||
|
|
||||||
// float f0 = iswater > 0.1 ? 0.02 : 0.05*(1.0-gl_FragData[0].a);
|
|
||||||
// float roughness = 0.02;
|
|
||||||
// float F0 = f0;
|
|
||||||
// roughness = 1.;
|
|
||||||
vec3 reflectedVector = reflect(normalize(fragpos), normal);
|
|
||||||
|
|
||||||
|
|
||||||
float normalDotEye = dot(normal, normalize(fragpos));
|
|
||||||
float fresnel = pow(clamp(1.0 + normalDotEye,0.0,1.0), 5.0);
|
|
||||||
|
|
||||||
// snells window looking thing
|
|
||||||
if(isEyeInWater == 1 && iswater > 0.99) fresnel = clamp(pow(1.66 + normalDotEye,25),0.02,1.0);
|
|
||||||
|
|
||||||
fresnel = mix(F0,1.0,fresnel);
|
|
||||||
|
|
||||||
// adjust the amount of sunlight based on f0. max f0 should
|
|
||||||
// direct = mix(direct, (ambientLight*2.5) * albedo * 8./150./3.0 , mix(1.0-roughness, F0, 0.5));
|
|
||||||
|
|
||||||
vec3 wrefl = mat3(gbufferModelViewInverse)*reflectedVector;
|
|
||||||
vec3 sky_c = mix(skyCloudsFromTex(wrefl,gaux1).rgb,texture2D(gaux1,(lmtexcoord.zw*15.+0.5)*texelSize).rgb*0.5,isEyeInWater);
|
|
||||||
sky_c.rgb *= lmtexcoord.w*lmtexcoord.w*255*255/240./240./150.*8./3.;
|
|
||||||
|
|
||||||
vec4 reflection = vec4(sky_c.rgb,0.);
|
|
||||||
#ifdef SCREENSPACE_REFLECTIONS
|
|
||||||
vec3 rtPos = rayTrace(reflectedVector,fragpos.xyz, blueNoise(), fresnel, isEyeInWater == 0);
|
|
||||||
if (rtPos.z <1.){
|
|
||||||
vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rtPos) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
|
||||||
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
|
||||||
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
|
||||||
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0) {
|
|
||||||
reflection.a = 1.0;
|
|
||||||
reflection.rgb = texture2D(gaux2,previousPosition.xy).rgb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if(isEyeInWater ==1 ) sky_c.rgb = color.rgb*lmtexcoord.y;
|
|
||||||
|
|
||||||
reflection.rgb = mix(sky_c.rgb, reflection.rgb, reflection.a);
|
|
||||||
|
|
||||||
#ifdef SUN_MICROFACET_SPECULAR
|
|
||||||
// vec3 sunSpec = GGX(normal,-normalize(fragpos), lightSign*sunVec, rainStrength*0.2+roughness+0.05+clamp(-lightSign*0.15,0.0,1.0), f0) * texelFetch2D(gaux1,ivec2(6,37),0).rgb*8./3./150.0/3.1415 * (1.0-rainStrength*0.9);
|
|
||||||
vec3 sunSpec = GGX2(normal, -normalize(fragpos), lightSign*sunVec, roughness+0.005, vec3(f0)) ;
|
|
||||||
#else
|
|
||||||
vec3 sunSpec = drawSun(dot(lightSign*sunVec,reflectedVector), 0.0,texelFetch2D(gaux1,ivec2(6,37),0).rgb,vec3(0.0))*8./3./150.0*fresnel/3.1415 * (1.0-rainStrength*0.9);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sunSpec *= max(cloudShadow-0.5,0.0);
|
|
||||||
// direct = mix(direct, direct*sunSpec, sunSpec);
|
|
||||||
vec3 reflected = reflection.rgb*fresnel + shading*sunSpec*directlightcol;
|
|
||||||
float alpha0 = gl_FragData[0].a;
|
|
||||||
|
|
||||||
vec4 nice_colors = mix(gl_FragData[0], vec4(gl_FragData[0].rgb*2 - 0.5, 1.0-gl_FragData[0].a), 1.0-gl_FragData[0].a) ;
|
|
||||||
|
|
||||||
nice_colors.rgb *= (ambientLight + shading*diffuseSun*directlightcol * max(sunSpec,0.15))/25.;
|
|
||||||
gl_FragData[0].a = -gl_FragData[0].a*fresnel+gl_FragData[0].a+fresnel; // correct alpha channel with fresnel
|
|
||||||
gl_FragData[0].rgb = clamp(nice_colors.rgb/gl_FragData[0].a*alpha0*(1.0-fresnel)*0.1+reflected/gl_FragData[0].a*0.1,0.0,65100.0);
|
|
||||||
|
|
||||||
// if(gl_FragData[0].a > 0) gl_FragData[0] = max(nice_colors, 0.0);
|
|
||||||
|
|
||||||
}else
|
|
||||||
gl_FragData[0].rgb = color*.1;
|
|
||||||
|
|
||||||
gl_FragData[1] = vec4(albedo, iswater);
|
|
||||||
// vec4 nice_colors = vec4(gl_FragData[0].rgb, gl_FragData[0].a*gl_FragData[0].a) + (vec4(gl_FragData[0].rgb -0.5 , 1 - gl_FragData[0].a)*(1.0-gl_FragData[0].a) ) ;
|
|
||||||
// gl_FragData[0].rgb = color;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// float z = texture2D(depthtex0,texcoord).x;
|
|
||||||
// vec3 fragpos = toScreenSpace(vec3(texcoord,z));
|
|
||||||
// gl_FragData[0].rgb *= vec3(1- clamp( pow( length(fragpos)/far, 1), 0, 1)) ;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,111 +1,4 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
|
||||||
|
|
||||||
#include "/lib/res_params.glsl"
|
// #define WORLD
|
||||||
|
#include "gbuffers_all_translucent.vsh"
|
||||||
|
|
||||||
/*
|
|
||||||
!! DO NOT REMOVE !!
|
|
||||||
This code is from Chocapic13' shaders
|
|
||||||
Read the terms of modification and sharing before changing something below please !
|
|
||||||
!! DO NOT REMOVE !!
|
|
||||||
*/
|
|
||||||
|
|
||||||
varying vec4 lmtexcoord;
|
|
||||||
varying vec4 color;
|
|
||||||
varying vec4 normalMat;
|
|
||||||
varying vec3 binormal;
|
|
||||||
varying vec3 tangent;
|
|
||||||
varying float dist;
|
|
||||||
uniform mat4 gbufferModelViewInverse;
|
|
||||||
varying vec3 viewVector;
|
|
||||||
attribute vec4 at_tangent;
|
|
||||||
attribute vec4 mc_Entity;
|
|
||||||
|
|
||||||
uniform sampler2D colortex4;
|
|
||||||
uniform vec3 sunPosition;
|
|
||||||
flat varying vec3 WsunVec;
|
|
||||||
uniform float sunElevation;
|
|
||||||
|
|
||||||
varying vec4 tangent_other;
|
|
||||||
#define SHADOW_MAP_BIAS 0.8
|
|
||||||
|
|
||||||
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uniform vec2 texelSize;
|
|
||||||
uniform int framemod8;
|
|
||||||
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|
||||||
vec2(-1.,3.)/8.,
|
|
||||||
vec2(5.0,1.)/8.,
|
|
||||||
vec2(-3,-5.)/8.,
|
|
||||||
vec2(-5.,5.)/8.,
|
|
||||||
vec2(-7.,-1.)/8.,
|
|
||||||
vec2(3,7.)/8.,
|
|
||||||
vec2(7.,-7.)/8.);
|
|
||||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
|
||||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
|
||||||
vec4 toClipSpace3(vec3 viewSpacePosition) {
|
|
||||||
return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),-viewSpacePosition.z);
|
|
||||||
}
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
lmtexcoord.xy = (gl_MultiTexCoord0).xy;
|
|
||||||
vec2 lmcoord = gl_MultiTexCoord1.xy/255.;
|
|
||||||
lmtexcoord.zw = lmcoord;
|
|
||||||
|
|
||||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
|
||||||
gl_Position = toClipSpace3(position);
|
|
||||||
color = gl_Color;
|
|
||||||
float mat = 0.0;
|
|
||||||
if(mc_Entity.x == 8.0 || mc_Entity.x == 9.0) {
|
|
||||||
mat = 1.0;
|
|
||||||
|
|
||||||
gl_Position.z -= 1e-4;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mc_Entity.x == 10002) mat = 0.01;
|
|
||||||
if (mc_Entity.x == 72) mat = 0.5;
|
|
||||||
|
|
||||||
normalMat = vec4(normalize( gl_NormalMatrix*gl_Normal),mat);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tangent_other = vec4(normalize(gl_NormalMatrix * at_tangent.rgb),normalMat.a);
|
|
||||||
|
|
||||||
tangent = normalize( gl_NormalMatrix *at_tangent.rgb);
|
|
||||||
binormal = normalize(cross(tangent.rgb,normalMat.xyz)*at_tangent.w);
|
|
||||||
|
|
||||||
mat3 tbnMatrix = mat3(tangent.x, binormal.x, normalMat.x,
|
|
||||||
tangent.y, binormal.y, normalMat.y,
|
|
||||||
tangent.z, binormal.z, normalMat.z);
|
|
||||||
|
|
||||||
dist = length(gl_ModelViewMatrix * gl_Vertex);
|
|
||||||
|
|
||||||
viewVector = ( gl_ModelViewMatrix * gl_Vertex).xyz;
|
|
||||||
viewVector = normalize(tbnMatrix * viewVector);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef TAA_UPSCALING
|
|
||||||
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
|
|
||||||
#endif
|
|
||||||
#ifdef TAA
|
|
||||||
gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vec3 sc = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
|
|
||||||
|
|
||||||
|
|
||||||
lightCol.a = float(sunElevation > 1e-5)*2-1.;
|
|
||||||
lightCol.rgb = sc;
|
|
||||||
|
|
||||||
WsunVec = lightCol.a*normalize(mat3(gbufferModelViewInverse) *sunPosition);
|
|
||||||
}
|
|
@ -1,271 +1,4 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
|
||||||
|
|
||||||
varying vec4 lmtexcoord;
|
// #define WORLD
|
||||||
varying vec4 color;
|
#include "gbuffers_all_translucent.fsh"
|
||||||
varying vec4 normalMat;
|
|
||||||
varying vec3 binormal;
|
|
||||||
uniform sampler2D normals;
|
|
||||||
varying vec3 tangent;
|
|
||||||
varying vec4 tangent_other;
|
|
||||||
varying vec3 viewVector;
|
|
||||||
varying float dist;
|
|
||||||
#include "/lib/res_params.glsl"
|
|
||||||
|
|
||||||
#define CLOUDS_SHADOWS
|
|
||||||
#define VL_CLOUDS_SHADOWS // Casts shadows from clouds on VL (slow)
|
|
||||||
#define SCREENSPACE_REFLECTIONS //can be really expensive at high resolutions/render quality, especially on ice
|
|
||||||
#define SSR_STEPS 30 //[10 15 20 25 30 35 40 50 100 200 400]
|
|
||||||
#define SUN_MICROFACET_SPECULAR // If enabled will use realistic rough microfacet model, else will just reflect the sun. No performance impact.
|
|
||||||
#define USE_QUARTER_RES_DEPTH // Uses a quarter resolution depth buffer to raymarch screen space reflections, improves performance but may introduce artifacts
|
|
||||||
#define saturate(x) clamp(x,0.0,1.0)
|
|
||||||
#define Dirt_Amount 0.14 //How much dirt there is in water [0.0 0.04 0.08 0.12 0.16 0.2 0.24 0.28 0.32 0.36 0.4 0.44 0.48 0.52 0.56 0.6 0.64 0.68 0.72 0.76 0.8 0.84 0.88 0.92 0.96 1.0 1.04 1.08 1.12 1.16 1.2 1.24 1.28 1.32 1.36 1.4 1.44 1.48 1.52 1.56 1.6 1.64 1.68 1.72 1.76 1.8 1.84 1.88 1.92 1.96 2.0 ]
|
|
||||||
|
|
||||||
#define Dirt_Scatter_R 0.6 //How much dirt diffuses red [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_G 0.6 //How much dirt diffuses green [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_B 0.6 //How much dirt diffuses blue [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
|
|
||||||
#define Dirt_Absorb_R 1.65 //How much dirt absorbs red [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_G 1.85 //How much dirt absorbs green [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_B 2.05 //How much dirt absorbs blue [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
|
|
||||||
#define Water_Absorb_R 0.2629 //How much water absorbs red [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_G 0.0565 //How much water absorbs green [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_B 0.01011 //How much water absorbs blue [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
|
|
||||||
uniform sampler2D texture;
|
|
||||||
uniform sampler2D noisetex;
|
|
||||||
uniform sampler2DShadow shadow;
|
|
||||||
uniform sampler2D gaux2;
|
|
||||||
uniform sampler2D gaux1;
|
|
||||||
uniform sampler2D depthtex1;
|
|
||||||
|
|
||||||
uniform vec4 lightCol;
|
|
||||||
uniform vec3 sunVec;
|
|
||||||
uniform float frameTimeCounter;
|
|
||||||
uniform float lightSign;
|
|
||||||
uniform float near;
|
|
||||||
uniform float far;
|
|
||||||
uniform float moonIntensity;
|
|
||||||
uniform float sunIntensity;
|
|
||||||
uniform vec3 sunColor;
|
|
||||||
uniform vec3 nsunColor;
|
|
||||||
uniform vec3 upVec;
|
|
||||||
uniform float sunElevation;
|
|
||||||
uniform float fogAmount;
|
|
||||||
uniform vec2 texelSize;
|
|
||||||
uniform float rainStrength;
|
|
||||||
uniform float skyIntensityNight;
|
|
||||||
uniform float skyIntensity;
|
|
||||||
flat varying vec3 WsunVec;
|
|
||||||
uniform mat4 gbufferPreviousModelView;
|
|
||||||
uniform vec3 previousCameraPosition;
|
|
||||||
uniform int framemod8;
|
|
||||||
uniform sampler2D specular;
|
|
||||||
uniform int frameCounter;
|
|
||||||
uniform int isEyeInWater;
|
|
||||||
#include "lib/Shadow_Params.glsl"
|
|
||||||
#include "lib/color_transforms.glsl"
|
|
||||||
#include "lib/projections.glsl"
|
|
||||||
#include "lib/sky_gradient.glsl"
|
|
||||||
#include "lib/waterBump.glsl"
|
|
||||||
#include "lib/clouds.glsl"
|
|
||||||
#include "lib/stars.glsl"
|
|
||||||
#include "lib/volumetricClouds.glsl"
|
|
||||||
|
|
||||||
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|
||||||
vec2(-1.,3.)/8.,
|
|
||||||
vec2(5.0,1.)/8.,
|
|
||||||
vec2(-3,-5.)/8.,
|
|
||||||
vec2(-5.,5.)/8.,
|
|
||||||
vec2(-7.,-1.)/8.,
|
|
||||||
vec2(3,7.)/8.,
|
|
||||||
vec2(7.,-7.)/8.);
|
|
||||||
float blueNoise(){
|
|
||||||
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 * frameCounter);
|
|
||||||
}
|
|
||||||
float ld(float dist) {
|
|
||||||
return (2.0 * near) / (far + near - dist * (far - near));
|
|
||||||
}
|
|
||||||
float cdist(vec2 coord) {
|
|
||||||
return max(abs(coord.s-0.5),abs(coord.t-0.5))*2.0;
|
|
||||||
}
|
|
||||||
vec2 tapLocation(int sampleNumber,int nb, float nbRot,float jitter,float distort){
|
|
||||||
float alpha = (sampleNumber+jitter)/nb;
|
|
||||||
float angle = jitter*6.28 + alpha * nbRot * 6.28;
|
|
||||||
|
|
||||||
float sin_v, cos_v;
|
|
||||||
|
|
||||||
sin_v = sin(angle);
|
|
||||||
cos_v = cos(angle);
|
|
||||||
|
|
||||||
return vec2(cos_v, sin_v)*sqrt(alpha);
|
|
||||||
}
|
|
||||||
float GGX(vec3 n, vec3 v, vec3 l, float r, float F0) {
|
|
||||||
r*=r;r*=r;
|
|
||||||
|
|
||||||
vec3 h = l + v;
|
|
||||||
float hn = inversesqrt(dot(h, h));
|
|
||||||
|
|
||||||
float dotLH = clamp(dot(h,l)*hn,0.,1.);
|
|
||||||
float dotNH = clamp(dot(h,n)*hn,0.,1.);
|
|
||||||
float dotNL = clamp(dot(n,l),0.,1.);
|
|
||||||
float dotNHsq = dotNH*dotNH;
|
|
||||||
|
|
||||||
float denom = dotNHsq * r - dotNHsq + 1.;
|
|
||||||
float D = r / (3.141592653589793 * denom * denom);
|
|
||||||
float F = F0 + (1. - F0) * exp2((-5.55473*dotLH-6.98316)*dotLH);
|
|
||||||
float k2 = .25 * r;
|
|
||||||
|
|
||||||
return dotNL * D * F / (dotLH*dotLH*(1.0-k2)+k2);
|
|
||||||
}
|
|
||||||
vec3 applyBump(mat3 tbnMatrix, vec3 bump){
|
|
||||||
float bumpmult = 1.0;
|
|
||||||
bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult);
|
|
||||||
return normalize(bump*tbnMatrix);
|
|
||||||
}
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
/* RENDERTARGETS:2,7,13 */
|
|
||||||
void main() {
|
|
||||||
if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize.y < RENDER_SCALE.y ) {
|
|
||||||
vec2 tempOffset=offsets[framemod8];
|
|
||||||
float iswater = normalMat.w;
|
|
||||||
vec3 fragC = gl_FragCoord.xyz*vec3(texelSize,1.0);
|
|
||||||
vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0));
|
|
||||||
|
|
||||||
// color n stuff
|
|
||||||
gl_FragData[0] = texture2D(texture, lmtexcoord.xy)*color;
|
|
||||||
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
|
||||||
gl_FragData[0].rgb = clamp((gl_FragData[0].rgb)*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
|
||||||
vec3 albedo = toLinear(gl_FragData[0].rgb);
|
|
||||||
|
|
||||||
|
|
||||||
gl_FragData[2] = vec4(albedo, gl_FragData[0].a);
|
|
||||||
|
|
||||||
// specular
|
|
||||||
vec2 specularstuff = texture2D(specular, lmtexcoord.xy, -1).rg;
|
|
||||||
|
|
||||||
// normals
|
|
||||||
vec3 normal = normalMat.xyz;
|
|
||||||
|
|
||||||
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
|
||||||
mat3 tbnMatrix = mat3(tangent.x, binormal.x, normal.x,
|
|
||||||
tangent.y, binormal.y, normal.y,
|
|
||||||
tangent.z, binormal.z, normal.z);
|
|
||||||
|
|
||||||
vec3 normalTex = texture2D(normals, lmtexcoord.xy, -1).rgb;
|
|
||||||
normalTex.xy = normalTex.xy*2.0-1.0;
|
|
||||||
normalTex.z = clamp(sqrt(1.0 - dot(normalTex.xy, normalTex.xy)),0.0,1.0);
|
|
||||||
normal = applyBump(tbnMatrix,normalTex);
|
|
||||||
|
|
||||||
|
|
||||||
//other shit
|
|
||||||
float NdotL = lightSign*dot(normal,sunVec);
|
|
||||||
float diffuseSun = clamp(NdotL,0.0f,1.0f);
|
|
||||||
|
|
||||||
vec3 direct = texelFetch2D(gaux1,ivec2(6,37),0).rgb/3.1415;
|
|
||||||
|
|
||||||
float shading = 1.0;
|
|
||||||
float cloudShadow = 1.0;
|
|
||||||
|
|
||||||
//compute shadows only if not backface
|
|
||||||
if (diffuseSun > 0.001) {
|
|
||||||
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
|
|
||||||
vec3 projectedShadowPosition = mat3(shadowModelView) * p3 + shadowModelView[3].xyz;
|
|
||||||
projectedShadowPosition = diagonal3(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz;
|
|
||||||
|
|
||||||
//apply distortion
|
|
||||||
float distortFactor = calcDistort(projectedShadowPosition.xy);
|
|
||||||
projectedShadowPosition.xy *= distortFactor;
|
|
||||||
//do shadows only if on shadow map
|
|
||||||
if (abs(projectedShadowPosition.x) < 1.0-1.5/shadowMapResolution && abs(projectedShadowPosition.y) < 1.0-1.5/shadowMapResolution){
|
|
||||||
const float threshMul = max(2048.0/shadowMapResolution*shadowDistance/128.0,0.95);
|
|
||||||
float distortThresh = (sqrt(1.0-diffuseSun*diffuseSun)/diffuseSun+0.7)/distortFactor;
|
|
||||||
float diffthresh = distortThresh/6000.0*threshMul;
|
|
||||||
|
|
||||||
projectedShadowPosition = projectedShadowPosition * vec3(0.5,0.5,0.5/6.0) + vec3(0.5,0.5,0.5);
|
|
||||||
|
|
||||||
shading = 0.0;
|
|
||||||
float noise = blueNoise();
|
|
||||||
float rdMul = 4.0/shadowMapResolution;
|
|
||||||
for(int i = 0; i < 9; i++){
|
|
||||||
vec2 offsetS = tapLocation(i,9, 1.618,noise,0.0);
|
|
||||||
|
|
||||||
float weight = 1.0+(i+noise)*rdMul/9.0*shadowMapResolution;
|
|
||||||
shading += shadow2D(shadow,vec3(projectedShadowPosition + vec3(rdMul*offsetS,-diffthresh*weight))).x/9.0;
|
|
||||||
}
|
|
||||||
direct *= shading;
|
|
||||||
}
|
|
||||||
// vec3 campos = (p3 + cameraPosition)-319 ;
|
|
||||||
// #ifdef VOLUMETRIC_CLOUDS
|
|
||||||
// #ifdef CLOUDS_SHADOWS
|
|
||||||
// // get cloud position
|
|
||||||
// vec3 cloudPos = campos*Cloud_Size + WsunVec/abs(WsunVec.y) * (2250 - campos.y*Cloud_Size);
|
|
||||||
// // get the cloud density and apply it
|
|
||||||
// cloudShadow = getCloudDensity(cloudPos, 1);
|
|
||||||
// cloudShadow = exp(-cloudShadow*sqrt(cloudDensity)*25);
|
|
||||||
|
|
||||||
// // make these turn to zero when occluded by the cloud shadow
|
|
||||||
// direct *= cloudShadow;
|
|
||||||
// #endif
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
direct *= (iswater > 0.9 ? 0.2: 1.0)*diffuseSun*lmtexcoord.w;
|
|
||||||
|
|
||||||
vec3 diffuseLight = direct + texture2D(gaux1,(lmtexcoord.zw*15.+0.5)*texelSize).rgb;
|
|
||||||
vec3 color = diffuseLight*albedo*8./150./3.;
|
|
||||||
|
|
||||||
if (iswater >= 0.0){
|
|
||||||
|
|
||||||
float roughness = iswater > 0.4 ? 0.0 : specularstuff.r > 0.0 ? pow(1.0-specularstuff.r,2.0) : 0.05*(1.0-gl_FragData[0].a);
|
|
||||||
float f0 = iswater > 0.4 ? 0.02 : specularstuff.g;
|
|
||||||
|
|
||||||
float F0 = f0;
|
|
||||||
|
|
||||||
|
|
||||||
vec3 reflectedVector = reflect(normalize(fragpos), normal);
|
|
||||||
float normalDotEye = dot(normal, normalize(fragpos));
|
|
||||||
float fresnel = pow(clamp(1.0 + normalDotEye,0.0,1.0), 5.0);
|
|
||||||
|
|
||||||
fresnel = mix(F0,1.0,fresnel);
|
|
||||||
|
|
||||||
|
|
||||||
vec3 wrefl = mat3(gbufferModelViewInverse)*reflectedVector;
|
|
||||||
vec3 sky_c = mix(skyCloudsFromTex(wrefl,gaux1).rgb,texture2D(gaux1,(lmtexcoord.zw*15.+0.5)*texelSize).rgb*0.5,isEyeInWater);
|
|
||||||
sky_c.rgb *= lmtexcoord.w*lmtexcoord.w*255*255/240./240./150.*8./3.;
|
|
||||||
|
|
||||||
vec4 reflection = vec4(sky_c.rgb,0.);
|
|
||||||
reflection.rgb = mix(sky_c.rgb, reflection.rgb, reflection.a);
|
|
||||||
|
|
||||||
#ifdef SUN_MICROFACET_SPECULAR
|
|
||||||
vec3 sunSpec = GGX(normal,-normalize(fragpos), lightSign*sunVec, rainStrength*0.2+roughness+0.05+clamp(-lightSign*0.15,0.0,1.0), f0) * texelFetch2D(gaux1,ivec2(6,37),0).rgb*8./3./150.0/3.1415 * (1.0-rainStrength*0.9);
|
|
||||||
#else
|
|
||||||
vec3 sunSpec = drawSun(dot(lightSign*sunVec,reflectedVector), 0.0,texelFetch2D(gaux1,ivec2(6,37),0).rgb,vec3(0.0))*8./3./150.0*fresnel/3.1415 * (1.0-rainStrength*0.9);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// vec3 albedoTint = F0 >= (230.0/255.0) ? clamp(color.rgb + fresnel,0.0,1.0) : vec3(1.0);
|
|
||||||
// reflection.rgb *= albedoTint;
|
|
||||||
// sunSpec.rgb *= albedoTint;
|
|
||||||
|
|
||||||
vec3 reflected = reflection.rgb*fresnel+shading*sunSpec;
|
|
||||||
|
|
||||||
float alpha0 = gl_FragData[0].a;
|
|
||||||
|
|
||||||
//correct alpha channel with fresnel
|
|
||||||
gl_FragData[0].a = -gl_FragData[0].a*fresnel+gl_FragData[0].a+fresnel;
|
|
||||||
gl_FragData[0].rgb =clamp(color/gl_FragData[0].a*alpha0*(1.0-fresnel)*0.1+reflected/gl_FragData[0].a*0.1,0.0,65100.0);
|
|
||||||
if (gl_FragData[0].r > 65000.) gl_FragData[0].rgba = vec4(0.);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
gl_FragData[0].rgb = color*0.1;
|
|
||||||
|
|
||||||
gl_FragData[1] = vec4(albedo,iswater);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,107 +1,4 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
|
||||||
|
|
||||||
#include "/lib/res_params.glsl"
|
// #define WORLD
|
||||||
|
#include "gbuffers_all_translucent.vsh"
|
||||||
|
|
||||||
/*
|
|
||||||
!! DO NOT REMOVE !!
|
|
||||||
This code is from Chocapic13' shaders
|
|
||||||
Read the terms of modification and sharing before changing something below please !
|
|
||||||
!! DO NOT REMOVE !!
|
|
||||||
*/
|
|
||||||
//#define Vanilla_like_water // vanilla water texture along with shader water stuff
|
|
||||||
|
|
||||||
varying vec4 lmtexcoord;
|
|
||||||
varying vec4 color;
|
|
||||||
varying vec4 normalMat;
|
|
||||||
varying vec3 binormal;
|
|
||||||
varying vec3 tangent;
|
|
||||||
varying float dist;
|
|
||||||
uniform mat4 gbufferModelViewInverse;
|
|
||||||
varying vec3 viewVector;
|
|
||||||
attribute vec4 at_tangent;
|
|
||||||
attribute vec4 mc_Entity;
|
|
||||||
|
|
||||||
uniform sampler2D colortex4;
|
|
||||||
uniform vec3 sunPosition;
|
|
||||||
flat varying vec4 lightCol;
|
|
||||||
flat varying vec3 WsunVec;
|
|
||||||
uniform float sunElevation;
|
|
||||||
|
|
||||||
varying vec4 tangent_other;
|
|
||||||
#define SHADOW_MAP_BIAS 0.8
|
|
||||||
|
|
||||||
|
|
||||||
uniform vec2 texelSize;
|
|
||||||
uniform int framemod8;
|
|
||||||
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|
||||||
vec2(-1.,3.)/8.,
|
|
||||||
vec2(5.0,1.)/8.,
|
|
||||||
vec2(-3,-5.)/8.,
|
|
||||||
vec2(-5.,5.)/8.,
|
|
||||||
vec2(-7.,-1.)/8.,
|
|
||||||
vec2(3,7.)/8.,
|
|
||||||
vec2(7.,-7.)/8.);
|
|
||||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
|
||||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
|
||||||
vec4 toClipSpace3(vec3 viewSpacePosition) {
|
|
||||||
return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),-viewSpacePosition.z);
|
|
||||||
}
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
lmtexcoord.xy = (gl_MultiTexCoord0).xy;
|
|
||||||
vec2 lmcoord = gl_MultiTexCoord1.xy/255.;
|
|
||||||
lmtexcoord.zw = lmcoord;
|
|
||||||
|
|
||||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
|
||||||
gl_Position = toClipSpace3(position);
|
|
||||||
color = gl_Color;
|
|
||||||
float mat = 0.0;
|
|
||||||
if(mc_Entity.x == 8.0 || mc_Entity.x == 9.0) {
|
|
||||||
mat = 1.0;
|
|
||||||
|
|
||||||
gl_Position.z -= 1e-4;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mc_Entity.x == 10002) mat = 0.01;
|
|
||||||
if (mc_Entity.x == 72) mat = 0.5;
|
|
||||||
|
|
||||||
normalMat = vec4(normalize( gl_NormalMatrix*gl_Normal),mat);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tangent_other = vec4(normalize(gl_NormalMatrix * at_tangent.rgb),normalMat.a);
|
|
||||||
|
|
||||||
tangent = normalize( gl_NormalMatrix *at_tangent.rgb);
|
|
||||||
binormal = normalize(cross(tangent.rgb,normalMat.xyz)*at_tangent.w);
|
|
||||||
|
|
||||||
mat3 tbnMatrix = mat3(tangent.x, binormal.x, normalMat.x,
|
|
||||||
tangent.y, binormal.y, normalMat.y,
|
|
||||||
tangent.z, binormal.z, normalMat.z);
|
|
||||||
|
|
||||||
dist = length(gl_ModelViewMatrix * gl_Vertex);
|
|
||||||
|
|
||||||
viewVector = ( gl_ModelViewMatrix * gl_Vertex).xyz;
|
|
||||||
viewVector = normalize(tbnMatrix * viewVector);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef TAA_UPSCALING
|
|
||||||
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
|
|
||||||
#endif
|
|
||||||
#ifdef TAA
|
|
||||||
gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vec3 sc = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
|
|
||||||
|
|
||||||
lightCol.a = float(sunElevation > 1e-5)*2-1.;
|
|
||||||
lightCol.rgb = sc;
|
|
||||||
WsunVec = lightCol.a*normalize(mat3(gbufferModelViewInverse) *sunPosition);
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
#version 120
|
|
||||||
|
|
||||||
/* DRAWBUFFERS:3 */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
#version 120
|
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
|
|
||||||
gl_Position.w = -1.0;
|
|
||||||
}
|
|
@ -1,352 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
|
||||||
|
|
||||||
//#define POM
|
// #define WEATHER
|
||||||
#define POM_MAP_RES 128.0 // [16.0 32.0 64.0 128.0 256.0 512.0 1024.0] Increase to improve POM quality
|
#define PARTICLES
|
||||||
#define POM_DEPTH 0.1 // [0.025 0.05 0.075 0.1 0.125 0.15 0.20 0.25 0.30 0.50 0.75 1.0] //Increase to increase POM strength
|
#include "gbuffers_all_particles.fsh"
|
||||||
#define MAX_ITERATIONS 50 // [5 10 15 20 25 30 40 50 60 70 80 90 100 125 150 200 400] //Improves quality at grazing angles (reduces performance)
|
|
||||||
#define MAX_DIST 25.0 // [5.0 10.0 15.0 20.0 25.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 125.0 150.0 200.0 400.0] //Increases distance at which POM is calculated
|
|
||||||
//#define USE_LUMINANCE_AS_HEIGHTMAP //Can generate POM on any texturepack (may look weird in some cases)
|
|
||||||
#define Texture_MipMap_Bias -1.00 // Uses a another mip level for textures. When reduced will increase texture detail but may induce a lot of shimmering. [-5.00 -4.75 -4.50 -4.25 -4.00 -3.75 -3.50 -3.25 -3.00 -2.75 -2.50 -2.25 -2.00 -1.75 -1.50 -1.25 -1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
|
|
||||||
#define DISABLE_ALPHA_MIPMAPS //Disables mipmaps on the transparency of alpha-tested things like foliage, may cost a few fps in some cases
|
|
||||||
|
|
||||||
|
|
||||||
#define SSAO // screen-space ambient occlusion.
|
|
||||||
#define texture_ao // ambient occlusion on the texture
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef USE_LUMINANCE_AS_HEIGHTMAP
|
|
||||||
#ifndef MC_NORMAL_MAP
|
|
||||||
#undef POM
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef POM
|
|
||||||
#define MC_NORMAL_MAP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const float mincoord = 1.0/4096.0;
|
|
||||||
const float maxcoord = 1.0-mincoord;
|
|
||||||
const vec3 intervalMult = vec3(1.0, 1.0, 1.0/POM_DEPTH)/POM_MAP_RES * 1.0;
|
|
||||||
|
|
||||||
const float MAX_OCCLUSION_DISTANCE = MAX_DIST;
|
|
||||||
const float MIX_OCCLUSION_DISTANCE = MAX_DIST*0.9;
|
|
||||||
const int MAX_OCCLUSION_POINTS = MAX_ITERATIONS;
|
|
||||||
|
|
||||||
uniform vec2 texelSize;
|
|
||||||
#ifdef POM
|
|
||||||
varying vec4 vtexcoordam; // .st for add, .pq for mul
|
|
||||||
varying vec4 vtexcoord;
|
|
||||||
|
|
||||||
uniform int framemod8;
|
|
||||||
#endif
|
|
||||||
#include "/lib/res_params.glsl"
|
|
||||||
varying vec4 lmtexcoord;
|
|
||||||
varying vec4 color;
|
|
||||||
varying vec4 normalMat;
|
|
||||||
#ifdef MC_NORMAL_MAP
|
|
||||||
varying vec4 tangent;
|
|
||||||
uniform float wetness;
|
|
||||||
uniform sampler2D normals;
|
|
||||||
uniform sampler2D specular;
|
|
||||||
#endif
|
|
||||||
#ifdef POM
|
|
||||||
vec2 dcdx = dFdx(vtexcoord.st*vtexcoordam.pq)*exp2(Texture_MipMap_Bias);
|
|
||||||
vec2 dcdy = dFdy(vtexcoord.st*vtexcoordam.pq)*exp2(Texture_MipMap_Bias);
|
|
||||||
#endif
|
|
||||||
uniform sampler2D texture;
|
|
||||||
uniform sampler2D colortex1;//albedo(rgb),material(alpha) RGBA16
|
|
||||||
uniform float frameTimeCounter;
|
|
||||||
uniform int frameCounter;
|
|
||||||
uniform mat4 gbufferProjectionInverse;
|
|
||||||
uniform mat4 gbufferModelView;
|
|
||||||
uniform mat4 gbufferProjection;
|
|
||||||
uniform mat4 gbufferModelViewInverse;
|
|
||||||
uniform sampler2D noisetex;//depth
|
|
||||||
|
|
||||||
float interleaved_gradientNoise(){
|
|
||||||
return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+frameTimeCounter*51.9521);
|
|
||||||
}
|
|
||||||
float blueNoise(){
|
|
||||||
return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 * frameCounter);
|
|
||||||
}
|
|
||||||
float R2_dither(){
|
|
||||||
vec2 alpha = vec2(0.75487765, 0.56984026);
|
|
||||||
return fract(alpha.x * gl_FragCoord.x + alpha.y * gl_FragCoord.y + 1.0/1.6180339887 * frameCounter) ;
|
|
||||||
}
|
|
||||||
vec2 decodeVec2(float a){
|
|
||||||
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
|
||||||
const float constant2 = 256. / 255.;
|
|
||||||
return fract( a * constant1 ) * constant2 ;
|
|
||||||
}
|
|
||||||
mat3 inverse(mat3 m) {
|
|
||||||
float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];
|
|
||||||
float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];
|
|
||||||
float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];
|
|
||||||
|
|
||||||
float b01 = a22 * a11 - a12 * a21;
|
|
||||||
float b11 = -a22 * a10 + a12 * a20;
|
|
||||||
float b21 = a21 * a10 - a11 * a20;
|
|
||||||
|
|
||||||
float det = a00 * b01 + a01 * b11 + a02 * b21;
|
|
||||||
|
|
||||||
return mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),
|
|
||||||
b11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),
|
|
||||||
b21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 viewToWorld(vec3 viewPosition) {
|
|
||||||
vec4 pos;
|
|
||||||
pos.xyz = viewPosition;
|
|
||||||
pos.w = 0.0;
|
|
||||||
pos = gbufferModelViewInverse * pos;
|
|
||||||
return pos.xyz;
|
|
||||||
}
|
|
||||||
vec3 worldToView(vec3 worldPos) {
|
|
||||||
vec4 pos = vec4(worldPos, 0.0);
|
|
||||||
pos = gbufferModelView * pos;
|
|
||||||
return pos.xyz;
|
|
||||||
}
|
|
||||||
vec4 encode (vec3 n, vec2 lightmaps){
|
|
||||||
n.xy = n.xy / dot(abs(n), vec3(1.0));
|
|
||||||
n.xy = n.z <= 0.0 ? (1.0 - abs(n.yx)) * sign(n.xy) : n.xy;
|
|
||||||
vec2 encn = clamp(n.xy * 0.5 + 0.5,-1.0,1.0);
|
|
||||||
|
|
||||||
return vec4(encn,vec2(lightmaps.x,lightmaps.y));
|
|
||||||
}
|
|
||||||
|
|
||||||
//encode normal in two channels (xy),torch(z) and sky lightmap (w)
|
|
||||||
// vec4 encode_old (vec3 n){
|
|
||||||
// return vec4(n.xy*inversesqrt(n.z*8.0+8.0) + 0.5,vec2(lmtexcoord.z,lmtexcoord.w));
|
|
||||||
// }
|
|
||||||
// vec4 encode_old (vec3 n, vec2 lightmaps){
|
|
||||||
// return vec4(n.xy*inversesqrt(n.z*8.0+8.0) + 0.5,vec2(lightmaps.x,lightmaps.y));
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MC_NORMAL_MAP
|
|
||||||
vec3 applyBump(mat3 tbnMatrix, vec3 bump)
|
|
||||||
{
|
|
||||||
float bumpmult = 1.0;
|
|
||||||
|
|
||||||
bump = bump * vec3(bumpmult, bumpmult, bumpmult) + vec3(0.0f, 0.0f, 1.0f - bumpmult);
|
|
||||||
|
|
||||||
return normalize(bump*tbnMatrix);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//encoding by jodie
|
|
||||||
float encodeVec2(vec2 a){
|
|
||||||
const vec2 constant1 = vec2( 1., 256.) / 65535.;
|
|
||||||
vec2 temp = floor( a * 255. );
|
|
||||||
return temp.x*constant1.x+temp.y*constant1.y;
|
|
||||||
}
|
|
||||||
float encodeVec2(float x,float y){
|
|
||||||
return encodeVec2(vec2(x,y));
|
|
||||||
}
|
|
||||||
|
|
||||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
|
||||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
|
||||||
|
|
||||||
vec3 toScreenSpace(vec3 p) {
|
|
||||||
vec4 iProjDiag = vec4(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y, gbufferProjectionInverse[2].zw);
|
|
||||||
vec3 p3 = p * 2. - 1.;
|
|
||||||
vec4 fragposition = iProjDiag * p3.xyzz + gbufferProjectionInverse[3];
|
|
||||||
return fragposition.xyz / fragposition.w;
|
|
||||||
}
|
|
||||||
vec3 toClipSpace3(vec3 viewSpacePosition) {
|
|
||||||
return projMAD(gbufferProjection, viewSpacePosition) / -viewSpacePosition.z * 0.5 + 0.5;
|
|
||||||
}
|
|
||||||
#ifdef POM
|
|
||||||
vec4 readNormal(in vec2 coord)
|
|
||||||
{
|
|
||||||
return texture2DGradARB(normals,fract(coord)*vtexcoordam.pq+vtexcoordam.st,dcdx,dcdy);
|
|
||||||
}
|
|
||||||
vec4 readTexture(in vec2 coord)
|
|
||||||
{
|
|
||||||
return texture2DGradARB(texture,fract(coord)*vtexcoordam.pq+vtexcoordam.st,dcdx,dcdy);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
float luma(vec3 color) {
|
|
||||||
return dot(color,vec3(0.21, 0.72, 0.07));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
vec3 toLinear(vec3 sRGB){
|
|
||||||
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|
||||||
vec2(-1.,3.)/8.,
|
|
||||||
vec2(5.0,1.)/8.,
|
|
||||||
vec2(-3,-5.)/8.,
|
|
||||||
vec2(-5.,5.)/8.,
|
|
||||||
vec2(-7.,-1.)/8.,
|
|
||||||
vec2(3,7.)/8.,
|
|
||||||
vec2(7.,-7.)/8.);
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
/* DRAWBUFFERS:178 */
|
|
||||||
void main() {
|
|
||||||
// float noise = interleaved_gradientNoise();
|
|
||||||
|
|
||||||
|
|
||||||
float phi = 2 * 3.14159265359;
|
|
||||||
float noise = fract(fract(frameCounter * (1.0 / phi)) + interleaved_gradientNoise() ) ;
|
|
||||||
// float noise = interleaved_gradientNoise();
|
|
||||||
|
|
||||||
|
|
||||||
vec3 normal = normalMat.xyz;
|
|
||||||
#ifdef MC_NORMAL_MAP
|
|
||||||
vec3 tangent2 = normalize(cross(tangent.rgb,normal)*tangent.w);
|
|
||||||
mat3 tbnMatrix = mat3(tangent.x, tangent2.x, normal.x,
|
|
||||||
tangent.y, tangent2.y, normal.y,
|
|
||||||
tangent.z, tangent2.z, normal.z);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef POM
|
|
||||||
vec2 tempOffset=offsets[framemod8];
|
|
||||||
vec2 adjustedTexCoord = fract(vtexcoord.st)*vtexcoordam.pq+vtexcoordam.st;
|
|
||||||
vec3 fragpos = toScreenSpace(gl_FragCoord.xyz*vec3(texelSize/RENDER_SCALE,1.0)-vec3(vec2(tempOffset)*texelSize*0.5,0.0));
|
|
||||||
vec3 viewVector = normalize(tbnMatrix*fragpos);
|
|
||||||
float dist = length(fragpos);
|
|
||||||
|
|
||||||
// #ifdef Depth_Write_POM
|
|
||||||
gl_FragDepth = gl_FragCoord.z;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
if (dist < MAX_OCCLUSION_DISTANCE) {
|
|
||||||
|
|
||||||
if ( viewVector.z < 0.0 && readNormal(vtexcoord.st).a < 0.9999 && readNormal(vtexcoord.st).a > 0.00001) {
|
|
||||||
|
|
||||||
vec3 interval = viewVector.xyz /-viewVector.z/MAX_OCCLUSION_POINTS*POM_DEPTH;
|
|
||||||
vec3 coord = vec3(vtexcoord.st, 1.0);
|
|
||||||
coord += noise*interval;
|
|
||||||
float sumVec = noise;
|
|
||||||
for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - POM_DEPTH + POM_DEPTH*readNormal(coord.st).a < coord.p) &&coord.p >= 0.0; ++loopCount) { coord = coord+interval; sumVec += 1.0; }
|
|
||||||
|
|
||||||
if (coord.t < mincoord) {
|
|
||||||
if (readTexture(vec2(coord.s,mincoord)).a == 0.0) {
|
|
||||||
coord.t = mincoord;
|
|
||||||
discard;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
adjustedTexCoord = mix(fract(coord.st)*vtexcoordam.pq+vtexcoordam.st, adjustedTexCoord, max(dist-MIX_OCCLUSION_DISTANCE,0.0)/(MAX_OCCLUSION_DISTANCE-MIX_OCCLUSION_DISTANCE));
|
|
||||||
|
|
||||||
|
|
||||||
vec3 truePos = fragpos + sumVec*inverse(tbnMatrix)*interval;
|
|
||||||
// #ifdef Depth_Write_POM
|
|
||||||
gl_FragDepth = toClipSpace3(truePos).z;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vec4 data0 = texture2DGradARB(texture, adjustedTexCoord.xy,dcdx,dcdy);
|
|
||||||
#ifdef DISABLE_ALPHA_MIPMAPS
|
|
||||||
data0.a = texture2DGradARB(texture, adjustedTexCoord.xy,vec2(0.),vec2(0.0)).a;
|
|
||||||
#endif
|
|
||||||
if (data0.a > 0.1) data0.a = normalMat.a;
|
|
||||||
else data0.a = 0.0;
|
|
||||||
|
|
||||||
|
|
||||||
// normal = applyBump(tbnMatrix,texture2DGradARB(normals,adjustedTexCoord.xy,dcdx,dcdy).xyz*2.-1.);
|
|
||||||
// data0.rgb*=color.rgb;
|
|
||||||
// vec4 data1 = clamp(noise*exp2(-8.)+encode_old(normal),0.,1.0);
|
|
||||||
// gl_FragData[0] = vec4(encodeVec2(data0.x,data1.x),encodeVec2(data0.y,data1.y),encodeVec2(data0.z,data1.z),encodeVec2(data1.w,data0.w));
|
|
||||||
|
|
||||||
|
|
||||||
vec2 lm = lmtexcoord.zw;
|
|
||||||
|
|
||||||
// vec3 normalTex = texture2DGradARB(normals,adjustedTexCoord.xy,dcdx,dcdy).xyz;
|
|
||||||
// normal = applyBump(tbnMatrix,texture2DGradARB(normals,adjustedTexCoord.xy,dcdx,dcdy).xyz*2.0-1.0);
|
|
||||||
|
|
||||||
// #ifdef MC_NORMAL_MAP
|
|
||||||
vec3 normalTex = texture2DGradARB(normals, adjustedTexCoord.xy, dcdx,dcdy).rgb;
|
|
||||||
#ifndef SSAO
|
|
||||||
#ifdef texture_ao
|
|
||||||
lm *= clamp( pow(normalTex.b,0.4) ,0,1); // texture ao? i think? i dont know
|
|
||||||
// lm *= clamp(0.5 + pow(normalTex.b,0.1) - max(normalTex.g,0),0,1) ; // texture ao? i think? i dont know
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
normalTex.xy = normalTex.xy*2.0-1.0;
|
|
||||||
normalTex.z = sqrt(1.0 - dot(normalTex.xy, normalTex.xy));
|
|
||||||
normal = applyBump(tbnMatrix,normalTex);
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
|
|
||||||
data0.rgb*=color.rgb;
|
|
||||||
|
|
||||||
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
|
||||||
data0.rgb = clamp(data0.rgb*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
|
||||||
|
|
||||||
vec4 data1 = clamp(encode(viewToWorld(normal), lm),0.,1.0);
|
|
||||||
|
|
||||||
gl_FragData[0] = vec4(encodeVec2(data0.x,data1.x),encodeVec2(data0.y,data1.y),encodeVec2(data0.z,data1.z),encodeVec2(data1.w,data0.w));
|
|
||||||
gl_FragData[1] = texture2DGradARB(specular, adjustedTexCoord.xy,dcdx,dcdy);
|
|
||||||
gl_FragData[1].a = 0.0;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
vec4 data0 = texture2D(texture, lmtexcoord.xy, Texture_MipMap_Bias);
|
|
||||||
|
|
||||||
vec4 specularMap = texture2D(specular, lmtexcoord.xy, Texture_MipMap_Bias);
|
|
||||||
gl_FragData[2].rgba = specularMap;
|
|
||||||
|
|
||||||
data0.rgb *= color.rgb + vec3(0,255,0);
|
|
||||||
|
|
||||||
float avgBlockLum = luma(texture2DLod(texture, lmtexcoord.xy,128).rgb*color.rgb);
|
|
||||||
data0.rgb = clamp(data0.rgb*pow(avgBlockLum,-0.33)*0.85,0.0,1.0);
|
|
||||||
|
|
||||||
#ifdef DISABLE_ALPHA_MIPMAPS
|
|
||||||
data0.a = texture2DLod(texture,lmtexcoord.xy,0).a;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if (data0.a > 0.1) data0.a = normalMat.a;
|
|
||||||
else data0.a = 0.0;
|
|
||||||
|
|
||||||
vec2 lm = lmtexcoord.zw;
|
|
||||||
|
|
||||||
#ifdef MC_NORMAL_MAP
|
|
||||||
vec3 normalTex = texture2D(normals, lmtexcoord.xy, Texture_MipMap_Bias).rgb;
|
|
||||||
// #ifndef SSAO
|
|
||||||
// #ifdef texture_ao
|
|
||||||
// lm *= clamp( pow(normalTex.b,0.4) ,0,1); // texture ao? i think? i dont know
|
|
||||||
// // lm *= clamp(0.5 + pow(normalTex.b,0.1) - max(normalTex.g,0),0,1) ; // texture ao? i think? i dont know
|
|
||||||
// #endif
|
|
||||||
// #endif
|
|
||||||
normalTex.xy = normalTex.xy*2.0-1.0;
|
|
||||||
normalTex.z = clamp(sqrt(1.0 - dot(normalTex.xy, normalTex.xy)),0.0,1.0);
|
|
||||||
normal = applyBump(tbnMatrix,normalTex);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// #ifdef MC_NORMAL_MAP
|
|
||||||
// normal =clamp( applyBump(tbnMatrix,texture2D(normals, lmtexcoord.xy,Texture_MipMap_Bias).rgb*2.0-1.0),-1.,1.);
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// vec4 data1 = clamp(noise/256.+encode(normal, lm),0.,1.0);
|
|
||||||
vec4 data1 = clamp(encode(viewToWorld(normal), lm),0.,1.0);
|
|
||||||
|
|
||||||
vec2 texcoord = gl_FragCoord.xy*lmtexcoord.xy;
|
|
||||||
vec4 data = texture2D(colortex1,texcoord);
|
|
||||||
vec4 dataUnpacked0 = vec4(decodeVec2(data.x),decodeVec2(data.y));
|
|
||||||
vec4 dataUnpacked1 = vec4(decodeVec2(data.z),decodeVec2(data.w));
|
|
||||||
|
|
||||||
gl_FragData[0] = vec4(encodeVec2(data0.x,data1.x), encodeVec2(data0.y,data1.y), encodeVec2(data0.z,data1.z), encodeVec2(data1.w,data0.w));
|
|
||||||
|
|
||||||
gl_FragData[1].a = 0.0;
|
|
||||||
|
|
||||||
|
|
||||||
// float emissionMat = specularMap.a < 1.0 ? specularMap.a * specularMap.a : 0.0;
|
|
||||||
// gl_FragData[0].rgb = mix(gl_FragData[0].rgb, vec3(emissionMat) ,1);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
@ -1,165 +1,5 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
|
||||||
#include "/lib/res_params.glsl"
|
|
||||||
#define WAVY_PLANTS
|
|
||||||
#define WAVY_STRENGTH 1.0 //[0.1 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0]
|
|
||||||
#define WAVY_SPEED 1.0 //[0.001 0.01 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1.0 1.25 1.5 2.0 3.0 4.0]
|
|
||||||
#define SEPARATE_AO
|
|
||||||
//#define POM
|
|
||||||
//#define USE_LUMINANCE_AS_HEIGHTMAP //Can generate POM on any texturepack (may look weird in some cases)
|
|
||||||
|
|
||||||
#define SSS_mode 1 // [1 2]
|
// #define WEATHER
|
||||||
|
#define PARTICLES
|
||||||
|
#include "gbuffers_all_particles.vsh"
|
||||||
#ifndef USE_LUMINANCE_AS_HEIGHTMAP
|
|
||||||
#ifndef MC_NORMAL_MAP
|
|
||||||
#undef POM
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef POM
|
|
||||||
#define MC_NORMAL_MAP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
!! DO NOT REMOVE !!
|
|
||||||
This code is from Chocapic13' shaders
|
|
||||||
Read the terms of modification and sharing before changing something below please !
|
|
||||||
!! DO NOT REMOVE !!
|
|
||||||
*/
|
|
||||||
|
|
||||||
varying vec4 lmtexcoord;
|
|
||||||
varying vec4 color;
|
|
||||||
varying vec4 normalMat;
|
|
||||||
#ifdef POM
|
|
||||||
varying vec4 vtexcoordam; // .st for add, .pq for mul
|
|
||||||
varying vec4 vtexcoord;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MC_NORMAL_MAP
|
|
||||||
varying vec4 tangent;
|
|
||||||
attribute vec4 at_tangent;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uniform float frameTimeCounter;
|
|
||||||
const float PI48 = 150.796447372*WAVY_SPEED;
|
|
||||||
float pi2wt = PI48*frameTimeCounter;
|
|
||||||
attribute vec4 mc_Entity;
|
|
||||||
uniform mat4 gbufferModelView;
|
|
||||||
uniform mat4 gbufferModelViewInverse;
|
|
||||||
attribute vec4 mc_midTexCoord;
|
|
||||||
uniform vec3 cameraPosition;
|
|
||||||
uniform vec2 texelSize;
|
|
||||||
uniform int framemod8;
|
|
||||||
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|
||||||
vec2(-1.,3.)/8.,
|
|
||||||
vec2(5.0,1.)/8.,
|
|
||||||
vec2(-3,-5.)/8.,
|
|
||||||
vec2(-5.,5.)/8.,
|
|
||||||
vec2(-7.,-1.)/8.,
|
|
||||||
vec2(3,7.)/8.,
|
|
||||||
vec2(7.,-7.)/8.);
|
|
||||||
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
|
|
||||||
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
|
|
||||||
vec4 toClipSpace3(vec3 viewSpacePosition) {
|
|
||||||
return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),-viewSpacePosition.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec2 calcWave(in vec3 pos) {
|
|
||||||
|
|
||||||
float magnitude = abs(sin(dot(vec4(frameTimeCounter, pos),vec4(1.0,0.005,0.005,0.005)))*0.5+0.72)*0.013;
|
|
||||||
vec2 ret = (sin(pi2wt*vec2(0.0063,0.0015)*4. - pos.xz + pos.y*0.05)+0.1)*magnitude;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 calcMovePlants(in vec3 pos) {
|
|
||||||
vec2 move1 = calcWave(pos );
|
|
||||||
float move1y = -length(move1);
|
|
||||||
return vec3(move1.x,move1y,move1.y)*5.*WAVY_STRENGTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 calcWaveLeaves(in vec3 pos, in float fm, in float mm, in float ma, in float f0, in float f1, in float f2, in float f3, in float f4, in float f5) {
|
|
||||||
|
|
||||||
float magnitude = abs(sin(dot(vec4(frameTimeCounter, pos),vec4(1.0,0.005,0.005,0.005)))*0.5+0.72)*0.013;
|
|
||||||
vec3 ret = (sin(pi2wt*vec3(0.0063,0.0224,0.0015)*1.5 - pos))*magnitude;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 calcMoveLeaves(in vec3 pos, in float f0, in float f1, in float f2, in float f3, in float f4, in float f5, in vec3 amp1, in vec3 amp2) {
|
|
||||||
vec3 move1 = calcWaveLeaves(pos , 0.0054, 0.0400, 0.0400, 0.0127, 0.0089, 0.0114, 0.0063, 0.0224, 0.0015) * amp1;
|
|
||||||
return move1*5.*WAVY_STRENGTH;
|
|
||||||
}
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
lmtexcoord.xy = (gl_MultiTexCoord0).xy;
|
|
||||||
#ifdef POM
|
|
||||||
vec2 midcoord = (gl_TextureMatrix[0] * mc_midTexCoord).st;
|
|
||||||
vec2 texcoordminusmid = lmtexcoord.xy-midcoord;
|
|
||||||
vtexcoordam.pq = abs(texcoordminusmid)*2;
|
|
||||||
vtexcoordam.st = min(lmtexcoord.xy,midcoord-texcoordminusmid);
|
|
||||||
vtexcoord.xy = sign(texcoordminusmid)*0.5+0.5;
|
|
||||||
#endif
|
|
||||||
vec2 lmcoord = gl_MultiTexCoord1.xy/255.;
|
|
||||||
lmtexcoord.zw = lmcoord;
|
|
||||||
|
|
||||||
vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz;
|
|
||||||
|
|
||||||
color = gl_Color;
|
|
||||||
|
|
||||||
bool istopv = gl_MultiTexCoord0.t < mc_midTexCoord.t;
|
|
||||||
#ifdef MC_NORMAL_MAP
|
|
||||||
tangent = vec4(normalize(gl_NormalMatrix *at_tangent.rgb),at_tangent.w);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
normalMat = vec4(normalize(gl_NormalMatrix *gl_Normal),mc_Entity.x == 10004 || mc_Entity.x == 10003 || mc_Entity.x == 10001 ? 0.5:1.0);
|
|
||||||
|
|
||||||
normalMat.a = mc_Entity.x == 10006? 0.6 : normalMat.a;
|
|
||||||
normalMat.a = mc_Entity.x == 10007 ? 0.55 : normalMat.a;
|
|
||||||
|
|
||||||
normalMat.a = mc_Entity.x == 10005 ? 0.9 : normalMat.a;
|
|
||||||
normalMat.a = mc_Entity.x == 10009 ? 0.8 : normalMat.a;
|
|
||||||
normalMat.a = mc_Entity.x == 99 ? 0.65 : normalMat.a;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef WAVY_PLANTS
|
|
||||||
if ((mc_Entity.x == 10001 && istopv) && abs(position.z) < 64.0) {
|
|
||||||
vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz + cameraPosition;
|
|
||||||
worldpos.xyz += calcMovePlants(worldpos.xyz)*lmtexcoord.w - cameraPosition;
|
|
||||||
position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mc_Entity.x == 10003 && abs(position.z) < 64.0) {
|
|
||||||
vec3 worldpos = mat3(gbufferModelViewInverse) * position + gbufferModelViewInverse[3].xyz + cameraPosition;
|
|
||||||
worldpos.xyz += calcMoveLeaves(worldpos.xyz, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(1.0,0.2,1.0), vec3(0.5,0.1,0.5))*lmtexcoord.w - cameraPosition;
|
|
||||||
position = mat3(gbufferModelView) * worldpos + gbufferModelView[3].xyz;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mc_Entity.x == 100){
|
|
||||||
color.rgb = normalize(color.rgb)*sqrt(3.0);
|
|
||||||
normalMat.a = 0.9;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_Position = toClipSpace3(position);
|
|
||||||
#ifdef SEPARATE_AO
|
|
||||||
lmtexcoord.z *= sqrt(color.a);
|
|
||||||
lmtexcoord.w *= color.a;
|
|
||||||
#else
|
|
||||||
color.rgb*=color.a;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef TAA_UPSCALING
|
|
||||||
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
|
|
||||||
#endif
|
|
||||||
#ifdef TAA
|
|
||||||
gl_Position.xy += offsets[framemod8] * gl_Position.w * texelSize;
|
|
||||||
#endif
|
|
||||||
}
|
|
@ -3,6 +3,7 @@ value.indirect_effect.0 = Vanilla AO
|
|||||||
value.indirect_effect.1 = SSAO
|
value.indirect_effect.1 = SSAO
|
||||||
value.indirect_effect.2 = RTAO
|
value.indirect_effect.2 = RTAO
|
||||||
value.indirect_effect.3 = SSGI
|
value.indirect_effect.3 = SSGI
|
||||||
|
value.indirect_effect.4 = SSDO
|
||||||
|
|
||||||
option.ambient_colortype = Coloring Type
|
option.ambient_colortype = Coloring Type
|
||||||
value.ambient_colortype.0 = Temperature
|
value.ambient_colortype.0 = Temperature
|
||||||
|
@ -16,18 +16,10 @@ const float ozoneNumberDensity = airNumberDensity * ozoneConcentrationPeak;
|
|||||||
#define sky_atmosphereHeight 110e3
|
#define sky_atmosphereHeight 110e3
|
||||||
#define sky_scaleHeights vec2(8.0e3, 1.2e3)
|
#define sky_scaleHeights vec2(8.0e3, 1.2e3)
|
||||||
|
|
||||||
#define sky_mieg 0.80 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
#define sky_coefficientRayleighR 5.8 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
|
||||||
#define sky_coefficientRayleighG 1.35 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
|
||||||
#define sky_coefficientRayleighB 3.31 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
|
||||||
|
|
||||||
#define sky_coefficientRayleigh vec3(sky_coefficientRayleighR*1e-6, sky_coefficientRayleighG*1e-5, sky_coefficientRayleighB*1e-5)
|
#define sky_coefficientRayleigh vec3(sky_coefficientRayleighR*1e-6, sky_coefficientRayleighG*1e-5, sky_coefficientRayleighB*1e-5)
|
||||||
|
|
||||||
|
|
||||||
#define sky_coefficientMieR 3.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
|
||||||
#define sky_coefficientMieG 3.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
|
||||||
#define sky_coefficientMieB 3.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
|
||||||
|
|
||||||
#define sky_coefficientMie vec3(sky_coefficientMieR*1e-6, sky_coefficientMieG*1e-6, sky_coefficientMieB*1e-6) // Should be >= 2e-6
|
#define sky_coefficientMie vec3(sky_coefficientMieR*1e-6, sky_coefficientMieG*1e-6, sky_coefficientMieB*1e-6) // Should be >= 2e-6
|
||||||
const vec3 sky_coefficientOzone = (ozoneCrossSection * (ozoneNumberDensity * 0.2e-6)); // ozone cross section * (ozone number density * (cm ^ 3))
|
const vec3 sky_coefficientOzone = (ozoneCrossSection * (ozoneNumberDensity * 0.2e-6)); // ozone cross section * (ozone number density * (cm ^ 3))
|
||||||
|
|
||||||
@ -39,35 +31,10 @@ const float sky_atmosphereRadiusSquared = sky_atmosphereRadius * sky_atmosphereR
|
|||||||
#define sky_coefficientsScattering mat2x3(sky_coefficientRayleigh, sky_coefficientMie)
|
#define sky_coefficientsScattering mat2x3(sky_coefficientRayleigh, sky_coefficientMie)
|
||||||
const mat3 sky_coefficientsAttenuation = mat3(sky_coefficientRayleigh , sky_coefficientMie, sky_coefficientOzone ); // commonly called the extinction coefficient
|
const mat3 sky_coefficientsAttenuation = mat3(sky_coefficientRayleigh , sky_coefficientMie, sky_coefficientOzone ); // commonly called the extinction coefficient
|
||||||
|
|
||||||
#define sun_illuminance 128000.0 //[10000.0 20000.0 30000.0 40000.0 50000.0 60000.0 70000.0 80000.0 90000.0 100000.0 110000.0 120000.0 130000.0 140000.0 160000.0]
|
|
||||||
#define moon_illuminance 200.0 //[0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 150.0 200.0 300.0 400.0 500.0 600.0 700.0 800.0 900.0 1000.0]
|
|
||||||
|
|
||||||
#define sunColorR 1.0 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
#define sunColorG 0.91 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
#define sunColorB 0.81 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
|
|
||||||
#define colortype 2 // 1 = RGB sliders for sun/moon color. 2 = blackbody. [1 2]
|
|
||||||
#define Sun_temp 7000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000]
|
|
||||||
#define Moon_temp 15000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000]
|
|
||||||
|
|
||||||
// #define sunColorBase mix( vec3(sunColorR,sunColorG,sunColorB), blackbody(50000), LowCoverage) * sun_illuminance
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define moonColorR 0.9080 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
#define moonColorG 0.9121 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
#define moonColorB 0.8948 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
|
|
||||||
#if colortype == 1
|
|
||||||
#define sunColorBase vec3(sunColorR,sunColorG,sunColorB) * sun_illuminance
|
|
||||||
#define moonColorBase vec3(moonColorR,moonColorG,moonColorB) * moon_illuminance //Fake Purkinje effect
|
|
||||||
#else
|
|
||||||
#define sunColorBase blackbody(Sun_temp) * sun_illuminance
|
|
||||||
#define moonColorBase blackbody(Moon_temp) * moon_illuminance //Fake Purkinje effect
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
float sky_rayleighPhase(float cosTheta) {
|
float sky_rayleighPhase(float cosTheta) {
|
||||||
const vec2 mul_add = vec2(0.1, 0.28) * rPI;
|
const vec2 mul_add = vec2(0.1, 0.28) * rPI;
|
||||||
return cosTheta * mul_add.x + mul_add.y; // optimized version from [Elek09], divided by 4 pi for energy conservation
|
return cosTheta * mul_add.x + mul_add.y; // optimized version from [Elek09], divided by 4 pi for energy conservation
|
||||||
|
@ -1,29 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
const float ambientOcclusionLevel = 0.15; //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const float sunPathRotation = -35; //[-90 -89 -88 -87 -86 -85 -84 -83 -82 -81 -80 -79 -78 -77 -76 -75 -74 -73 -72 -71 -70 -69 -68 -67 -66 -65 -64 -63 -62 -61 -60 -59 -58 -57 -56 -55 -54 -53 -52 -51 -50 -49 -48 -47 -46 -45 -44 -43 -42 -41 -40 -39 -38 -37 -36 -35 -34 -33 -32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 ]
|
|
||||||
|
|
||||||
const int shadowMapResolution = 2048; //Will probably crash at 16 384 [512 768 1024 1536 2048 3172 4096 8192 16384]
|
|
||||||
const float shadowDistance = 69.; //[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 ] Not linear at all when shadowDistanceRenderMul is set to -1.0, 175.0 is enough for 40 render distance
|
|
||||||
const float shadowDistanceRenderMul = -1.0; //[-1.0 1.0] Can help to increase shadow draw distance when set to -1.0, at the cost of performance
|
|
||||||
|
|
||||||
#define Variable_Penumbra_Shadows //Makes the shadows more blurry the more distant they are to objects (costs fps)
|
|
||||||
#define VPS_Search_Samples 4 //The number of samples used to find occluders [4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]
|
|
||||||
#define Min_Shadow_Filter_Radius 5.0 //If Variable_Penumbra_Shadows are not used, will be used as shadow filter size. [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
|
||||||
#define Max_Shadow_Filter_Radius 30.0 //Not used if Variable_Penumbra_Shadows are not used. Will cause issues at too high values [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
|
||||||
#define Max_Filter_Depth 20.0 //Distance to the occluder at which the shadow filter size reaches its maximum. [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
|
||||||
#define SCREENSPACE_CONTACT_SHADOWS //Raymarch towards the sun in screen-space, in order to cast shadows outside of the shadow map or at the contact of objects. Can get really expensive at high resolutions.
|
|
||||||
#define SHADOW_FILTER_SAMPLE_COUNT 13 // Number of samples used to filter the actual shadows [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 ]
|
|
||||||
|
|
||||||
// #define SSGI
|
|
||||||
#define RAY_COUNT 4 // [1 2 3 4 5 6 7 8 9 10 12 14 16 18 21 24 28 32 37 43 49 57 65 75 86 100]
|
|
||||||
#define STEPS 8 // [ 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99]
|
|
||||||
#define STEP_LENGTH 12. // [ 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30.]
|
|
||||||
#define SubSurfaceScattering
|
|
||||||
|
|
||||||
const float k = 1.8;
|
const float k = 1.8;
|
||||||
const float d0 = 0.04;
|
const float d0 = 0.04;
|
||||||
const float d1 = 0.61;
|
const float d1 = 0.61;
|
||||||
|
@ -1,100 +0,0 @@
|
|||||||
// #define Biome_specific_environment // makes the fog density and color look unique in certain biomes. (swamps, jungles, lush caves, giant pines, dark forests)
|
|
||||||
// #define Jungle_fog_strength 1.0 // how strong the fog gets there. set to zero to have normal fog [0.0 0.25 0.50 0.75 1.0]
|
|
||||||
// #define Swamp_fog_strength 1.0 // how strong the fog gets there. set to zero to have normal fog [0.0 0.25 0.50 0.75 1.0]
|
|
||||||
// #define Lush_fog_strength 1.0 // how strong the fog gets there. set to zero to have normal fog [0.0 0.25 0.50 0.75 1.0]
|
|
||||||
|
|
||||||
// #define Time_of_day_fog // fog starts closer to you at sunrise/sunset + night
|
|
||||||
// #define Rain_fog // rain fog.
|
|
||||||
// #define Lightmap_based_fog // fog that changes lighting based on the light from the sky. so if you're in a cave, it changes. if you go to the surface, its mostly normal
|
|
||||||
|
|
||||||
// #define Swamp_R 0.9 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
// #define Swamp_G 1.0 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
// #define Swamp_B 0.35 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
// #define Jungle_R 0.5 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
// #define Jungle_G 1.0 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
// #define Jungle_B 0.8 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
// #define override_R 0.5 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
// #define override_G 1.0 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
// #define override_B 0.8 // the color of the fog. only effects this specific biome [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
|
||||||
|
|
||||||
// #define Swamp_cloudyfog_Density 25. // how dense or thick the cloudy fog is. only effects this specific biome [0. 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 70. 75. 80. 85. 90. 95. 100.]
|
|
||||||
// #define Jungle_Cloudy_Fog_Density 10. // how dense or thick the cloudy fog is. only effects this specific biome [0. 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 70. 75. 80. 85. 90. 95. 100.]
|
|
||||||
// #define override_Cloudy_Fog_Density 1. // how dense or thick the cloudy fog is. only effects this specific biome [0. 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 70. 75. 80. 85. 90. 95. 100.]
|
|
||||||
|
|
||||||
// #define Swamp_UniformFog_Density 15. // how dense or thick the uniform fog is. only effects this specific biome [0. 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 70. 75. 80. 85. 90. 95. 100.]
|
|
||||||
// #define Jungle_Uniform_Fog_Density 10. //how dense or thick the uniform fog is. only effects this specific biome [0. 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 70. 75. 80. 85. 90. 95. 100.]
|
|
||||||
// #define override_Uniform_Fog_Density 1. //how dense or thick the uniform fog is. only effects this specific biome [0. 5. 10. 15. 20. 25. 30. 35. 40. 45. 50. 55. 60. 65. 70. 75. 80. 85. 90. 95. 100.]
|
|
||||||
|
|
||||||
// #define Swamp_Mie 0.75 // control the size of the peak of light around the sun in the fog. only effects this specific biome [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
// #define Jungle_Mie 0.75 // control the size of the peak of light around the sun in the fog. only effects this specific biome [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
// #define override_Mie 1.0 // control the size of the peak of light around the sun in the fog. only effects this specific biome [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
|
|
||||||
// #define Swamp_Sun_Strength 1.0 // control how strong the sun shines through fog. only effects this specific biome [0.0 0.25 0.50 0.75 1.0 1.25 1.50 1.75 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
|
|
||||||
// #define Jungle_Sun_Strength 1.0 // control how strong the sun shines through fog. only effects this specific biome [0.0 0.25 0.50 0.75 1.0 1.25 1.50 1.75 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
|
|
||||||
// #define override_Sun_Strength 1.0 // control how strong the sun shines through fog. only effects this specific biome [0.0 0.25 0.50 0.75 1.0 1.25 1.50 1.75 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
|
|
||||||
|
|
||||||
// #define Swamp_Bloomy_Fog 2.0 // control how bloomy the fog looks. only effects this specific biome [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
|
|
||||||
// #define Jungle_Bloomy_Fog 3.0 // control how bloomy the fog looks. only effects this specific biome [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
|
|
||||||
// #define override_Bloomy_Fog 1.0 // control how bloomy the fog looks. only effects this specific biome [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
|
|
||||||
|
|
||||||
// #define Swamp_cloudyfog_height 30 // controll the fade away at the top of the fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
// #define Jungle_cloudyfog_fade 30 // controll the fade away at the top of the fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
// #define override_cloudyfog_fade 50 // controll the fade away at the top of the fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
|
|
||||||
// #define Swamp_uniformfog_height 10 // controll the fade away at the top of the fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
// #define Jungle_uniformfog_fade 10 // controll the fade away at the top of the fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
// #define override_uniformfog_fade 50 // controll the fade away at the top of the fog [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
|
|
||||||
|
|
||||||
// #define override_fog 0 // override the fog that exists everywhere with your own [0 1]
|
|
||||||
|
|
||||||
// // uniform int isEyeInWater;
|
|
||||||
// // uniform float blindness;
|
|
||||||
// // uniform float rainStrength;
|
|
||||||
// // uniform ivec2 eyeBrightnessSmooth;
|
|
||||||
// // uniform float eyeAltitude;
|
|
||||||
// // uniform int worldTime;
|
|
||||||
|
|
||||||
// uniform float isJungles;
|
|
||||||
// uniform float isSwamps;
|
|
||||||
// uniform float isLush;
|
|
||||||
// uniform float isDeserts;
|
|
||||||
|
|
||||||
// // float timething = (worldTime%24000)*1.0;
|
|
||||||
// // float TimeOfDayFog = clamp((1.0 - clamp( timething-11000,0.0,2000.0)/2000.) * (clamp(timething,0.0,2000.0)/2000.) ,0.0,1.0);
|
|
||||||
|
|
||||||
// // fuck you
|
|
||||||
// #ifdef Biome_specific_environment
|
|
||||||
// float SWAMPS = isSwamps;
|
|
||||||
// float JUNGLES = isJungles;
|
|
||||||
// float LUSHCAVE = isLush;
|
|
||||||
// float DESERTS = isDeserts;
|
|
||||||
// float OVERRIDE = max(override_fog - (SWAMPS + JUNGLES),0);
|
|
||||||
// #else
|
|
||||||
// float OVERRIDE = 0;
|
|
||||||
// float SWAMPS = 0;
|
|
||||||
// float JUNGLES = 0;
|
|
||||||
// float LUSHCAVE = 0;
|
|
||||||
// float DESERTS = 0;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// // all the fog settings that do various things.
|
|
||||||
// float[8] Biome_Fog_Properties = float[8](
|
|
||||||
// /*[0] biome check*/ SWAMPS*Swamp_fog_strength + JUNGLES*Jungle_fog_strength + OVERRIDE
|
|
||||||
// /*[1] cloudy fog density*/ ,SWAMPS*Swamp_cloudyfog_Density + JUNGLES*Jungle_Cloudy_Fog_Density + OVERRIDE*override_cloudyfog_fade
|
|
||||||
// /*[2] uniform fog density*/ ,SWAMPS*Swamp_UniformFog_Density + JUNGLES*Jungle_Uniform_Fog_Density + OVERRIDE*override_Uniform_Fog_Density
|
|
||||||
// /*[3] sunlight strength*/ ,SWAMPS*Swamp_Sun_Strength + JUNGLES*Jungle_Sun_Strength + OVERRIDE*override_Sun_Strength
|
|
||||||
// /*[4] bloomy fog strength*/ ,SWAMPS*Swamp_Bloomy_Fog + JUNGLES*Jungle_Bloomy_Fog + OVERRIDE*override_Bloomy_Fog
|
|
||||||
// /*[5] fog mie size */ ,SWAMPS*Swamp_Mie + JUNGLES*Jungle_Mie + OVERRIDE*override_Mie
|
|
||||||
// /*[6] cloudy fog fade */ ,SWAMPS*Swamp_cloudyfog_height + JUNGLES*Jungle_cloudyfog_fade + OVERRIDE*override_Cloudy_Fog_Density
|
|
||||||
// /*[7] uniform fog fade */ ,SWAMPS*Swamp_uniformfog_height + JUNGLES*Jungle_uniformfog_fade + OVERRIDE*override_uniformfog_fade
|
|
||||||
// );
|
|
||||||
|
|
||||||
// // ??? ive no clue what this one does ngl
|
|
||||||
// vec3 Biome_FogColor = vec3(
|
|
||||||
// SWAMPS*Swamp_R + JUNGLES*Jungle_R + OVERRIDE*override_R
|
|
||||||
// ,SWAMPS*Swamp_G + JUNGLES*Jungle_G + OVERRIDE*override_G
|
|
||||||
// ,SWAMPS*Swamp_B + JUNGLES*Jungle_B + OVERRIDE*override_B
|
|
||||||
// );
|
|
@ -1,46 +1,18 @@
|
|||||||
// this file contains all things for seasons, weather, and biome specific settings.
|
// this file contains all things for seasons, weather, and biome specific settings.
|
||||||
// i gotta start centralizing shit someday.
|
// i gotta start centralizing shit someday.
|
||||||
|
|
||||||
#define Seasons
|
|
||||||
#define Season_Length 24 // how long each season lasts in minecraft days. 91 is roughly how long each season is in reality. 1 will make a year last 4 days [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91]
|
|
||||||
// #define Snowy_Winter // snow in the winter, yes or no?
|
|
||||||
|
|
||||||
#define Summer_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
uniform float Day;
|
||||||
#define Summer_G 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Summer_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Summer_Leaf_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Summer_Leaf_G 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Summer_Leaf_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
|
|
||||||
#define Fall_R 1.5 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
// it's so symmetrical~
|
||||||
#define Fall_G 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
float day0 = clamp(clamp(Day, 0.0,1.0)*clamp(2-Day, 0.0,1.0),0.0,1.0);
|
||||||
#define Fall_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
float day1 = clamp(clamp(Day-1, 0.0,1.0)*clamp(3-Day, 0.0,1.0),0.0,1.0);
|
||||||
#define Fall_Leaf_R 1.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
float day2 = clamp(clamp(Day-2, 0.0,1.0)*clamp(4-Day, 0.0,1.0),0.0,1.0);
|
||||||
#define Fall_Leaf_G 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
float day3 = clamp(clamp(Day-3, 0.0,1.0)*clamp(5-Day, 0.0,1.0),0.0,1.0);
|
||||||
#define Fall_Leaf_B 0.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
float day4 = clamp(clamp(Day-4, 0.0,1.0)*clamp(6-Day, 0.0,1.0),0.0,1.0);
|
||||||
|
float day5 = clamp(clamp(Day-5, 0.0,1.0)*clamp(7-Day, 0.0,1.0),0.0,1.0);
|
||||||
#define Winter_R 1.2 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
float day6 = clamp(clamp(Day-6, 0.0,1.0)*clamp(8-Day, 0.0,1.0),0.0,1.0);
|
||||||
#define Winter_G 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
float day7 = clamp(clamp(Day-7, 0.0,1.0)*clamp(9-Day, 0.0,1.0),0.0,1.0);
|
||||||
#define Winter_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Winter_Leaf_R 1.2 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Winter_Leaf_G 0.5 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Winter_Leaf_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
|
|
||||||
#define Spring_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Spring_G 0.9 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Spring_B 1.1 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Spring_Leaf_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Spring_Leaf_G 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
#define Spring_Leaf_B 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
|
||||||
|
|
||||||
|
|
||||||
#define Daily_Weather // different skies for different days, and fog.
|
|
||||||
#define WeatherDay -1 // [-1 0 1 2 3 4 5 6 7]
|
|
||||||
|
|
||||||
#define cloudCoverage 0.4 // Cloud coverage [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
|
|
||||||
#define Rain_coverage 0.6 // how much the coverage of the clouds change during rain [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 3.0 4.0 5.0]
|
|
||||||
|
|
||||||
#define Biome_specific_environment // makes the fog density and color look unique in certain biomes. (swamps, jungles, lush caves, giant pines, dark forests)
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -102,6 +74,8 @@
|
|||||||
////////////////////////////// DAILY WEATHER //////////////////////////////////
|
////////////////////////////// DAILY WEATHER //////////////////////////////////
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef WEATHERCLOUDS
|
#ifdef WEATHERCLOUDS
|
||||||
uniform float CumulusCoverage;
|
uniform float CumulusCoverage;
|
||||||
uniform float CirrusCoverage;
|
uniform float CirrusCoverage;
|
||||||
@ -111,26 +85,35 @@
|
|||||||
float Coverage
|
float Coverage
|
||||||
){
|
){
|
||||||
|
|
||||||
#ifdef Daily_Weather
|
// #ifdef Daily_Weather
|
||||||
int W_DAY = WeatherDay;
|
// int W_DAY = WeatherDay;
|
||||||
|
|
||||||
if(W_DAY > -1) {
|
// if(W_DAY > -1) {
|
||||||
if(W_DAY == 0) Coverage += 0.1;
|
// if(W_DAY == 0) Coverage += 0.1;
|
||||||
if(W_DAY == 1) Coverage += 0.5;
|
// if(W_DAY == 1) Coverage += 0.5;
|
||||||
if(W_DAY == 2) Coverage += 0.2;
|
// if(W_DAY == 2) Coverage += 0.2;
|
||||||
if(W_DAY == 3) Coverage += 0.8;
|
// if(W_DAY == 3) Coverage += 0.8;
|
||||||
if(W_DAY == 4) Coverage += 0.1;
|
// if(W_DAY == 4) Coverage += 0.1;
|
||||||
if(W_DAY == 5) Coverage += 0.6;
|
// if(W_DAY == 5) Coverage += 0.6;
|
||||||
if(W_DAY == 6) Coverage += 0.0;
|
// if(W_DAY == 6) Coverage += 0.0;
|
||||||
if(W_DAY == 7) Coverage += 1.0;
|
// if(W_DAY == 7) Coverage += 1.0;
|
||||||
}else{
|
// }else{
|
||||||
Coverage += mix(CumulusCoverage, Rain_coverage, rainStrength);
|
// Coverage += mix(CumulusCoverage, Rain_coverage, rainStrength);
|
||||||
}
|
// }
|
||||||
|
// #else
|
||||||
|
// Coverage += mix(cloudCoverage, Rain_coverage, rainStrength);
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
#ifdef Daily_Weather
|
||||||
|
Coverage += day0 * 0.3 + day1 * 0.8 + day2 * 0.2 + day3 * 0.0 + day4 * 0.8 + day5 * 0.5 + day6 * -0.5 + day7 * 0.6;
|
||||||
#else
|
#else
|
||||||
Coverage += mix(cloudCoverage, Rain_coverage, rainStrength);
|
Coverage += cloudCoverage;
|
||||||
|
// Coverage = mix(Coverage, Rain_coverage, rainStrength);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return Coverage;
|
return Coverage;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DailyWeather_HighAltitude(
|
void DailyWeather_HighAltitude(
|
||||||
@ -165,21 +148,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Daily_Weather
|
#ifdef Daily_Weather
|
||||||
uniform float Day;
|
|
||||||
|
|
||||||
void DailyWeather_FogDensity(
|
void DailyWeather_FogDensity(
|
||||||
inout vec4 UniformDensity,
|
inout vec4 UniformDensity,
|
||||||
inout vec4 CloudyDensity
|
inout vec4 CloudyDensity
|
||||||
){
|
){
|
||||||
// it's so symmetrical~
|
|
||||||
float day0 = clamp(clamp(Day, 0.0,1.0)*clamp(2-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
float day1 = clamp(clamp(Day-1, 0.0,1.0)*clamp(3-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
float day2 = clamp(clamp(Day-2, 0.0,1.0)*clamp(4-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
float day3 = clamp(clamp(Day-3, 0.0,1.0)*clamp(5-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
float day4 = clamp(clamp(Day-4, 0.0,1.0)*clamp(6-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
float day5 = clamp(clamp(Day-5, 0.0,1.0)*clamp(7-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
float day6 = clamp(clamp(Day-6, 0.0,1.0)*clamp(8-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
float day7 = clamp(clamp(Day-7, 0.0,1.0)*clamp(9-Day, 0.0,1.0),0.0,1.0);
|
|
||||||
|
|
||||||
// set fog Profiles for each of the 8 days in the cycle.
|
// set fog Profiles for each of the 8 days in the cycle.
|
||||||
// U = uniform fog || C = cloudy fog
|
// U = uniform fog || C = cloudy fog
|
||||||
@ -256,8 +229,8 @@
|
|||||||
float Night = clamp((Time-13000)/2000,0,1) * clamp((23000-Time)/2000,0,1) ;
|
float Night = clamp((Time-13000)/2000,0,1) * clamp((23000-Time)/2000,0,1) ;
|
||||||
|
|
||||||
// set densities. morn, noon, even, night
|
// set densities. morn, noon, even, night
|
||||||
vec4 UniformDensity = vec4(1.0, 0.0, 1.0, 10.0);
|
vec4 UniformDensity = vec4(0.0, 0.0, 0.0, 0.0);
|
||||||
vec4 CloudyDensity = vec4(5.0, 0.0, 5.0, 25.0);
|
vec4 CloudyDensity = vec4(0.0, 0.0, 0.0, 0.0);
|
||||||
|
|
||||||
#ifdef Daily_Weather
|
#ifdef Daily_Weather
|
||||||
DailyWeather_FogDensity(UniformDensity, CloudyDensity); // let daily weather influence fog densities.
|
DailyWeather_FogDensity(UniformDensity, CloudyDensity); // let daily weather influence fog densities.
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#define TAA
|
|
||||||
// #define TAA_UPSCALING // Lowers render resolution and uses TAA to combine several lower resolution images (greatly improves performance). USE THIS INSTEAD OF SHADER RENDER QUALITY OPTION IF YOU WANT TO INCREASE FPS (Leave it to 1). IF YOU WANT TO INCREASE QUALITY DISABLE THIS AND INCREASE SHADER RENDER QUALITY
|
|
||||||
#ifndef TAA
|
#ifndef TAA
|
||||||
#undef TAA_UPSCALING
|
#undef TAA_UPSCALING
|
||||||
#endif
|
#endif
|
||||||
@ -17,4 +15,4 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BLOOM_QUALITY 0.5 // Reduces the resolution at which bloom is computed. (0.5 = half of default resolution) [0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1. ]
|
#define BLOOM_QUALITY 0.5 // Reduces the resolution at which bloom is computed. (0.5 = half of default resolution) [0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1. ]
|
||||||
#define VL_RENDER_RESOLUTION 0.5 // Reduces the resolution at which volumetric fog is computed. (0.5 = half of default resolution) [0.25 0.5 1.0]
|
#define VL_RENDER_RESOLUTION 0.5 // Reduces the resolution at which volumetric fog is computed. (0.5 = half of default resolution) [0.25 0.5 1.0]
|
@ -1,45 +1,267 @@
|
|||||||
#define Moon_temp 15000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000]
|
//#define SHADOW_FRUSTRUM_CULLING // BROKEN IN 1.17+. If enabled, removes most of the blocks during shadow rendering that would not cast shadows on the player field of view. Improves performance but can be sometimes incorrect and causes flickering shadows on distant occluders
|
||||||
|
#define WAVY_PLANTS
|
||||||
|
#define WAVY_STRENGTH 1.0 //[0.1 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0]
|
||||||
|
#define WAVY_SPEED 1.0 //[0.001 0.01 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1.0 1.25 1.5 2.0 3.0 4.0]
|
||||||
#define CAVE_LIGHT_LEAK_FIX // Hackish way to remove sunlight incorrectly leaking into the caves. Can inacurrately create shadows in some places
|
#define SHADOW_DISABLE_ALPHA_MIPMAPS // Disables mipmaps on the transparency of alpha-tested things like foliage, may cost a few fps in some cases
|
||||||
#define CLOUDS_SHADOWS
|
#define Stochastic_Transparent_Shadows // Highly recommanded to enable SHADOW_DISABLE_ALPHA_MIPMAPS with it. Uses noise to simulate transparent objects' shadows (not colored). It is also recommended to increase Min_Shadow_Filter_Radius with this.
|
||||||
#define CLOUDS_QUALITY 0.5 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
#define SCREENSPACE_REFLECTIONS //can be really expensive at high resolutions/render quality, especially on ice
|
||||||
#define TORCH_R 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define SSR_STEPS 30 //[10 15 20 25 30 35 40 50 100 200 400]
|
||||||
#define TORCH_G 0.75 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define SUN_MICROFACET_SPECULAR // If enabled will use realistic rough microfacet model, else will just reflect the sun. No performance impact.
|
||||||
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define USE_QUARTER_RES_DEPTH // Uses a quarter resolution depth buffer to raymarch screen space reflections, improves performance but may introduce artifacts
|
||||||
|
#define saturate(x) clamp(x,0.0,1.0)
|
||||||
#define ambient_colortype 0 // Toggle which method you want to change the color of ambient light with. [0 1]
|
#define Dirt_Amount 0.14 //How much dirt there is in water [0.0 0.04 0.08 0.12 0.16 0.2 0.24 0.28 0.32 0.36 0.4 0.44 0.48 0.52 0.56 0.6 0.64 0.68 0.72 0.76 0.8 0.84 0.88 0.92 0.96 1.0 1.04 1.08 1.12 1.16 1.2 1.24 1.28 1.32 1.36 1.4 1.44 1.48 1.52 1.56 1.6 1.64 1.68 1.72 1.76 1.8 1.84 1.88 1.92 1.96 2.0 ]
|
||||||
|
#define Dirt_Scatter_R 0.7 //How much dirt diffuses red [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
||||||
|
#define Dirt_Scatter_G 0.7 //How much dirt diffuses green [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
||||||
|
#define Dirt_Scatter_B 0.7 //How much dirt diffuses blue [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
||||||
|
#define Dirt_Absorb_R 1.65 //How much dirt absorbs red [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
||||||
|
#define Dirt_Absorb_G 1.85 //How much dirt absorbs green [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
||||||
|
#define Dirt_Absorb_B 2.05 //How much dirt absorbs blue [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
||||||
|
#define Water_Absorb_R 0.2629 //How much water absorbs red [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
||||||
|
#define Water_Absorb_G 0.0565 //How much water absorbs green [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
||||||
|
#define Water_Absorb_B 0.01011 //How much water absorbs blue [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
||||||
|
#define Dirt_Mie_Phase 0.4 //Values close to 1 will create a strong peak around the sun and weak elsewhere, values close to 0 means uniform fog. [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
||||||
|
#define rayMarchSampleCount 2 //Number of samples used for the volumetric underwater fog [1 2 3 4 6 8 12 16 32 64]
|
||||||
|
#define Water_Top_Layer 62.90 // When under water and when lightMapDepthEstimate is turned off. Assumes the top layer of the water is at this height (minecraft y position) for underwater lighting calculations. If not set correctly, underwater will look incorrect.[0.90 1.90 2.90 3.90 4.90 5.90 6.90 7.90 8.90 9.90 10.90 11.90 12.90 13.90 14.90 15.90 16.90 17.90 18.90 19.90 20.90 21.90 22.90 23.90 24.90 25.90 26.90 27.90 28.90 29.90 30.90 31.90 32.90 33.90 34.90 35.90 36.90 37.90 38.90 39.90 40.90 41.90 42.90 43.90 44.90 45.90 46.90 47.90 48.90 49.90 50.90 51.90 52.90 53.90 54.90 55.90 56.90 57.90 58.90 59.90 60.90 61.90 62.90 63.90 64.90 65.90 66.90 67.90 68.90 69.90 70.90 71.90 72.90 73.90 74.90 75.90 76.90 77.90 78.90 79.90 80.90 81.90 82.90 83.90 84.90 85.90 86.90 87.90 88.90 89.90 90.90 91.90 92.90 93.90 94.90 95.90 96.90 97.90 98.90 99.90 100.90 101.90 102.90 103.90 104.90 105.90 106.90 107.90 108.90 109.90 110.90 111.90 112.90 113.90 114.90 115.90 116.90 117.90 118.90 119.90 120.90 121.90 122.90 123.90 124.90 125.90 126.90 127.90 128.90 129.90 130.90 131.90 132.90 133.90 134.90 135.90 136.90 137.90 138.90 139.90 140.90 141.90 142.90 143.90 144.90 145.90 146.90 147.90 148.90 149.90 150.90 151.90 152.90 153.90 154.90 155.90 156.90 157.90 158.90 159.90 160.90 161.90 162.90 163.90 164.90 165.90 166.90 167.90 168.90 169.90 170.90 171.90 172.90 173.90 174.90 175.90 176.90 177.90 178.90 179.90 180.90 181.90 182.90 183.90 184.90 185.90 186.90 187.90 188.90 189.90 190.90 191.90 192.90 193.90 194.90 195.90 196.90 197.90 198.90 199.90]
|
||||||
|
//#define lightMapDepthEstimation // If turned off, will use the player eye position and the Water_Top_Layer option to determine how deep the player is in water. It can look wrong in a lot of cases, and using minecraft light levels instead improves this but will look worse in oceans, lakes and rivers.
|
||||||
|
#define Texture_MipMap_Bias -1.00 // Uses a another mip level for textures. When reduced will increase texture detail but may induce a lot of shimmering. [-5.00 -4.75 -4.50 -4.25 -4.00 -3.75 -3.50 -3.25 -3.00 -2.75 -2.50 -2.25 -2.00 -1.75 -1.50 -1.25 -1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
|
||||||
|
#define ambient_colortype 0 // 0 = temperature. 1 = rgb sliders [0 1]
|
||||||
#define ambient_temp 9000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 15000 50000]
|
#define ambient_temp 9000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 15000 50000]
|
||||||
#define ambient_brightness 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
|
||||||
#define AmbientLight_R 0.91 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define AmbientLight_R 0.91 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
#define AmbientLight_G 0.86 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define AmbientLight_G 0.86 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
#define AmbientLight_B 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define AmbientLight_B 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
// #define BorderFog // aaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
#define MIN_LIGHT_AMOUNT 1.0 //[0.0 0.5 1.0 1.5 2.0 3.0 4.0 5.0]
|
||||||
|
// #define Glass_Tint // multiply the background through glass by the color of the glass for a strong tint.
|
||||||
|
// #define ambientLight_only // THIS IS A DEBUG VIEW. turn the sunlight off. DOES NOT increase performance, the shadows are still working in the background
|
||||||
|
//#define Vanilla_like_water // vanilla water texture along with shader water stuff
|
||||||
|
#define SEPARATE_AO
|
||||||
|
//#define Horrible_slope_normals
|
||||||
|
//#define POM
|
||||||
|
//#define RTAO // I recommend turning ambientOcclusionLevel to zero with this on. like ssao, but rt, nicer, noiser, and slower. SSAO will turn OFF when this is ON
|
||||||
|
#define indirect_effect 1 // 0 = none. 1 = SSAO. 2 = RTAO. 3 = SSGI. [0 1 2 3 4]
|
||||||
|
#define mob_SSS
|
||||||
|
#define misc_block_SSS
|
||||||
|
#define POM_DEPTH 0.25 // [0.025 0.05 0.075 0.1 0.125 0.15 0.20 0.25 0.30 0.50 0.75 1.0] //Increase to increase POM strength
|
||||||
|
#define MAX_ITERATIONS 50 // [5 10 15 20 25 30 40 50 60 70 80 90 100 125 150 200 400] //Improves quality at grazing angles (reduces performance)
|
||||||
|
#define MAX_DIST 25.0 // [5.0 10.0 15.0 20.0 25.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 125.0 150.0 200.0 400.0] //Increases distance at which POM is calculated
|
||||||
|
#define DISABLE_ALPHA_MIPMAPS //Disables mipmaps on the transparency of alpha-tested things like foliage, may cost a few fps in some cases
|
||||||
|
// #define Porosity
|
||||||
|
#define SSAO // screen-space ambient occlusion.
|
||||||
|
#define texture_ao // ambient occlusion on the texture
|
||||||
|
#define Puddle_Size 1.0 // [0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5]
|
||||||
|
//#define BICUBIC_UPSCALING //Provides a better interpolation when using a render quality different of 1.0, slower
|
||||||
|
#define CONTRAST_ADAPTATIVE_SHARPENING
|
||||||
|
#define SHARPENING 0.35 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#define SATURATION 0.00 // Negative values desaturates colors, Positive values saturates color, 0 is no change [-1.0 -0.98 -0.96 -0.94 -0.92 -0.9 -0.88 -0.86 -0.84 -0.82 -0.8 -0.78 -0.76 -0.74 -0.72 -0.7 -0.68 -0.66 -0.64 -0.62 -0.6 -0.58 -0.56 -0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4 -0.38 -0.36 -0.34 -0.32 -0.3 -0.28 -0.26 -0.24 -0.22 -0.2 -0.18 -0.16 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 ]
|
||||||
|
#define CROSSTALK 0.0 // Desaturates bright colors and preserves saturation in darker areas (inverted if negative). Helps avoiding almsost fluorescent colors [-1.0 -0.98 -0.96 -0.94 -0.92 -0.9 -0.88 -0.86 -0.84 -0.82 -0.8 -0.78 -0.76 -0.74 -0.72 -0.7 -0.68 -0.66 -0.64 -0.62 -0.6 -0.58 -0.56 -0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4 -0.38 -0.36 -0.34 -0.32 -0.3 -0.28 -0.26 -0.24 -0.22 -0.2 -0.18 -0.16 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 ]
|
||||||
|
#define HQ_CLOUDS //Renders detailled clouds for viewport
|
||||||
|
#define CLOUDS_QUALITY 0.5 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
||||||
|
#define EXPOSURE_MULTIPLIER 1.0 //[0.25 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.1 1.2 1.3 1.4 1.5 2.0 3.0 4.0]
|
||||||
|
#define AUTO_EXPOSURE //Highly recommended to keep it on unless you want to take screenshots
|
||||||
|
#define Manual_exposure_value 1.0 // [0.000553 0.000581 0.000611 0.000642 0.000675 0.000710 0.000746 0.000784 0.000825 0.000867 0.000911 0.000958 0.001007 0.001059 0.001113 0.001170 0.001230 0.001294 0.001360 0.001430 0.001503 0.001580 0.001661 0.001746 0.001836 0.001930 0.002029 0.002133 0.002242 0.002357 0.002478 0.002605 0.002739 0.002879 0.003027 0.003182 0.003345 0.003517 0.003697 0.003887 0.004086 0.004296 0.004516 0.004748 0.004991 0.005247 0.005516 0.005799 0.006096 0.006409 0.006737 0.007083 0.007446 0.007828 0.008229 0.008651 0.009095 0.009561 0.010051 0.010567 0.011108 0.011678 0.012277 0.012906 0.013568 0.014264 0.014995 0.015764 0.016572 0.017422 0.018315 0.019254 0.020241 0.021279 0.022370 0.023517 0.024723 0.025991 0.027323 0.028724 0.030197 0.031745 0.033373 0.035084 0.036883 0.038774 0.040762 0.042852 0.045049 0.047358 0.049787 0.052339 0.055023 0.057844 0.060810 0.063927 0.067205 0.070651 0.074273 0.078081 0.082084 0.086293 0.090717 0.095369 0.100258 0.105399 0.110803 0.116484 0.122456 0.128734 0.135335 0.142274 0.149568 0.157237 0.165298 0.173773 0.182683 0.192049 0.201896 0.212247 0.223130 0.234570 0.246596 0.259240 0.272531 0.286504 0.301194 0.316636 0.332871 0.349937 0.367879 0.386741 0.406569 0.427414 0.449328 0.472366 0.496585 0.522045 0.548811 0.576949 0.606530 0.637628 0.670320 0.704688 0.740818 0.778800 0.818730 0.860707 0.904837 0.951229 1.0 1.051271 1.105170 1.161834 1.221402 1.284025 1.349858 1.419067 1.491824 1.568312 1.648721 1.733253 1.822118 1.915540 2.013752 2.117000 2.225540 2.339646 2.459603 2.585709 2.718281 2.857651 3.004166 3.158192 3.320116 3.490342 3.669296 3.857425 4.055199 4.263114 4.481689 4.711470 4.953032 5.206979 5.473947 5.754602 6.049647 6.359819 6.685894 7.028687 7.389056 7.767901 8.166169 8.584858 9.025013 9.487735 9.974182 10.48556 11.02317 11.58834 12.18249 ]
|
||||||
|
#define Exposure_Speed 1.0 //[0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 2.25 2.5 2.75 3.0 4.0 5.0]
|
||||||
|
#define DoF_Adaptation_Speed 1.00 // [0.20 0.21 0.23 0.24 0.25 0.27 0.29 0.30 0.32 0.34 0.36 0.39 0.41 0.43 0.46 0.49 0.52 0.55 0.59 0.62 0.66 0.70 0.74 0.79 0.84 0.89 0.94 1.00 1.06 1.13 1.20 1.27 1.35 1.43 1.52 1.61 1.71 1.82 1.93 2.05 2.18 2.31 2.45 2.60 2.76 2.93 3.11 3.30 3.51 3.72 3.95 4.19 4.45 4.73 5.02 5.33 5.65 6.00]
|
||||||
|
#define BASE_FOG_AMOUNT 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 10.0 20.0 30.0 50.0 100.0 150.0 200.0] Base fog amount amount (does not change the "cloudy" fog)
|
||||||
|
#define CLOUDY_FOG_AMOUNT 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
||||||
|
#define FOG_TOD_MULTIPLIER 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0] //Influence of time of day on fog amount
|
||||||
|
#define FOG_RAIN_MULTIPLIER 1.0 //[0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0] //Influence of rain on fog amount
|
||||||
|
#define Ambient_Mult 1.0 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.5 2.0 3.0 4.0 5.0 6.0 10.0]
|
||||||
|
#define Sky_Brightness 1.0 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.5 2.0 3.0 4.0 5.0 6.0 10.0]
|
||||||
|
#define TORCH_AMOUNT 1.0 //[0.0 0.5 0.75 1. 1.2 1.4 1.6 1.8 2.0]
|
||||||
|
#define TORCH_R 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define TORCH_G 0.75 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define FinalR 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
||||||
|
#define FinalG 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
||||||
|
#define FinalB 1.0 //[0.0 0.025315 0.051271 0.077884 0.105170 0.133148 0.161834 0.191246 0.221402 0.252322 0.284025 0.316530 0.349858 0.384030 0.419067 0.454991 0.491824 0.529590 0.568312 0.608014 0.648721 0.690458 0.733253 0.777130 0.822118 0.868245 0.915540 0.964032 1.013752 1.064731 1.117000 1.170592 1.225540 1.281880 1.339646 1.398875 1.459603 1.521868 1.585709 1.651167 1.718281 1.787095 1.857651 1.929992 2.004166 2.080216 2.158192 2.238142 2.320116 2.404166 2.490342 2.578701 2.669296 2.762185 2.857425 2.955076 3.055199 3.157857 3.263114 3.371035 3.481689 3.595143 3.711470 3.830741 3.953032 4.078419 4.206979 4.338795 4.473947 4.612521 4.754602 4.900281 5.049647 5.202795 5.359819 5.520819 5.685894 5.855148 6.028687 6.206619 6.389056 6.576110 6.767901 6.964546 7.166169 7.372897 7.584858 7.802185 8.025013 8.253482 8.487735 8.727919 8.974182 9.226680 9.485569 9.751013 10.02317 10.30222 10.58834 10.88170 11.18249 ]
|
||||||
|
#define Fake_purkinje
|
||||||
|
#define BLOOMY_FOG 2.0 //[0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 6.0 10.0 15.0 20.0]
|
||||||
|
#define BLOOM_STRENGTH 4.0 //[0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0]
|
||||||
|
#define TONEMAP ToneMap_Hejl2015 // Tonemapping operator [Tonemap_Uchimura HableTonemap reinhard Tonemap_Lottes ACESFilm]
|
||||||
|
//#define USE_ACES_COLORSPACE_APPROXIMATION // Do the tonemap in another colorspace
|
||||||
|
#define Purkinje_strength 1.0 // Simulates how the eye is unable to see colors at low light intensities. 0 = No purkinje effect at low exposures [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define Purkinje_R 0.4 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define Purkinje_G 0.7 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define Purkinje_B 1.0 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define Purkinje_Multiplier 5.0 // How much the purkinje effect increases brightness [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
||||||
|
//#define DOF //enable depth of field (blur on non-focused objects)
|
||||||
|
//#define HQ_DOF //Slow! Forces circular bokeh! Uses 4 times more samples with noise in order to remove sampling artifacts at great blur sizes.
|
||||||
|
//#define HEXAGONAL_BOKEH //disabled : circular blur shape - enabled : hexagonal blur shape
|
||||||
|
#define AUTOFOCUS // THE BRIGHTNESS SLIDER CAN CONTROL THE MANUAL FOCUS DISTANCE
|
||||||
|
//#define FAR_BLUR_ONLY // Removes DoF on objects closer to the camera than the focus point
|
||||||
|
//lens properties
|
||||||
|
#define focal 2.4 // Centimeters [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
||||||
|
#define aperture 0.8 // Centimeters [0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.05 1.1 1.15 1.2 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 1.8 1.85 1.9 1.95 2.0 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3.0 3.05 3.1 3.15 3.2 3.25 3.3 3.35 3.4 3.45 3.5 3.55 3.6 3.65 3.7 3.75 3.8 3.85 3.9 3.95 4.0 4.05 4.1 4.15 4.2 4.25 4.3 4.35 4.4 4.45 4.5 4.55 4.6 4.65 4.7 4.75 4.8 4.85 4.9 4.95 5.0 5.05 5.1 5.15 5.2 5.25 5.3 5.35 5.4 5.45 5.5 5.55 5.6 5.65 5.7 5.75 5.8 5.85 5.9 5.95 6.0 6.05 6.1 6.15 6.2 6.25 6.3 6.35 6.4 6.45 6.5 6.55 6.6 6.65 6.7 6.75 6.8 6.85 6.9 6.95 7.0 7.05 7.1 7.15 7.2 7.25 7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 7.7 7.75 7.8 7.85 7.9 7.95 8.0 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 8.45 8.5 8.55 8.6 8.65 8.7 8.75 8.8 8.85 8.9 8.95 9.0 9.05 9.1 9.15 9.2 9.25 9.3 9.35 9.4 9.45 9.5 9.55 9.6 9.65 9.7 9.75 9.8 9.85 9.9 9.95 ]
|
||||||
|
#define MANUAL_FOCUS 48.0 // If autofocus is turned off, sets the focus point (meters) [0.06948345122280154 0.07243975703425146 0.07552184450877376 0.07873506526686186 0.0820849986238988 0.08557746127787037 0.08921851740926011 0.09301448921066349 0.09697196786440505 0.10109782498721881 0.10539922456186433 0.10988363537639657 0.11455884399268773 0.11943296826671962 0.12451447144412296 0.129812176855438 0.1353352832366127 0.1410933807013415 0.1470964673929768 0.15335496684492847 0.1598797460796939 0.16668213447794653 0.17377394345044514 0.18116748694692214 0.18887560283756183 0.19691167520419406 0.20528965757990927 0.21402409717744744 0.22313016014842982 0.2326236579172927 0.2425210746356487 0.25283959580474646 0.26359713811572677 0.27481238055948964 0.2865047968601901 0.29869468928867837 0.3114032239145977 0.32465246735834974 0.3384654251067422 0.3528660814588489 0.36787944117144233 0.3835315728763107 0.39984965434484737 0.4168620196785084 0.4345982085070782 0.453089017280169 0.4723665527410147 0.49246428767540973 0.513417119032592 0.5352614285189903 0.5580351457700471 0.5817778142098083 0.6065306597126334 0.6323366621862497 0.6592406302004438 0.6872892787909722 0.7165313105737893 0.7470175003104326 0.7788007830714049 0.8119363461506349 0.8464817248906141 0.8824969025845955 0.9200444146293233 0.9591894571091382 1.0 1.0425469051899914 1.086904049521229 1.1331484530668263 1.1813604128656459 1.2316236423470497 1.2840254166877414 1.338656724353094 1.3956124250860895 1.4549914146182013 1.5168967963882134 1.5814360605671443 1.6487212707001282 1.7188692582893286 1.7920018256557555 1.8682459574322223 1.9477340410546757 2.030604096634748 2.117000016612675 2.2070718156067044 2.300975890892825 2.398875293967098 2.5009400136621287 2.6073472713092674 2.718281828459045 2.833936307694169 2.9545115270921065 3.080216848918031 3.211270543153561 3.347900166492527 3.4903429574618414 3.638846248353525 3.7936678946831774 3.955076722920577 4.123352997269821 4.298788906309526 4.4816890703380645 4.672371070304759 4.871165999245474 5.0784190371800815 5.29449005047003 5.51975421667673 5.754602676005731 5.999443210467818 6.254700951936329 6.5208191203301125 6.798259793203881 7.087504708082256 7.38905609893065 7.703437568215379 8.031194996067258 8.372897488127265 8.72913836372013 9.10053618607165 9.487735836358526 9.891409633455755 10.312258501325767 10.751013186076355 11.208435524800691 11.685319768402522 12.182493960703473 12.700821376227164 13.241202019156521 13.804574186067095 14.391916095149892 15.00424758475255 15.642631884188171 16.30817745988666 17.00203994009402 17.725424121461643 18.479586061009854 19.265835257097933 20.085536923187668 20.940114358348602 21.831051418620845 22.75989509352673 23.728258192205157 24.737822143832553 25.790339917193062 26.88763906446752 28.03162489452614 29.22428378123494 30.46768661252054 31.763992386181833 33.11545195869231 34.52441195350251 35.99331883562839 37.524723159600995 39.12128399815321 40.78577355933337 42.52108200006278 44.3302224444953 46.21633621589248 48.182698291098816 50.23272298708815 52.36996988945491 54.598150033144236 56.92113234615337 59.34295036739207 61.867809250367884 64.50009306485578 67.24437240923179 70.10541234668786 73.08818067910767 76.19785657297057 79.43983955226133 82.81975887399955 86.3434833026695 90.01713130052181 93.84708165144015 97.83998453682129 102.00277308269969 106.34267539816554 110.86722712598126 115.58428452718766 120.50203812241894 125.62902691361414 130.9741532108186 136.54669808981876 142.35633750745257 148.4131591025766 154.72767971186107 161.3108636308289 168.17414165184545 175.32943091211476 182.78915558614753 190.56626845863 198.67427341514983 ]
|
||||||
|
//#define NO_CLIP //Removes all anti-ghosting techniques used and creates a sharp image (good for still screenshots)
|
||||||
|
#define BLEND_FACTOR 0.05 //[0.01 0.02 0.03 0.04 0.05 0.06 0.08 0.1 0.12 0.14 0.16] higher values = more flickering but sharper image, lower values = less flickering but the image will be blurrier
|
||||||
|
#define MOTION_REJECTION 0.0 //[0.0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.5] //Higher values=sharper image in motion at the cost of flickering
|
||||||
|
#define ANTI_GHOSTING 0.0 //[0.0 0.25 0.5 0.75 1.0] High values reduce ghosting but may create flickering
|
||||||
|
#define FLICKER_REDUCTION 0.5 //[0.0 0.25 0.5 0.75 1.0] High values reduce flickering but may reduce sharpness
|
||||||
|
#define CLOSEST_VELOCITY //improves edge quality in motion at the cost of performance
|
||||||
|
// #define SCREENSHOT_MODE // go render mode and accumulate frames for as long as you want for max image quality.
|
||||||
|
// #define SPLIT_RENDER // AAAAAAAAAAAAAAAA
|
||||||
|
#define Refraction
|
||||||
|
#define Cave_fog // cave fog....
|
||||||
|
#define CaveFogFallOff 1.3 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
|
#define CaveFogColor_R 0.1 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define CaveFogColor_G 0.2 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
#define CaveFogColor_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
|
// #define display_LUT // aaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
#define CLOUDS_SHADOWS
|
||||||
|
#define VL_CLOUDS_SHADOWS // Casts shadows from clouds on VL (slow)
|
||||||
|
#define CLOUDS_SHADOWS_STRENGTH 1.0 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
||||||
|
#define VL_SAMPLES 8 //[4 6 8 10 12 14 16 20 24 30 40 50]
|
||||||
|
#define SEA_LEVEL 70 //[0 10 20 30 40 50 60 70 80 90 100 110 120 130 150 170 190] //The volumetric light uses an altitude-based fog density, this is where fog density is the highest, adjust this value according to your world.
|
||||||
|
#define ATMOSPHERIC_DENSITY 1.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 4.0 5.0 7.5 10.0 12.5 15.0 20.]
|
||||||
|
#define fog_mieg1 0.40 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
||||||
|
#define fog_mieg2 0.10 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
||||||
|
#define fog_coefficientRayleighR 5.8 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
||||||
|
#define fog_coefficientRayleighG 1.35 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
||||||
|
#define fog_coefficientRayleighB 3.31 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
||||||
|
#define fog_coefficientMieR 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
||||||
|
#define fog_coefficientMieG 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]intervalMult
|
||||||
|
#define fog_coefficientMieB 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
||||||
|
#define Cloudy_Fog_Density 5.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
||||||
|
#define Uniform_Fog_Density 1.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
||||||
|
#define uniformfog_fade 10 // does not change rain or cave fog [5 10 20 30 40 50 60 70 80 90 100]
|
||||||
|
#define cloudyfog_fade 10 // does not change rain or cave fog [5 10 20 30 40 50 60 70 80 90 100]
|
||||||
|
#define RainFog_amount 5 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
|
||||||
|
#define CaveFog_amount 5 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
|
||||||
|
#define cloudray_amount 0.2 // rain boost this [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
||||||
|
#define UniformFog_amount 1.0 // [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 10.0 20.0 30.0 50.0 100.0 150.0 200.0]
|
||||||
|
#define CloudyFog_amount 1.0 // [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0 10 20 30 40 50 100 500 10000]
|
||||||
|
#define TimeOfDayFog_multiplier 1.0 // Influence of time of day on fog amount [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
||||||
|
#define Haze_amount 1.0 // [0.0 0.2 0.4 0.6 0.8 1.0 1.25 1.5 1.75 2.0 3.0 4.0 5.0]
|
||||||
|
// #define fog_selfShadowing // make the fog cast a shadow onto itself
|
||||||
|
#define CAVE_LIGHT_LEAK_FIX // Hackish way to remove sunlight incorrectly leaking into the caves. Can inacurrately create shadows in some places
|
||||||
|
#define ambient_brightness 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
#define Sub_surface_scattering // (place the flashlight on your hand example here)
|
#define Sub_surface_scattering // (place the flashlight on your hand example here)
|
||||||
// #define LabPBR_subsurface_scattering
|
// #define LabPBR_subsurface_scattering
|
||||||
#define LabSSS_Curve 1.0 // i just really like how it looks at 2.0, so i made it an option. [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
#define LabSSS_Curve 1.0 // i just really like how it looks at 2.0, so i made it an option. [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
#define Strong_SSS_strength 45 // [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2 3 4 5 6 7 8 9 10 15 20 30 35 40 45 50]
|
#define Strong_SSS_strength 45 // [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2 3 4 5 6 7 8 9 10 15 20 30 35 40 45 50]
|
||||||
#define Medium_SSS_strength 30 // [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2 3 4 5 6 7 8 9 10 15 20 30 35 40 45 50]
|
#define Medium_SSS_strength 30 // [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2 3 4 5 6 7 8 9 10 15 20 30 35 40 45 50]
|
||||||
|
|
||||||
#define indirect_effect 1 // Choose what effect is applied to indirect light. [0 1 2 3]
|
|
||||||
#define AO_Strength 0.8 // strength of shadowed areas [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
#define AO_Strength 0.8 // strength of shadowed areas [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
#define GI_Strength 5.0 // strength of bounced light areas [ 1 2 3 4 5 6 7 8 9 10]
|
#define GI_Strength 1.0 // strength of bounced light areas [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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
// #define HQ_SSGI
|
// #define HQ_SSGI
|
||||||
|
|
||||||
|
|
||||||
// #define LabPBR_Emissives
|
// #define LabPBR_Emissives
|
||||||
#define Emissive_Brightness 10.0 // [1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 15. 20. 25. 30. 35. 40. 45. 50. 100.]
|
#define Emissive_Brightness 10.0 // [1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 15. 20. 25. 30. 35. 40. 45. 50. 100.]
|
||||||
#define Emissive_Curve 2.0 // yes i blatantly copied kappa here. [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 2.6 2.7 2.8 2.9 3.0 ]
|
#define Emissive_Curve 2.0 // yes i blatantly copied kappa here. [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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
|
|
||||||
#define Puddle_Size 1.0 // [0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5]
|
|
||||||
#define Puddles // yes
|
#define Puddles // yes
|
||||||
// #define Porosity
|
#define sky_mieg 0.80 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#define sky_coefficientRayleighR 5.8 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
||||||
|
#define sky_coefficientRayleighG 1.35 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
||||||
|
#define sky_coefficientRayleighB 3.31 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
||||||
|
#define sky_coefficientMieR 3.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
||||||
|
#define sky_coefficientMieG 3.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
||||||
|
#define sky_coefficientMieB 3.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7.0 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 ]
|
||||||
|
#define sun_illuminance 128000.0 //[10000.0 20000.0 30000.0 40000.0 50000.0 60000.0 70000.0 80000.0 90000.0 100000.0 110000.0 120000.0 130000.0 140000.0 160000.0]
|
||||||
|
#define moon_illuminance 200.0 //[0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 150.0 200.0 300.0 400.0 500.0 600.0 700.0 800.0 900.0 1000.0]
|
||||||
|
#define sunColorR 1.0 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#define sunColorG 0.91 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#define sunColorB 0.81 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#define colortype 2 // 1 = RGB sliders for sun/moon color. 2 = blackbody. [1 2]
|
||||||
|
#define Sun_temp 7000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000]
|
||||||
|
#define Moon_temp 15000 // [1000 2000 3000 4000 5000 6000 7000 8000 9000 10000]
|
||||||
|
#define moonColorR 0.9080 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#define moonColorG 0.9121 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#define moonColorB 0.8948 //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
#if colortype == 1
|
||||||
|
#define sunColorBase vec3(sunColorR,sunColorG,sunColorB) * sun_illuminance
|
||||||
|
#define moonColorBase vec3(moonColorR,moonColorG,moonColorB) * moon_illuminance //Fake Purkinje effect
|
||||||
|
#else
|
||||||
|
#define sunColorBase blackbody(Sun_temp) * sun_illuminance
|
||||||
|
#define moonColorBase blackbody(Moon_temp) * moon_illuminance //Fake Purkinje effect
|
||||||
|
#endif
|
||||||
// #define Allow_Vanilla_sky // allow the vanilla sky to appear. may appear broken with some resourcepacks.
|
// #define Allow_Vanilla_sky // allow the vanilla sky to appear. may appear broken with some resourcepacks.
|
||||||
|
|
||||||
// #define WhiteWorld // THIS IS A DEBUG VIEW. uses to see AO easier. used to see fake GI better (green light)
|
// #define WhiteWorld // THIS IS A DEBUG VIEW. uses to see AO easier. used to see fake GI better (green light)
|
||||||
// #define ambientLight_only // THIS IS A DEBUG VIEW. turn the sunlight off. DOES NOT increase performance, the shadows are still working in the background
|
#define TAA
|
||||||
#define MIN_LIGHT_AMOUNT 1.0 //[0.0 0.5 1.0 1.5 2.0 3.0 4.0 5.0]
|
// #define TAA_UPSCALING // Lowers render resolution and uses TAA to combine several lower resolution images (greatly improves performance). USE THIS INSTEAD OF SHADER RENDER QUALITY OPTION IF YOU WANT TO INCREASE FPS (Leave it to 1). IF YOU WANT TO INCREASE QUALITY DISABLE THIS AND INCREASE SHADER RENDER QUALITY
|
||||||
|
#define Seasons
|
||||||
|
#define Season_Length 24 // how long each season lasts in minecraft days. 91 is roughly how long each season is in reality. 1 will make a year last 4 days [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91]
|
||||||
|
// #define Snowy_Winter // snow in the winter, yes or no?
|
||||||
|
#define Summer_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Summer_G 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Summer_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Summer_Leaf_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Summer_Leaf_G 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Summer_Leaf_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Fall_R 1.5 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Fall_G 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Fall_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Fall_Leaf_R 1.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Fall_Leaf_G 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Fall_Leaf_B 0.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Winter_R 1.2 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Winter_G 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Winter_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Winter_Leaf_R 1.2 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Winter_Leaf_G 0.5 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Winter_Leaf_B 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Spring_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Spring_G 0.9 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Spring_B 1.1 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Spring_Leaf_R 1.0 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Spring_Leaf_G 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Spring_Leaf_B 0.8 // the color of the plants during this season [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]
|
||||||
|
#define Daily_Weather // different skies for different days, and fog.
|
||||||
|
#define WeatherDay -1 // [-1 0 1 2 3 4 5 6 7]
|
||||||
|
#define cloudCoverage 0.4 // Cloud coverage [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
|
||||||
|
#define Rain_coverage 0.6 // how much the coverage of the clouds change during rain [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 3.0 4.0 5.0]
|
||||||
|
#define Biome_specific_environment // makes the fog density and color look unique in certain biomes. (swamps, jungles, lush caves, giant pines, dark forests)
|
||||||
|
const float ambientOcclusionLevel = 0.15; //[0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ]
|
||||||
|
const float sunPathRotation = -35; //[-90 -89 -88 -87 -86 -85 -84 -83 -82 -81 -80 -79 -78 -77 -76 -75 -74 -73 -72 -71 -70 -69 -68 -67 -66 -65 -64 -63 -62 -61 -60 -59 -58 -57 -56 -55 -54 -53 -52 -51 -50 -49 -48 -47 -46 -45 -44 -43 -42 -41 -40 -39 -38 -37 -36 -35 -34 -33 -32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 ]
|
||||||
|
const int shadowMapResolution = 2048; //Will probably crash at 16 384 [512 768 1024 1536 2048 3172 4096 8192 16384]
|
||||||
|
const float shadowDistance = 69.; //[32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 ] Not linear at all when shadowDistanceRenderMul is set to -1.0, 175.0 is enough for 40 render distance
|
||||||
|
const float shadowDistanceRenderMul = -1.0; //[-1.0 1.0] Can help to increase shadow draw distance when set to -1.0, at the cost of performance
|
||||||
|
#define Variable_Penumbra_Shadows //Makes the shadows more blurry the more distant they are to objects (costs fps)
|
||||||
|
#define VPS_Search_Samples 4 //The number of samples used to find occluders [4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]
|
||||||
|
#define Min_Shadow_Filter_Radius 5.0 //If Variable_Penumbra_Shadows are not used, will be used as shadow filter size. [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
||||||
|
#define Max_Shadow_Filter_Radius 30.0 //Not used if Variable_Penumbra_Shadows are not used. Will cause issues at too high values [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
||||||
|
#define Max_Filter_Depth 20.0 //Distance to the occluder at which the shadow filter size reaches its maximum. [0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0 33.0 34.0 35.0 36.0 37.0 38.0 39.0 40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0 49.0 50.0 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0 65.0 66.0 67.0 68.0 69.0 70.0 71.0 72.0 73.0 74.0 75.0 76.0 77.0 78.0 79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0 91.0 92.0 93.0 94.0 95.0 96.0 97.0 98.0 99.0 100.0 101.0 102.0 103.0 104.0 105.0 106.0 107.0 108.0 109.0 110.0 111.0 112.0 113.0 114.0 115.0 116.0 117.0 118.0 119.0 ]
|
||||||
|
#define SCREENSPACE_CONTACT_SHADOWS //Raymarch towards the sun in screen-space, in order to cast shadows outside of the shadow map or at the contact of objects. Can get really expensive at high resolutions.
|
||||||
|
#define SHADOW_FILTER_SAMPLE_COUNT 13 // Number of samples used to filter the actual shadows [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 ]
|
||||||
|
// #define SSGI
|
||||||
|
#define RAY_COUNT 4 // [1 2 3 4 5 6 7 8 9 10 12 14 16 18 21 24 28 32 37 43 49 57 65 75 86 100]
|
||||||
|
#define STEPS 8 // [ 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99]
|
||||||
|
#define STEP_LENGTH 12. // [ 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30.]
|
||||||
|
#define SubSurfaceScattering
|
||||||
|
#define DRAW_SUN //if not using custom sky
|
||||||
|
#define SKY_BRIGHTNESS_DAY 1.0 //[0.0 0.5 0.75 1. 1.2 1.4 1.6 1.8 2.0]
|
||||||
|
#define SKY_BRIGHTNESS_NIGHT 1.0 //[0.0 0.5 0.75 1. 1.2 1.4 1.6 1.8 2.0]
|
||||||
|
//#define Specular_Reflections // reflections on blocks. REQUIRES A PBR RESOURCEPACK.
|
||||||
|
#define Screen_Space_Reflections // toggle screenspace reflections. if you want normal performance but still want a bit of shiny, the sun reflection stays on when this is turned off.
|
||||||
|
#define Sky_reflection // just in case you dont want it i guess
|
||||||
|
// #define Rough_reflections // turns the roughness GGXVNDF ON. sizable performance impact, and introduces alot of noise.
|
||||||
|
#define Sun_specular_Strength 3 // increase for more sparkles [1 2 3 4 5 6 7 8 9 10]
|
||||||
|
#define reflection_quality 30 // adjust the quality of the screenspace reflections. [6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 ]
|
||||||
|
#define Roughness_Threshold 1.5 // using a curve on the roughness, make the reflections more or less visible on rough surfaces. good for hiding noise on rough materials [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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
|
#define VOLUMETRIC_CLOUDS// if you don't like the noise on the default cloud settings, turn up the cloud samples. if that hurts performance too much, turn down the clouds quality.
|
||||||
|
#define cloud_LevelOfDetail 1 // Number of fbm noise iterations for on-screen clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
||||||
|
#define cloud_ShadowLevelOfDetail 0 // Number of fbm noise iterations for the shadowing of on-screen clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
||||||
|
#define cloud_LevelOfDetailLQ 1 // Number of fbm noise iterations for reflected clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
||||||
|
#define cloud_ShadowLevelOfDetailLQ 0 // Number of fbm noise iterations for the shadowing of reflected clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
||||||
|
#define minRayMarchSteps 20 // Number of ray march steps towards zenith for on-screen clouds [20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200]
|
||||||
|
#define maxRayMarchSteps 30 // Number of ray march steps towards horizon for on-screen clouds [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200]
|
||||||
|
#define minRayMarchStepsLQ 10 // Number of ray march steps towards zenith for reflected clouds [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
|
||||||
|
#define maxRayMarchStepsLQ 30 // Number of ray march steps towards horizon for reflected clouds [ 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
|
||||||
|
#define cloudMieG 0.5 // Values close to 1 will create a strong peak of luminance around the sun and weak elsewhere, values close to 0 means uniform fog. [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
||||||
|
#define cloudMieG2 0.9 // Multiple scattering approximation. Values close to 1 will create a strong peak of luminance around the sun and weak elsewhere, values close to 0 means uniform fog. [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
||||||
|
#define cloudMie2Multiplier 0.7 // Multiplier for multiple scattering approximation [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
||||||
|
#define Cloud_top_cutoff 1.0 // the cutoff point on the top part of the cloud. [ 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.5 3.0 4 5 6 7 8 9]
|
||||||
|
#define Cloud_base_cutoff 5.0 // the cutoff point on the base of the cloud. [0.1 1 2 4 6 8 10 12 14 16 18 20]
|
||||||
|
#define cloudDensity 0.0514 // Cloud Density, 0.04-0.06 is around irl values [0.0010 0.0011 0.0013 0.0015 0.0017 0.0020 0.0023 0.0026 0.0030 0.0034 0.0039 0.0045 0.0051 0.0058 0.0067 0.0077 0.0088 0.0101 0.0115 0.0132 0.0151 0.0173 0.0199 0.0228 0.0261 0.0299 0.0342 0.0392 0.0449 0.0514 0.0589 0.0675 0.0773 0.0885 0.1014 0.1162 0.1331 0.1524 0.1746 0.2000 0.3 0.35 0.4 0.45 0.5 0.6 0.7 0.8 0.9 1.0]
|
||||||
|
#define fbmAmount 0.50 // Amount of noise added to the cloud shape [0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58 0.60 0.62 0.64 0.66 0.68 0.70 0.72 0.74 0.76 0.78 0.80 0.82 0.84 0.86 0.88 0.90 0.92 0.94 0.96 0.98 1.00 1.02 1.04 1.06 1.08 1.10 1.12 1.14 1.16 1.18 1.20 1.22 1.24 1.26 1.28 1.30 1.32 1.34 1.36 1.38 1.40 1.42 1.44 1.46 1.48 1.50 1.52 1.54 1.56 1.58 1.60 1.62 1.64 1.66 1.68 1.70 1.72 1.74 1.76 1.78 1.80 1.82 1.84 1.86 1.88 1.90 1.92 1.94 1.96 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 2.18 2.20 2.22 2.24 2.26 2.28 2.30 2.32 2.34 2.36 2.38 2.40 2.42 2.44 2.46 2.48 2.50 2.52 2.54 2.56 2.58 2.60 2.62 2.64 2.66 2.68 2.70 2.72 2.74 2.76 2.78 2.80 2.82 2.84 2.86 2.88 2.90 2.92 2.94 2.96 2.98 3.00]
|
||||||
|
#define fbmPower1 3.00 // Higher values increases high frequency details of the cloud shape [1.0 1.50 1.52 1.54 1.56 1.58 1.60 1.62 1.64 1.66 1.68 1.70 1.72 1.74 1.76 1.78 1.80 1.82 1.84 1.86 1.88 1.90 1.92 1.94 1.96 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 2.18 2.20 2.22 2.24 2.26 2.28 2.30 2.32 2.34 2.36 2.38 2.40 2.42 2.44 2.46 2.48 2.50 2.52 2.54 2.56 2.58 2.60 2.62 2.64 2.66 2.68 2.70 2.72 2.74 2.76 2.78 2.80 2.82 2.84 2.86 2.88 2.90 2.92 2.94 2.96 2.98 3.00 3.02 3.04 3.06 3.08 3.10 3.12 3.14 3.16 3.18 3.20 3.22 3.24 3.26 3.28 3.30 3.32 3.34 3.36 3.38 3.40 3.42 3.44 3.46 3.48 3.50 3.52 3.54 3.56 3.58 3.60 3.62 3.64 3.66 3.68 3.70 3.72 3.74 3.76 3.78 3.80 3.82 3.84 3.86 3.88 3.90 3.92 3.94 3.96 3.98 4.00 5. 6. 7. 8. 9. 10.]
|
||||||
|
#define fbmPower2 1.50 // Lower values increases high frequency details of the cloud shape [1.00 1.50 1.52 1.54 1.56 1.58 1.60 1.62 1.64 1.66 1.68 1.70 1.72 1.74 1.76 1.78 1.80 1.82 1.84 1.86 1.88 1.90 1.92 1.94 1.96 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 2.18 2.20 2.22 2.24 2.26 2.28 2.30 2.32 2.34 2.36 2.38 2.40 2.42 2.44 2.46 2.48 2.50 2.52 2.54 2.56 2.58 2.60 2.62 2.64 2.66 2.68 2.70 2.72 2.74 2.76 2.78 2.80 2.82 2.84 2.86 2.88 2.90 2.92 2.94 2.96 2.98 3.00 3.02 3.04 3.06 3.08 3.10 3.12 3.14 3.16 3.18 3.20 3.22 3.24 3.26 3.28 3.30 3.32 3.34 3.36 3.38 3.40 3.42 3.44 3.46 3.48 3.50 3.52 3.54 3.56 3.58 3.60 3.62 3.64 3.66 3.68 3.70 3.72 3.74 3.76 3.78 3.80 3.82 3.84 3.86 3.88 3.90 3.92 3.94 3.96 3.98 4.00 5. 6. 7. 8. 9. 10.]
|
||||||
|
#define Cloud_Size 35 // [1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
|
||||||
|
#define Cloud_Height 319 // [-300 -290 -280 -270 -260 -250 -240 -230 -220 -210 -200 -190 -180 -170 -160 -150 -140 -130 -120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 319 320]
|
||||||
|
#define Shadow_brightness 0.5 // how dark / bright you want the shadowed part of the clouds to be. low values can look weird. [ 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 3.0 4.0 5.0 6.0]
|
||||||
|
#define self_shadow_samples 3.0 // amount of interations for cloud self shadows. longer/shorter cloud self shadows. [ 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15 20 30 40 50]
|
||||||
|
#define Dynamic_sky_day -1 // -1 MEANS THIS IS OFF. select which day of the 8 to the clouds should take shape in [0 1 2 3 4 5 6 7 ]
|
||||||
|
#define Dynamic_Sky // day 1: partly cloudy. day 2: really cloudy, misty. day 3: mostly clear. day 4: cloudy. day 5: cloudy again. day 6: scattered clouds. day 7: partly cloudy. day 8: clear
|
||||||
|
#define High_Altitude_Clouds // a layer of clouds way up yonder
|
||||||
|
#define Cumulus_Clouds
|
||||||
|
#define flip_the_clouds 1 // what was once above is now below [1 -1]
|
||||||
|
#define cloud_speed 1 // how [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2.0 3.0 5.0 10.0 25.0 50.0 100.0 200.0]
|
||||||
|
#define VL_SAMPLES2 6 //[4 6 8 10 12 14 16 20 24 30 40 50]
|
@ -1,6 +1,5 @@
|
|||||||
#define DRAW_SUN //if not using custom sky
|
|
||||||
#define SKY_BRIGHTNESS_DAY 1.0 //[0.0 0.5 0.75 1. 1.2 1.4 1.6 1.8 2.0]
|
|
||||||
#define SKY_BRIGHTNESS_NIGHT 1.0 //[0.0 0.5 0.75 1. 1.2 1.4 1.6 1.8 2.0]
|
|
||||||
#define ffstep(x,y) clamp((y - x) * 1e35,0.0,1.0)
|
#define ffstep(x,y) clamp((y - x) * 1e35,0.0,1.0)
|
||||||
vec3 drawSun(float cosY, float sunInt,vec3 nsunlight,vec3 inColor){
|
vec3 drawSun(float cosY, float sunInt,vec3 nsunlight,vec3 inColor){
|
||||||
return inColor+nsunlight/0.0008821203*pow(smoothstep(cos(0.0093084168595*3.2),cos(0.0093084168595*1.8),cosY),3.)*0.62;
|
return inColor+nsunlight/0.0008821203*pow(smoothstep(cos(0.0093084168595*3.2),cos(0.0093084168595*1.8),cosY),3.)*0.62;
|
||||||
@ -82,3 +81,7 @@ vec4 skyCloudsFromTex(vec3 pos,sampler2D sampler){
|
|||||||
vec2 p = sphereToCarte(pos);
|
vec2 p = sphereToCarte(pos);
|
||||||
return texture2D(sampler,p*texelSize*256.+vec2(18.5+257.,1.5)*texelSize);
|
return texture2D(sampler,p*texelSize*256.+vec2(18.5+257.,1.5)*texelSize);
|
||||||
}
|
}
|
||||||
|
vec4 skyCloudsFromTex_Spec(vec3 pos,sampler2D sampler, int LOD){
|
||||||
|
vec2 p = sphereToCarte(pos);
|
||||||
|
return texture2DLod(sampler,p*texelSize*256.+vec2(18.5+257.,1.5)*texelSize, LOD);
|
||||||
|
}
|
@ -1,15 +1,3 @@
|
|||||||
//#define Specular_Reflections // reflections on blocks. REQUIRES A PBR RESOURCEPACK.
|
|
||||||
#define Screen_Space_Reflections // toggle screenspace reflections. if you want normal performance but still want a bit of shiny, the sun reflection stays on when this is turned off.
|
|
||||||
#define Sky_reflection // just in case you dont want it i guess
|
|
||||||
// #define Rough_reflections // turns the roughness GGXVNDF ON. sizable performance impact, and introduces alot of noise.
|
|
||||||
|
|
||||||
#define Sun_specular_Strength 3 // increase for more sparkles [1 2 3 4 5 6 7 8 9 10]
|
|
||||||
#define reflection_quality 30 // adjust the quality of the screenspace reflections. [6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 ]
|
|
||||||
#define Roughness_Threshold 1.5 // using a curve on the roughness, make the reflections more or less visible on rough surfaces. good for hiding noise on rough materials [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 2.6 2.7 2.8 2.9 3.0 ]
|
|
||||||
|
|
||||||
// #define SCREENSHOT_MODE // go render mode and accumulate frames for as long as you want for max image quality.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uniform sampler2D gaux1;
|
uniform sampler2D gaux1;
|
||||||
uniform int framemod8;
|
uniform int framemod8;
|
||||||
@ -74,71 +62,71 @@ float linZ(float depth) {
|
|||||||
// d = -((2n/l)-f-n)/(f-n)
|
// d = -((2n/l)-f-n)/(f-n)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
vec3 rayTrace_GI(vec3 dir,vec3 position,float dither, float quality){
|
||||||
|
|
||||||
|
vec3 clipPosition = toClipSpace3(position);
|
||||||
|
float rayLength = ((position.z + dir.z * far*sqrt(3.)) > -near) ? (-near -position.z) / dir.z : far*sqrt(3.);
|
||||||
|
vec3 direction = normalize(toClipSpace3(position+dir*rayLength)-clipPosition); //convert to clip space
|
||||||
|
direction.xy = normalize(direction.xy);
|
||||||
|
|
||||||
|
//get at which length the ray intersects with the edge of the screen
|
||||||
|
vec3 maxLengths = (step(0.,direction)-clipPosition) / direction;
|
||||||
|
float mult = min(min(maxLengths.x,maxLengths.y),maxLengths.z);
|
||||||
|
|
||||||
|
|
||||||
|
vec3 stepv = direction * mult / quality*vec3(RENDER_SCALE,1.0);
|
||||||
|
vec3 spos = clipPosition*vec3(RENDER_SCALE,1.0) + stepv*dither;
|
||||||
|
|
||||||
|
float minZ = clipPosition.z+stepv.z;
|
||||||
|
float maxZ = spos.z+stepv.z;
|
||||||
|
spos.xy += TAA_Offset*texelSize*0.5/RENDER_SCALE;
|
||||||
|
|
||||||
|
float dist = 1.0 + clamp(position.z*position.z/50.0,0,2); // shrink sample size as distance increases
|
||||||
|
for (int i = 0; i <= int(quality); i++) {
|
||||||
|
|
||||||
|
float sp = texelFetch2D(depthtex1,ivec2(spos.xy/texelSize),0).r;
|
||||||
|
if(sp <= max(maxZ,minZ) && sp >= min(maxZ,minZ)) return vec3(spos.xy/RENDER_SCALE,sp);
|
||||||
|
|
||||||
|
spos += stepv;
|
||||||
|
//small bias
|
||||||
|
minZ = maxZ-(0.0001/dist)/ld(spos.z);
|
||||||
|
maxZ += stepv.z;
|
||||||
|
}
|
||||||
|
|
||||||
|
return vec3(1.1);
|
||||||
|
}
|
||||||
// vec3 rayTrace_GI(vec3 dir,vec3 position,float dither, float quality){
|
// vec3 rayTrace_GI(vec3 dir,vec3 position,float dither, float quality){
|
||||||
|
|
||||||
// vec3 clipPosition = toClipSpace3(position);
|
// vec3 clipPosition = toClipSpace3(position);
|
||||||
// float rayLength = ((position.z + dir.z * far*sqrt(3.)) > -near) ?
|
// float rayLength = ((position.z + dir.z * far*sqrt(3.)) > -near) ?
|
||||||
// (-near -position.z) / dir.z : far*sqrt(3.);
|
// (-near -position.z) / dir.z : far*sqrt(3.);
|
||||||
// vec3 direction = normalize(toClipSpace3(position+dir*rayLength)-clipPosition); //convert to clip space
|
// vec3 direction = normalize(toClipSpace3(position+dir*rayLength)-clipPosition); //convert to clip space
|
||||||
// direction.xy = normalize(direction.xy);
|
// direction.xy = normalize(direction.xy);
|
||||||
|
|
||||||
// //get at which length the ray intersects with the edge of the screen
|
// //get at which length the ray intersects with the edge of the screen
|
||||||
// vec3 maxLengths = (step(0.,direction)-clipPosition) / direction;
|
// vec3 maxLengths = (step(0.,direction)-clipPosition) / direction;
|
||||||
// float mult = min(min(maxLengths.x,maxLengths.y),maxLengths.z);
|
// float mult = maxLengths.y;
|
||||||
|
|
||||||
// vec3 stepv = direction * mult / quality*vec3(RENDER_SCALE,1.0);
|
|
||||||
|
|
||||||
|
// vec3 stepv = direction * mult / quality*vec3(RENDER_SCALE,1.0) * dither;
|
||||||
// vec3 spos = clipPosition*vec3(RENDER_SCALE,1.0) ;
|
// vec3 spos = clipPosition*vec3(RENDER_SCALE,1.0) ;
|
||||||
|
|
||||||
// float minZ = spos.z+stepv.z;
|
|
||||||
// float maxZ = spos.z+stepv.z;
|
|
||||||
|
|
||||||
// spos.xy += TAA_Offset*texelSize*0.5/RENDER_SCALE;
|
// spos.xy += TAA_Offset*texelSize*0.5/RENDER_SCALE;
|
||||||
// spos += stepv*dither ;
|
|
||||||
|
// float biasdist = clamp(position.z*position.z/50.0,1,2); // shrink sample size as distance increases
|
||||||
|
|
||||||
// for(int i = 0; i < int(quality); i++){
|
// for(int i = 0; i < int(quality); i++){
|
||||||
|
// spos += stepv;
|
||||||
// float sp = sqrt(texelFetch2D(colortex4,ivec2(spos.xy/texelSize/4),0).w/65000.0);
|
// float sp = sqrt(texelFetch2D(colortex4,ivec2(spos.xy/texelSize/4),0).w/65000.0);
|
||||||
// float currZ = linZ(spos.z);
|
// float currZ = linZ(spos.z);
|
||||||
|
|
||||||
// if( sp < currZ) {
|
// if( sp < currZ) {
|
||||||
// float dist = abs(sp-currZ)/currZ;
|
// float dist = abs(sp-currZ)/currZ;
|
||||||
// if (dist <= 0.05) return vec3(spos.xy, invLinZ(sp))/vec3(RENDER_SCALE,1.0);
|
// if (abs(dist) < biasdist*0.05) return vec3(spos.xy, invLinZ(sp))/vec3(RENDER_SCALE,1.0);
|
||||||
// }
|
// }
|
||||||
// spos += stepv ;
|
// spos += stepv;
|
||||||
// }
|
// }
|
||||||
// return vec3(1.1);
|
// return vec3(1.1);
|
||||||
// }
|
// }
|
||||||
vec3 rayTrace_GI(vec3 dir,vec3 position,float dither, float quality){
|
|
||||||
|
|
||||||
vec3 clipPosition = toClipSpace3(position);
|
|
||||||
float rayLength = ((position.z + dir.z * far*sqrt(3.)) > -near) ?
|
|
||||||
(-near -position.z) / dir.z : far*sqrt(3.);
|
|
||||||
vec3 direction = normalize(toClipSpace3(position+dir*rayLength)-clipPosition); //convert to clip space
|
|
||||||
direction.xy = normalize(direction.xy);
|
|
||||||
|
|
||||||
//get at which length the ray intersects with the edge of the screen
|
|
||||||
vec3 maxLengths = (step(0.,direction)-clipPosition) / direction;
|
|
||||||
float mult = maxLengths.y;
|
|
||||||
|
|
||||||
vec3 stepv = direction * mult / quality*vec3(RENDER_SCALE,1.0) * dither;
|
|
||||||
vec3 spos = clipPosition*vec3(RENDER_SCALE,1.0) ;
|
|
||||||
|
|
||||||
spos.xy += TAA_Offset*texelSize*0.5/RENDER_SCALE;
|
|
||||||
|
|
||||||
float biasdist = clamp(position.z*position.z/50.0,1,2); // shrink sample size as distance increases
|
|
||||||
|
|
||||||
for(int i = 0; i < int(quality); i++){
|
|
||||||
spos += stepv;
|
|
||||||
float sp = sqrt(texelFetch2D(colortex4,ivec2(spos.xy/texelSize/4),0).w/65000.0);
|
|
||||||
float currZ = linZ(spos.z);
|
|
||||||
|
|
||||||
if( sp < currZ) {
|
|
||||||
float dist = abs(sp-currZ)/currZ;
|
|
||||||
if (abs(dist) < biasdist*0.05) return vec3(spos.xy, invLinZ(sp))/vec3(RENDER_SCALE,1.0);
|
|
||||||
}
|
|
||||||
spos += stepv;
|
|
||||||
}
|
|
||||||
return vec3(1.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void frisvad(in vec3 n, out vec3 f, out vec3 r){
|
void frisvad(in vec3 n, out vec3 f, out vec3 r){
|
||||||
if(n.z < -0.9) {
|
if(n.z < -0.9) {
|
||||||
@ -180,11 +168,12 @@ vec3 sampleGGXVNDF(vec3 V_, float roughness, float U1, float U2){
|
|||||||
// compute normal
|
// compute normal
|
||||||
vec3 N = P1*T1 + P2*T2 + sqrt(max(0.0, 1.0 - P1*P1 - P2*P2))*V;
|
vec3 N = P1*T1 + P2*T2 + sqrt(max(0.0, 1.0 - P1*P1 - P2*P2))*V;
|
||||||
// unstretch
|
// unstretch
|
||||||
N = normalize(vec3(roughness*N.x, roughness*N.y, max(0.0, N.z)));
|
N = normalize(vec3(roughness*N.x, roughness*N.y, N.z));
|
||||||
return N;
|
return N;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3 rayTraceSpeculars(vec3 dir,vec3 position,float dither, float quality, bool hand){
|
vec3 rayTraceSpeculars(vec3 dir,vec3 position,float dither, float quality, bool hand){
|
||||||
vec3 clipPosition = toClipSpace3(position);
|
vec3 clipPosition = toClipSpace3(position);
|
||||||
float rayLength = ((position.z + dir.z * far*sqrt(3.)) > -near) ?
|
float rayLength = ((position.z + dir.z * far*sqrt(3.)) > -near) ?
|
||||||
@ -200,9 +189,9 @@ vec3 rayTraceSpeculars(vec3 dir,vec3 position,float dither, float quality, bool
|
|||||||
|
|
||||||
vec3 spos = clipPosition*vec3(RENDER_SCALE,1.0) + stepv*dither;
|
vec3 spos = clipPosition*vec3(RENDER_SCALE,1.0) + stepv*dither;
|
||||||
|
|
||||||
float minZ = spos.z+stepv.z;
|
float minZ = spos.z;
|
||||||
float maxZ = spos.z+stepv.z;
|
float maxZ = spos.z;
|
||||||
|
|
||||||
spos.xy += TAA_Offset*texelSize*0.5/RENDER_SCALE;
|
spos.xy += TAA_Offset*texelSize*0.5/RENDER_SCALE;
|
||||||
|
|
||||||
float dist = 1.0 + clamp(position.z*position.z/50.0,0,2); // shrink sample size as distance increases
|
float dist = 1.0 + clamp(position.z*position.z/50.0,0,2); // shrink sample size as distance increases
|
||||||
@ -226,6 +215,7 @@ vec3 rayTraceSpeculars(vec3 dir,vec3 position,float dither, float quality, bool
|
|||||||
return vec3(1.1);
|
return vec3(1.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vec3 mix_vec3(vec3 X, vec3 Y, float A){
|
vec3 mix_vec3(vec3 X, vec3 Y, float A){
|
||||||
return X * (1.0 - A) + Y * A;
|
return X * (1.0 - A) + Y * A;
|
||||||
}
|
}
|
||||||
@ -236,6 +226,7 @@ float mix_float(float X, float Y, float A){
|
|||||||
|
|
||||||
// pain
|
// pain
|
||||||
void MaterialReflections(
|
void MaterialReflections(
|
||||||
|
vec2 texcoord,
|
||||||
inout vec3 Output,
|
inout vec3 Output,
|
||||||
float roughness,
|
float roughness,
|
||||||
vec3 f0,
|
vec3 f0,
|
||||||
@ -258,8 +249,8 @@ void MaterialReflections(
|
|||||||
roughness = unpackRoughness(roughness);
|
roughness = unpackRoughness(roughness);
|
||||||
f0 = f0.y == 0.0 ? vec3(0.04) : f0;
|
f0 = f0.y == 0.0 ? vec3(0.04) : f0;
|
||||||
|
|
||||||
// roughness = 0.0;
|
// roughness = 0.2;
|
||||||
// f0 = vec3(0.9);
|
// f0 = vec3(0.04);
|
||||||
|
|
||||||
mat3 basis = CoordBase(normal);
|
mat3 basis = CoordBase(normal);
|
||||||
vec3 normSpaceView = -np3*basis ;
|
vec3 normSpaceView = -np3*basis ;
|
||||||
@ -275,48 +266,72 @@ void MaterialReflections(
|
|||||||
vec3 H = normalize(vec3(0.0,0.0,1.0));
|
vec3 H = normalize(vec3(0.0,0.0,1.0));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vec3 Ln = reflect(-normSpaceView, clamp(H,-1.0,1.0));
|
vec3 Ln = reflect(-normSpaceView, H);
|
||||||
vec3 L = basis * Ln;
|
vec3 L = basis * Ln;
|
||||||
|
|
||||||
// fresnel stuff
|
// fresnel stuff
|
||||||
float fresnel = pow(clamp(1.0 + dot(-Ln, H),0.0,1.0),5.0);
|
float fresnel = pow(clamp(1.0 + dot(-Ln, H),0.0,1.0),5.0);
|
||||||
|
|
||||||
|
float fresnel2 = dot(-np3, H);
|
||||||
|
|
||||||
// vec3 F = f0 + (1.0 - f0) * fresnel;
|
// vec3 F = f0 + (1.0 - f0) * fresnel;
|
||||||
|
|
||||||
vec3 F = mix(f0, vec3(1.0), fresnel);
|
vec3 F = mix(f0, vec3(1.0), fresnel);
|
||||||
vec3 rayContrib = F;
|
vec3 rayContrib = F;
|
||||||
|
|
||||||
|
|
||||||
float NdotV = clamp(normalize(dot(np3, normal))*10000.,0.,1.);
|
// float NdotV = clamp(normalize(dot(np3, L))*10000.,0.,1.);
|
||||||
bool hasReflections = (f0.y * (1.0 - roughness * Roughness_Threshold)) > 0.01;
|
bool hasReflections = (f0.y * (1.0 - roughness * Roughness_Threshold)) > 0.01;
|
||||||
|
|
||||||
if (Roughness_Threshold == 1.0){ hasReflections = roughness > -1; NdotV = -1.0;}
|
if (Roughness_Threshold == 1.0){ hasReflections = roughness > -1; }
|
||||||
|
|
||||||
|
if (!hasReflections ) Outdoors = 0.0;
|
||||||
|
|
||||||
|
|
||||||
if (!hasReflections || NdotV > 0.0 ) Outdoors = 0.0;
|
|
||||||
|
|
||||||
|
// if(hand){
|
||||||
|
// LOD_controller = 6;
|
||||||
|
// // noise.b = 0.5;
|
||||||
|
// }
|
||||||
|
|
||||||
// SSR, Sky, and Sun reflections
|
// SSR, Sky, and Sun reflections
|
||||||
vec4 Reflections = vec4(0.0);
|
vec4 Reflections = vec4(0.0);
|
||||||
|
// vec3 SkyReflection = skyCloudsFromTex_Spec(L, colortex4,int(LOD_controller)).rgb / 150. * 5.;
|
||||||
vec3 SkyReflection = skyCloudsFromTex(L, colortex4).rgb / 150. * 5.;
|
vec3 SkyReflection = skyCloudsFromTex(L, colortex4).rgb / 150. * 5.;
|
||||||
vec3 SunReflection = diffuse * GGX2(clamp(normal,-1,1), -np3, sunPos, roughness, f0) * 8./150./3. * sunCol * Sun_specular_Strength;
|
|
||||||
|
vec3 SunReflection = diffuse * GGX2(normal, -np3, sunPos, roughness, f0) * 8./150./3. * sunCol * Sun_specular_Strength;
|
||||||
|
|
||||||
#ifndef Sky_reflection
|
#ifndef Sky_reflection
|
||||||
SkyReflection = Reflections_Final;
|
SkyReflection = Reflections_Final;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef Screen_Space_Reflections
|
#ifdef Screen_Space_Reflections
|
||||||
if ( hasReflections && NdotV <= 0.0) { // Skip SSR if ray contribution is low
|
if ( hasReflections ) { // Skip SSR if ray contribution is low
|
||||||
|
|
||||||
|
|
||||||
#ifdef SCREENSHOT_MODE
|
#ifdef SCREENSHOT_MODE
|
||||||
float rayQuality = reflection_quality;
|
float rayQuality = reflection_quality;
|
||||||
#else
|
#else
|
||||||
float rayQuality = mix_float(reflection_quality,0.0,sqrt(roughness)); // Scale quality with ray contribution
|
float rayQuality = mix_float(reflection_quality,0.0,dot(rayContrib,vec3(0.33))); // Scale quality with ray contribution
|
||||||
#endif
|
#endif
|
||||||
vec3 rtPos = rayTraceSpeculars( mat3(gbufferModelView) * L,fragpos.xyz, noise.b, rayQuality, hand);
|
|
||||||
|
vec3 rtPos = rayTraceSpeculars( mat3(gbufferModelView) * L,fragpos.xyz, noise.b, reflection_quality, hand);
|
||||||
|
|
||||||
|
// float test = dot(vec2(-rtPos.x,-rtPos.y), vec2(rtPos.x,rtPos.y));
|
||||||
|
// float LOD_controller = clamp((1-pow(test*0.5+1.0,25)) * 10,0.0,6.0) ;
|
||||||
|
|
||||||
|
// LOD_controller = 0;
|
||||||
|
|
||||||
if (rtPos.z < 1. ){ // Reproject on previous frame
|
if (rtPos.z < 1. ){ // Reproject on previous frame
|
||||||
vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rtPos) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rtPos) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
||||||
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
||||||
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
||||||
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0) {
|
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0) {
|
||||||
Reflections.a = 1.0;
|
Reflections.a = 1.0;
|
||||||
Reflections.rgb = texture2D(colortex5,previousPosition.xy).rgb;
|
Reflections.rgb = texture2DLod(colortex5,previousPosition.xy,0).rgb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -330,15 +345,17 @@ void MaterialReflections(
|
|||||||
#ifdef Sky_reflection
|
#ifdef Sky_reflection
|
||||||
SkyReflection *= Metals;
|
SkyReflection *= Metals;
|
||||||
#endif
|
#endif
|
||||||
float lumaRayContrib = luma(rayContrib);
|
float lumaRayContrib = pow(luma(rayContrib),1.0);
|
||||||
|
float oneminus_lumaRayContrib = pow(1.0-luma(rayContrib),1.0);
|
||||||
// darken albedos, and stop darkening where the sky gets occluded indoors
|
// darken albedos, and stop darkening where the sky gets occluded indoors
|
||||||
Reflections_Final *= mix_float(1.0 - (Reflections.a*lumaRayContrib), 1.0 - lumaRayContrib, Outdoors);
|
Reflections_Final *= mix_float(1.0 - (Reflections.a*lumaRayContrib), oneminus_lumaRayContrib, Outdoors);
|
||||||
|
|
||||||
// apply all reflections to the lighting
|
// apply all reflections to the lighting
|
||||||
Reflections_Final += Reflections.rgb * lumaRayContrib;
|
Reflections_Final += Reflections.rgb * lumaRayContrib;
|
||||||
Reflections_Final += SkyReflection * lumaRayContrib * (1.0-Reflections.a) * Outdoors ;
|
Reflections_Final += SkyReflection * lumaRayContrib * (1.0-Reflections.a) * Outdoors ;
|
||||||
|
|
||||||
float visibilityFactor = clamp(exp2((pow(roughness,3.0) / f0.y) * -4),0,1);
|
float visibilityFactor = clamp(exp2((pow(roughness,3.0) / f0.y) * -4),0,1);
|
||||||
|
|
||||||
#ifdef Rough_reflections
|
#ifdef Rough_reflections
|
||||||
Output = hand ? mix_vec3(Output, Reflections_Final, visibilityFactor) : Reflections_Final;
|
Output = hand ? mix_vec3(Output, Reflections_Final, visibilityFactor) : Reflections_Final;
|
||||||
#else
|
#else
|
||||||
@ -346,4 +363,7 @@ void MaterialReflections(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Output += SunReflection ;
|
Output += SunReflection ;
|
||||||
|
// float aaaa = dot(vec2(-rtPos.x,-rtPos.y), vec2(rtPos.x,rtPos.y));
|
||||||
|
// test = pow(test*0.5+1.0,2);
|
||||||
|
// Output = vec3(0,test,0) ;
|
||||||
}
|
}
|
@ -1,54 +1,13 @@
|
|||||||
#define VOLUMETRIC_CLOUDS// if you don't like the noise on the default cloud settings, turn up the cloud samples. if that hurts performance too much, turn down the clouds quality.
|
|
||||||
|
|
||||||
#define cloud_LevelOfDetail 1 // Number of fbm noise iterations for on-screen clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
|
||||||
#define cloud_ShadowLevelOfDetail 0 // Number of fbm noise iterations for the shadowing of on-screen clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
|
||||||
#define cloud_LevelOfDetailLQ 1 // Number of fbm noise iterations for reflected clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
|
||||||
#define cloud_ShadowLevelOfDetailLQ 0 // Number of fbm noise iterations for the shadowing of reflected clouds (-1 is no fbm) [-1 0 1 2 3 4 5 6 7 8]
|
|
||||||
#define minRayMarchSteps 20 // Number of ray march steps towards zenith for on-screen clouds [20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200]
|
|
||||||
#define maxRayMarchSteps 30 // Number of ray march steps towards horizon for on-screen clouds [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200]
|
|
||||||
#define minRayMarchStepsLQ 10 // Number of ray march steps towards zenith for reflected clouds [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
|
|
||||||
#define maxRayMarchStepsLQ 30 // Number of ray march steps towards horizon for reflected clouds [ 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
|
|
||||||
#define cloudMieG 0.5 // Values close to 1 will create a strong peak of luminance around the sun and weak elsewhere, values close to 0 means uniform fog. [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define cloudMieG2 0.9 // Multiple scattering approximation. Values close to 1 will create a strong peak of luminance around the sun and weak elsewhere, values close to 0 means uniform fog. [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define cloudMie2Multiplier 0.7 // Multiplier for multiple scattering approximation [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
|
|
||||||
#define Cloud_top_cutoff 1.0 // the cutoff point on the top part of the cloud. [ 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.5 3.0 4 5 6 7 8 9]
|
|
||||||
#define Cloud_base_cutoff 5.0 // the cutoff point on the base of the cloud. [0.1 1 2 4 6 8 10 12 14 16 18 20]
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef HQ_CLOUDS
|
#ifdef HQ_CLOUDS
|
||||||
int maxIT_clouds = minRayMarchSteps;
|
int maxIT_clouds = minRayMarchSteps;
|
||||||
int maxIT = maxRayMarchSteps;
|
int maxIT = maxRayMarchSteps;
|
||||||
#else
|
#else
|
||||||
int maxIT_clouds = minRayMarchStepsLQ;
|
int maxIT_clouds = minRayMarchStepsLQ;
|
||||||
int maxIT = maxRayMarchStepsLQ;
|
int maxIT = maxRayMarchStepsLQ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/////// shape
|
|
||||||
#define cloudDensity 0.0514 // Cloud Density, 0.04-0.06 is around irl values [0.0010 0.0011 0.0013 0.0015 0.0017 0.0020 0.0023 0.0026 0.0030 0.0034 0.0039 0.0045 0.0051 0.0058 0.0067 0.0077 0.0088 0.0101 0.0115 0.0132 0.0151 0.0173 0.0199 0.0228 0.0261 0.0299 0.0342 0.0392 0.0449 0.0514 0.0589 0.0675 0.0773 0.0885 0.1014 0.1162 0.1331 0.1524 0.1746 0.2000 0.3 0.35 0.4 0.45 0.5 0.6 0.7 0.8 0.9 1.0]
|
|
||||||
#define fbmAmount 0.50 // Amount of noise added to the cloud shape [0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58 0.60 0.62 0.64 0.66 0.68 0.70 0.72 0.74 0.76 0.78 0.80 0.82 0.84 0.86 0.88 0.90 0.92 0.94 0.96 0.98 1.00 1.02 1.04 1.06 1.08 1.10 1.12 1.14 1.16 1.18 1.20 1.22 1.24 1.26 1.28 1.30 1.32 1.34 1.36 1.38 1.40 1.42 1.44 1.46 1.48 1.50 1.52 1.54 1.56 1.58 1.60 1.62 1.64 1.66 1.68 1.70 1.72 1.74 1.76 1.78 1.80 1.82 1.84 1.86 1.88 1.90 1.92 1.94 1.96 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 2.18 2.20 2.22 2.24 2.26 2.28 2.30 2.32 2.34 2.36 2.38 2.40 2.42 2.44 2.46 2.48 2.50 2.52 2.54 2.56 2.58 2.60 2.62 2.64 2.66 2.68 2.70 2.72 2.74 2.76 2.78 2.80 2.82 2.84 2.86 2.88 2.90 2.92 2.94 2.96 2.98 3.00]
|
|
||||||
#define fbmPower1 3.00 // Higher values increases high frequency details of the cloud shape [1.0 1.50 1.52 1.54 1.56 1.58 1.60 1.62 1.64 1.66 1.68 1.70 1.72 1.74 1.76 1.78 1.80 1.82 1.84 1.86 1.88 1.90 1.92 1.94 1.96 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 2.18 2.20 2.22 2.24 2.26 2.28 2.30 2.32 2.34 2.36 2.38 2.40 2.42 2.44 2.46 2.48 2.50 2.52 2.54 2.56 2.58 2.60 2.62 2.64 2.66 2.68 2.70 2.72 2.74 2.76 2.78 2.80 2.82 2.84 2.86 2.88 2.90 2.92 2.94 2.96 2.98 3.00 3.02 3.04 3.06 3.08 3.10 3.12 3.14 3.16 3.18 3.20 3.22 3.24 3.26 3.28 3.30 3.32 3.34 3.36 3.38 3.40 3.42 3.44 3.46 3.48 3.50 3.52 3.54 3.56 3.58 3.60 3.62 3.64 3.66 3.68 3.70 3.72 3.74 3.76 3.78 3.80 3.82 3.84 3.86 3.88 3.90 3.92 3.94 3.96 3.98 4.00 5. 6. 7. 8. 9. 10.]
|
|
||||||
#define fbmPower2 1.50 // Lower values increases high frequency details of the cloud shape [1.00 1.50 1.52 1.54 1.56 1.58 1.60 1.62 1.64 1.66 1.68 1.70 1.72 1.74 1.76 1.78 1.80 1.82 1.84 1.86 1.88 1.90 1.92 1.94 1.96 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 2.18 2.20 2.22 2.24 2.26 2.28 2.30 2.32 2.34 2.36 2.38 2.40 2.42 2.44 2.46 2.48 2.50 2.52 2.54 2.56 2.58 2.60 2.62 2.64 2.66 2.68 2.70 2.72 2.74 2.76 2.78 2.80 2.82 2.84 2.86 2.88 2.90 2.92 2.94 2.96 2.98 3.00 3.02 3.04 3.06 3.08 3.10 3.12 3.14 3.16 3.18 3.20 3.22 3.24 3.26 3.28 3.30 3.32 3.34 3.36 3.38 3.40 3.42 3.44 3.46 3.48 3.50 3.52 3.54 3.56 3.58 3.60 3.62 3.64 3.66 3.68 3.70 3.72 3.74 3.76 3.78 3.80 3.82 3.84 3.86 3.88 3.90 3.92 3.94 3.96 3.98 4.00 5. 6. 7. 8. 9. 10.]
|
|
||||||
|
|
||||||
#define Cloud_Size 35 // [1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
|
|
||||||
#define Cloud_Height 319 // [-300 -290 -280 -270 -260 -250 -240 -230 -220 -210 -200 -190 -180 -170 -160 -150 -140 -130 -120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 319 320]
|
|
||||||
|
|
||||||
/////// lighting
|
|
||||||
#define Shadow_brightness 0.5 // how dark / bright you want the shadowed part of the clouds to be. low values can look weird. [ 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 3.0 4.0 5.0 6.0]
|
|
||||||
#define self_shadow_samples 3.0 // amount of interations for cloud self shadows. longer/shorter cloud self shadows. [ 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 15 20 30 40 50]
|
|
||||||
|
|
||||||
|
|
||||||
#define Dynamic_sky_day -1 // -1 MEANS THIS IS OFF. select which day of the 8 to the clouds should take shape in [0 1 2 3 4 5 6 7 ]
|
|
||||||
#define Dynamic_Sky // day 1: partly cloudy. day 2: really cloudy, misty. day 3: mostly clear. day 4: cloudy. day 5: cloudy again. day 6: scattered clouds. day 7: partly cloudy. day 8: clear
|
|
||||||
|
|
||||||
#define High_Altitude_Clouds // a layer of clouds way up yonder
|
|
||||||
#define Cumulus_Clouds
|
|
||||||
|
|
||||||
|
|
||||||
/////// other
|
|
||||||
#define flip_the_clouds 1 // what was once above is now below [1 -1]
|
|
||||||
#define cloud_speed 1 // how [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 2.0 3.0 5.0 10.0 25.0 50.0 100.0 200.0]
|
|
||||||
|
|
||||||
#ifdef HQ_CLOUDS
|
#ifdef HQ_CLOUDS
|
||||||
const int cloudLoD = cloud_LevelOfDetail;
|
const int cloudLoD = cloud_LevelOfDetail;
|
||||||
const int cloudShadowLoD = cloud_ShadowLevelOfDetail;
|
const int cloudShadowLoD = cloud_ShadowLevelOfDetail;
|
||||||
@ -62,33 +21,10 @@ uniform float viewWidth;
|
|||||||
uniform sampler2D colortex4;//Skybox
|
uniform sampler2D colortex4;//Skybox
|
||||||
// uniform float lightningFlash;
|
// uniform float lightningFlash;
|
||||||
|
|
||||||
// uniform vec4 Moon_Weather_properties;
|
|
||||||
// float highCov = Dynamic_sky_day == 0 ? 0.4 : Dynamic_sky_day == 1 ? 0.6 : Dynamic_sky_day == 2 ? 0.4 : Dynamic_sky_day == 3 ? -1000 : Dynamic_sky_day == 4 ? 1 : Dynamic_sky_day == 5 ? -1000 : Dynamic_sky_day == 6 ? 0.6 : 0.4;
|
|
||||||
// float lowCov = Dynamic_sky_day == 0 ? 0.4 : Dynamic_sky_day == 1 ? 0.9 : Dynamic_sky_day == 2 ? 0.0 : Dynamic_sky_day == 3 ? 0.5 : Dynamic_sky_day == 4 ? 0 : Dynamic_sky_day == 5 ? -1000 : Dynamic_sky_day == 6 ? -1000 : 0.8;
|
|
||||||
// float FogDen = Dynamic_sky_day == 0 ? 0 : Dynamic_sky_day == 1 ? 0 : Dynamic_sky_day == 2 ? 0 : Dynamic_sky_day == 3 ? 0 : Dynamic_sky_day == 4 ? 0 : Dynamic_sky_day == 5 ? 0 : Dynamic_sky_day == 6 ? 0 : 0;
|
|
||||||
// float CloudyFogden = Dynamic_sky_day == 0 ? 0 : Dynamic_sky_day == 1 ? 0 : Dynamic_sky_day == 2 ? 0 : Dynamic_sky_day == 3 ? 0 : Dynamic_sky_day == 4 ? 0 : Dynamic_sky_day == 5 ? 0 : Dynamic_sky_day == 6 ? 0 : 0;
|
|
||||||
// vec4 custom_day = vec4(highCov, lowCov, FogDen, CloudyFogden);
|
|
||||||
|
|
||||||
|
|
||||||
// #ifdef Dynamic_Sky
|
|
||||||
|
|
||||||
// #if Dynamic_sky_day < 0
|
|
||||||
// vec4 Weather_properties = Moon_Weather_properties;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #if Dynamic_sky_day >= 0
|
|
||||||
// vec4 Weather_properties = custom_day;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #else
|
|
||||||
// vec4 Weather_properties = vec4(0);
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
#define WEATHERCLOUDS
|
#define WEATHERCLOUDS
|
||||||
#include "/lib/climate_settings.glsl"
|
#include "/lib/climate_settings.glsl"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float maxHeight = 5000.;
|
float maxHeight = 5000.;
|
||||||
float cloud_height = 1500.;
|
float cloud_height = 1500.;
|
||||||
|
|
||||||
@ -120,19 +56,31 @@ float cloudshape = 0.0;
|
|||||||
|
|
||||||
float cloudCov(in vec3 pos,vec3 samplePos){
|
float cloudCov(in vec3 pos,vec3 samplePos){
|
||||||
|
|
||||||
|
// float CloudLarge = texture2D(noisetex, samplePos.xz/150000 + cloud_movement1 ).b;
|
||||||
|
// float CloudSmall = texture2D(noisetex, samplePos.xz/15000 - cloud_movement1 + vec2(1-CloudLarge,-CloudLarge)/5).r;
|
||||||
|
|
||||||
|
|
||||||
|
// float coverage = CloudSmall-CloudLarge;
|
||||||
|
|
||||||
|
// // float mult = max( abs(pos.y - (maxHeight+cloud_height)*0.4 ) / 5000, 0);
|
||||||
|
|
||||||
|
// float mult = max( abs(pos.y-1750) / 5000, 0);
|
||||||
|
|
||||||
|
|
||||||
|
// cloudshape = DailyWeather_LowAltitude(coverage) - mult ;
|
||||||
|
|
||||||
|
// return max(cloudshape,0.0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float CloudLarge = texture2D(noisetex, samplePos.xz/150000 + cloud_movement1).b;
|
float CloudLarge = texture2D(noisetex, samplePos.xz/150000 + cloud_movement1).b;
|
||||||
float CloudSmall = texture2D(noisetex, samplePos.xz/15000 - cloud_movement1 + vec2(1-CloudLarge,-CloudLarge)/5).r;
|
float CloudSmall = texture2D(noisetex, samplePos.xz/15000 - cloud_movement1 + vec2(1-CloudLarge,-CloudLarge)/5).r;
|
||||||
|
|
||||||
float coverage = CloudSmall-CloudLarge;
|
float coverage = (CloudSmall) - pow(CloudLarge*0.5+0.5,1.5);
|
||||||
|
|
||||||
float mult = max( abs(pos.y-1750) / 5000, 0);
|
float mult = max( abs(pos.y - (maxHeight+cloud_height)*0.4 ) / 5000, 0);
|
||||||
|
// float mult = max( abs(pos.y-1750) / 5000, 0);
|
||||||
// #ifdef Dynamic_Sky
|
|
||||||
// cloudshape = ( coverage + (-0.35+mix(Weather_properties.r, Rain_coverage, rainCloudwetness)*1.5) ) - mult;
|
|
||||||
// // cloudshape = coverage - mult;
|
|
||||||
// #else
|
|
||||||
// cloudshape = ( coverage + (-0.35+mix(cloudCoverage, Rain_coverage, rainCloudwetness)*1.5) ) - mult ;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
cloudshape = DailyWeather_LowAltitude(coverage) - mult;
|
cloudshape = DailyWeather_LowAltitude(coverage) - mult;
|
||||||
|
|
||||||
@ -159,13 +107,22 @@ float cloudVol(in vec3 pos,in vec3 samplePos,in float cov, in int LoD){
|
|||||||
noise = noise*noise;
|
noise = noise*noise;
|
||||||
float cloud = max(cov-noise*noise*fbmAmount,0.0);
|
float cloud = max(cov-noise*noise*fbmAmount,0.0);
|
||||||
|
|
||||||
|
// // noise = (1.0 - densityAtPos(samplePos * 4.));
|
||||||
|
// // samplePos = floor(samplePos*)/16;
|
||||||
|
// noise += ((1.0 - densityAtPos(samplePos * 16.))*0.5+0.5) * (1.0 - densityAtPos(samplePos * 4.));
|
||||||
|
// // noise += (1.0 - densityAtPos(samplePos / 160 * 1000.));
|
||||||
|
// noise *= clamp(pow(1.0-cloudshape,0.5),0.0,1.0);
|
||||||
|
|
||||||
|
// float cloud = max(cov - noise*noise*noise,0.0) ;
|
||||||
|
|
||||||
return cloud;
|
return cloud;
|
||||||
}
|
}
|
||||||
|
|
||||||
float getCloudDensity(in vec3 pos, in int LoD){
|
float getCloudDensity(in vec3 pos, in int LoD){
|
||||||
|
|
||||||
|
|
||||||
vec3 samplePos = pos*vec3(1.0,1./48.,1.0)/4 ;
|
// vec3 samplePos = floor((pos*vec3(1.0,1./48.,1.0)/4 ) /512)*512 ;
|
||||||
|
vec3 samplePos = pos*vec3(1.0,1./48.,1.0)/4;
|
||||||
float coverageSP = cloudCov(pos,samplePos);
|
float coverageSP = cloudCov(pos,samplePos);
|
||||||
|
|
||||||
if (coverageSP > 0.001) {
|
if (coverageSP > 0.001) {
|
||||||
@ -214,20 +171,39 @@ vec3 Cloud_lighting(
|
|||||||
vec3 moonContributionMulti,
|
vec3 moonContributionMulti,
|
||||||
int cloudType
|
int cloudType
|
||||||
){
|
){
|
||||||
|
|
||||||
// low altitude
|
// low altitude
|
||||||
float powder = max(1.0 - exp2(-CloudShape*100.0),0.0);
|
float powder = 1.0 - exp(-CloudShape * 400.0);
|
||||||
float ambientShading = (powder*0.8+0.2) * exp2(-SkyShadowing * 50.);
|
float ambientShading = exp(-SkyShadowing * 50. + powder)*powder ;
|
||||||
vec3 ambientLighting = SkyColors * 4.0 * ambientShading;
|
vec3 ambientLighting = SkyColors * ambientShading;
|
||||||
|
|
||||||
if(cloudType == 1) ambientLighting = SkyColors * (1.0-powder/2);
|
// if(cloudType == 1) ambientLighting = SkyColors * powder;
|
||||||
|
|
||||||
vec3 sunLighting = ( exp2(-SunShadowing * 2.0 )*sunContribution + exp(-SunShadowing * 0.2 )*sunContributionMulti ) * powder;
|
vec3 sunLighting = exp(-SunShadowing)*sunContribution + exp(-SunShadowing * 0.2)*sunContributionMulti;
|
||||||
|
sunLighting *= powder;
|
||||||
|
|
||||||
vec3 moonLighting = ( exp2(-MoonShadowing * 2.0 )*moonContribution + exp(-MoonShadowing * 0.2 )*moonContributionMulti ) * powder;
|
vec3 moonLighting = ( exp2(-MoonShadowing * 2.0 )*moonContribution + exp(-MoonShadowing * 0.2 )*moonContributionMulti ) * powder;
|
||||||
|
|
||||||
// if(cloudType == 0) sunLighting *= clamp((1.05-CirrusCoverage),0,1); // less sunlight hits low clouds if high clouds have alot of coverage
|
return ambientLighting + sunLighting ;
|
||||||
|
|
||||||
return ambientLighting + sunLighting + moonLighting;
|
|
||||||
|
|
||||||
|
// low altitude
|
||||||
|
// float powder = max(1.0 - exp2(-CloudShape*100.0),0.0);
|
||||||
|
// float ambientShading = (powder*0.8+0.2) * exp2(-SkyShadowing * 50.);
|
||||||
|
// vec3 ambientLighting = SkyColors * 4.0 * ambientShading;
|
||||||
|
|
||||||
|
// if(cloudType == 1) ambientLighting = SkyColors * (1.0-powder/2);
|
||||||
|
|
||||||
|
// vec3 sunLighting = ( exp2(-SunShadowing * 2.0 )*sunContribution + exp(-SunShadowing * 0.2 )*sunContributionMulti ) * powder;
|
||||||
|
// vec3 moonLighting = ( exp2(-MoonShadowing * 2.0 )*moonContribution + exp(-MoonShadowing * 0.2 )*moonContributionMulti ) * powder;
|
||||||
|
|
||||||
|
// // if(cloudType == 0) sunLighting *= clamp((1.05-CirrusCoverage),0,1); // less sunlight hits low clouds if high clouds have alot of coverage
|
||||||
|
|
||||||
|
// return ambientLighting + sunLighting + moonLighting;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 pixelCoord (vec3 Coordinates, int Resolution){
|
||||||
|
return floor(Coordinates / Resolution) * Resolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 startOffset = vec3(0);
|
vec3 startOffset = vec3(0);
|
||||||
@ -284,12 +260,14 @@ vec4 renderClouds(
|
|||||||
|
|
||||||
//setup ray to start at the start of the cloud plane and end at the end of the cloud plane
|
//setup ray to start at the start of the cloud plane and end at the end of the cloud plane
|
||||||
dV_view *= max(maxHeight - cloud_height, 0.0)/dV_view.y/(maxIT_clouds);
|
dV_view *= max(maxHeight - cloud_height, 0.0)/dV_view.y/(maxIT_clouds);
|
||||||
|
|
||||||
|
// dV_view = floor(dV_view/1000)*1000;
|
||||||
startOffset = dV_view*dither;
|
startOffset = dV_view*dither;
|
||||||
|
|
||||||
vec3 camPos = ((cameraPosition*flipClouds)-height)*Cloud_Size;
|
vec3 camPos = ((cameraPosition*flipClouds)-height)*Cloud_Size;
|
||||||
|
|
||||||
vec3 progress_view = startOffset + camPos + dV_view*(cloud_height-camPos.y)/dV_view.y;
|
vec3 progress_view = startOffset + camPos + dV_view*(cloud_height-camPos.y)/dV_view.y;
|
||||||
|
// progress_view = floor
|
||||||
float shadowStep = 200.;
|
float shadowStep = 200.;
|
||||||
vec3 dV_Sun = flipClouds * normalize(mat3(gbufferModelViewInverse)*sunVec)*shadowStep;
|
vec3 dV_Sun = flipClouds * normalize(mat3(gbufferModelViewInverse)*sunVec)*shadowStep;
|
||||||
float mult = length(dV_view);
|
float mult = length(dV_view);
|
||||||
@ -304,13 +282,16 @@ vec4 renderClouds(
|
|||||||
|
|
||||||
// direct light colors and shit for clouds
|
// direct light colors and shit for clouds
|
||||||
// multiply everything by ~pi just for good luck :D
|
// multiply everything by ~pi just for good luck :D
|
||||||
float mieDayMulti = phaseg(SdotV, 0.35)*3.14;
|
// float mieDayMulti = phaseg(SdotV, 0.35)*3.14;
|
||||||
float mieDay = mix(phaseg(SdotV,0.75), mieDayMulti,0.8)*3.14;
|
// float mieDay = mix(phaseg(SdotV,0.75), mieDayMulti,0.8)*3.14;
|
||||||
|
|
||||||
|
float mieDayMulti = phaseg(SdotV, 0.35);
|
||||||
|
float mieDay = (phaseg(SdotV,0.75) + mieDayMulti)*2.0;
|
||||||
|
|
||||||
float mieNightMulti = phaseg(-SdotV, 0.35)*3.14;
|
float mieNightMulti = phaseg(-SdotV, 0.35)*3.14;
|
||||||
float mieNight = mix(phaseg(-SdotV,0.9), mieNightMulti,0.5)*3.14;
|
float mieNight = mix(phaseg(-SdotV,0.9), mieNightMulti,0.5)*3.14;
|
||||||
|
|
||||||
vec3 sunContribution = mieDay*sunColor*6.14;
|
vec3 sunContribution = mieDay*sunColor*3.14;
|
||||||
vec3 sunContributionMulti = mieDayMulti*sunColor*3.14;
|
vec3 sunContributionMulti = mieDayMulti*sunColor*3.14;
|
||||||
|
|
||||||
vec3 moonContribution = mieNight*moonColor*3.14;
|
vec3 moonContribution = mieNight*moonColor*3.14;
|
||||||
@ -325,7 +306,7 @@ vec4 renderClouds(
|
|||||||
|
|
||||||
float cirrusShadowStep = 7.;
|
float cirrusShadowStep = 7.;
|
||||||
float cirrusDensity = 0.03;
|
float cirrusDensity = 0.03;
|
||||||
|
// progress_view = floor(progress_view/512)*512;
|
||||||
|
|
||||||
float cloud = 0.0;
|
float cloud = 0.0;
|
||||||
for(int i=0;i<maxIT_clouds;i++) {
|
for(int i=0;i<maxIT_clouds;i++) {
|
||||||
@ -334,7 +315,9 @@ vec4 renderClouds(
|
|||||||
cloud = getCloudDensity(progress_view, cloudLoD);
|
cloud = getCloudDensity(progress_view, cloudLoD);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float basefade = clamp( (progress_view.y - 1750 ) / 1750 ,0.0,1.0) ;
|
// float basefade = clamp( (progress_view.y - 1750 ) / 1750 ,0.0,1.0) ;
|
||||||
|
float basefade = clamp( (progress_view.y - (maxHeight+cloud_height)*0.25) / ((maxHeight+cloud_height)*0.5) ,0.0,1.0) ;
|
||||||
|
// float basefade = clamp( exp( (progress_view.y - (maxHeight+cloud_height)*0.5 ) / 5/00) ,0.0,1.0) ;
|
||||||
|
|
||||||
float densityofclouds = basefade*cloudDensity ;
|
float densityofclouds = basefade*cloudDensity ;
|
||||||
|
|
||||||
@ -391,7 +374,7 @@ vec4 renderClouds(
|
|||||||
|
|
||||||
#ifdef Cumulus_Clouds
|
#ifdef Cumulus_Clouds
|
||||||
// clamp(abs(dV_Sun.y)/150.0,0.5,1.0)
|
// clamp(abs(dV_Sun.y)/150.0,0.5,1.0)
|
||||||
float muEshA = (cloud*cloudDensity) ;
|
float muEshA = cloud*cloudDensity ;
|
||||||
vec3 S = Cloud_lighting(progress_view, muE, muEshA, muEshD, muEshN, skyCol0 * max(abs(dV_Sun.y)/150.0,0.5), sunContribution, sunContributionMulti, moonContribution, moonContributionMulti, 0);
|
vec3 S = Cloud_lighting(progress_view, muE, muEshA, muEshD, muEshN, skyCol0 * max(abs(dV_Sun.y)/150.0,0.5), sunContribution, sunContributionMulti, moonContribution, moonContributionMulti, 0);
|
||||||
|
|
||||||
// float bottom = clamp( (progress_view.y-3250.*0.6) / 1000. ,0.0,1.0) ;
|
// float bottom = clamp( (progress_view.y-3250.*0.6) / 1000. ,0.0,1.0) ;
|
||||||
|
@ -1,25 +1,3 @@
|
|||||||
#define VL_CLOUDS_SHADOWS
|
|
||||||
#define CLOUDS_SHADOWS
|
|
||||||
#define CLOUDS_SHADOWS_STRENGTH 1.0 //[0.1 0.125 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1.0]
|
|
||||||
#define VL_SAMPLES2 6 //[4 6 8 10 12 14 16 20 24 30 40 50]
|
|
||||||
#define Ambient_Mult 1.0 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0 1.5 2.0 3.0 4.0 5.0 6.0 10.0]
|
|
||||||
#define SEA_LEVEL 70 //[0 10 20 30 40 50 60 70 80 90 100 110 120 130 150 170 190] //The volumetric light uses an altitude-based fog density, this is where fog density is the highest, adjust this value according to your world.
|
|
||||||
#define ATMOSPHERIC_DENSITY 1.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 4.0 5.0 7.5 10.0 12.5 15.0 20.]
|
|
||||||
#define fog_mieg1 0.40 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
#define fog_mieg2 0.10 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.75 0.8 0.85 0.9 0.95 1.0]
|
|
||||||
#define fog_coefficientRayleighR 5.8 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientRayleighG 1.35 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientRayleighB 3.31 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
#define fog_coefficientMieR 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientMieG 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
#define fog_coefficientMieB 3.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
// #define Cloudy_Fog_Density 5.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
// #define Uniform_Fog_Density 1.0 //[0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0]
|
|
||||||
|
|
||||||
// #define uniformfog_fade 10 // [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
// #define cloudyfog_fade 10 // [5 10 20 30 40 50 60 70 80 90 100]
|
|
||||||
|
|
||||||
float luma(vec3 color) {
|
float luma(vec3 color) {
|
||||||
return dot(color,vec3(0.299, 0.587, 0.114));
|
return dot(color,vec3(0.299, 0.587, 0.114));
|
||||||
@ -148,7 +126,7 @@ mat2x3 getVolumetricRays(
|
|||||||
// get the cloud density and apply it
|
// get the cloud density and apply it
|
||||||
cloudShadow = getCloudDensity(cloudPos, 1);
|
cloudShadow = getCloudDensity(cloudPos, 1);
|
||||||
cloudShadow = exp(-cloudShadow*cloudDensity*200);
|
cloudShadow = exp(-cloudShadow*cloudDensity*200);
|
||||||
// cloudShadow *= max_height;
|
cloudShadow *= max_height;
|
||||||
// cloudShadow *= 1000; //debug
|
// cloudShadow *= 1000; //debug
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -174,7 +152,7 @@ mat2x3 getVolumetricRays(
|
|||||||
vec3 vL0 = (DirectLight +AmbientLight+AtmosphericFog + rainRays) * max(eyeBrightnessSmooth.y,0)/240.;
|
vec3 vL0 = (DirectLight +AmbientLight+AtmosphericFog + rainRays) * max(eyeBrightnessSmooth.y,0)/240.;
|
||||||
|
|
||||||
#ifdef Biome_specific_environment
|
#ifdef Biome_specific_environment
|
||||||
BiomeFogColor(vL0);
|
BiomeFogColor(vL0);
|
||||||
#endif
|
#endif
|
||||||
vL += (vL0 - vL0 * exp(-(rL+m)*dd*dL)) / ((rL+m)+0.00000001)*absorbance;
|
vL += (vL0 - vL0 * exp(-(rL+m)*dd*dL)) / ((rL+m)+0.00000001)*absorbance;
|
||||||
absorbance *= clamp(exp(-(rL+m)*dd*dL),0.0,1.0);
|
absorbance *= clamp(exp(-(rL+m)*dd*dL),0.0,1.0);
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
#define Dirt_Amount 0.14 //How much dirt there is in water [0.0 0.04 0.08 0.12 0.16 0.2 0.24 0.28 0.32 0.36 0.4 0.44 0.48 0.52 0.56 0.6 0.64 0.68 0.72 0.76 0.8 0.84 0.88 0.92 0.96 1.0 1.04 1.08 1.12 1.16 1.2 1.24 1.28 1.32 1.36 1.4 1.44 1.48 1.52 1.56 1.6 1.64 1.68 1.72 1.76 1.8 1.84 1.88 1.92 1.96 2.0 ]
|
|
||||||
|
|
||||||
#define Dirt_Scatter_R 0.7 //How much dirt diffuses red [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_G 0.7 //How much dirt diffuses green [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
#define Dirt_Scatter_B 0.7 //How much dirt diffuses blue [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
|
|
||||||
#define Dirt_Absorb_R 1.65 //How much dirt absorbs red [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_G 1.85 //How much dirt absorbs green [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
#define Dirt_Absorb_B 2.05 //How much dirt absorbs blue [0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2 1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6 1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8 1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2.0 ]
|
|
||||||
|
|
||||||
#define Water_Absorb_R 0.2629 //How much water absorbs red [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_G 0.0565 //How much water absorbs green [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
#define Water_Absorb_B 0.01011 //How much water absorbs blue [0.0 0.0025 0.005 0.0075 0.01 0.0125 0.015 0.0175 0.02 0.0225 0.025 0.0275 0.03 0.0325 0.035 0.0375 0.04 0.0425 0.045 0.0475 0.05 0.0525 0.055 0.0575 0.06 0.0625 0.065 0.0675 0.07 0.0725 0.075 0.0775 0.08 0.0825 0.085 0.0875 0.09 0.0925 0.095 0.0975 0.1 0.1025 0.105 0.1075 0.11 0.1125 0.115 0.1175 0.12 0.1225 0.125 0.1275 0.13 0.1325 0.135 0.1375 0.14 0.1425 0.145 0.1475 0.15 0.1525 0.155 0.1575 0.16 0.1625 0.165 0.1675 0.17 0.1725 0.175 0.1775 0.18 0.1825 0.185 0.1875 0.19 0.1925 0.195 0.1975 0.2 0.2025 0.205 0.2075 0.21 0.2125 0.215 0.2175 0.22 0.2225 0.225 0.2275 0.23 0.2325 0.235 0.2375 0.24 0.2425 0.245 0.2475 0.25 ]
|
|
||||||
|
|
||||||
#define Dirt_Mie_Phase 0.4 //Values close to 1 will create a strong peak around the sun and weak elsewhere, values close to 0 means uniform fog. [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ]
|
|
||||||
|
|
||||||
#define rayMarchSampleCount 2 //Number of samples used for the volumetric underwater fog [1 2 3 4 6 8 12 16 32 64]
|
|
||||||
|
|
||||||
#define Water_Top_Layer 62.90 // When under water and when lightMapDepthEstimate is turned off. Assumes the top layer of the water is at this height (minecraft y position) for underwater lighting calculations. If not set correctly, underwater will look incorrect.[0.90 1.90 2.90 3.90 4.90 5.90 6.90 7.90 8.90 9.90 10.90 11.90 12.90 13.90 14.90 15.90 16.90 17.90 18.90 19.90 20.90 21.90 22.90 23.90 24.90 25.90 26.90 27.90 28.90 29.90 30.90 31.90 32.90 33.90 34.90 35.90 36.90 37.90 38.90 39.90 40.90 41.90 42.90 43.90 44.90 45.90 46.90 47.90 48.90 49.90 50.90 51.90 52.90 53.90 54.90 55.90 56.90 57.90 58.90 59.90 60.90 61.90 62.90 63.90 64.90 65.90 66.90 67.90 68.90 69.90 70.90 71.90 72.90 73.90 74.90 75.90 76.90 77.90 78.90 79.90 80.90 81.90 82.90 83.90 84.90 85.90 86.90 87.90 88.90 89.90 90.90 91.90 92.90 93.90 94.90 95.90 96.90 97.90 98.90 99.90 100.90 101.90 102.90 103.90 104.90 105.90 106.90 107.90 108.90 109.90 110.90 111.90 112.90 113.90 114.90 115.90 116.90 117.90 118.90 119.90 120.90 121.90 122.90 123.90 124.90 125.90 126.90 127.90 128.90 129.90 130.90 131.90 132.90 133.90 134.90 135.90 136.90 137.90 138.90 139.90 140.90 141.90 142.90 143.90 144.90 145.90 146.90 147.90 148.90 149.90 150.90 151.90 152.90 153.90 154.90 155.90 156.90 157.90 158.90 159.90 160.90 161.90 162.90 163.90 164.90 165.90 166.90 167.90 168.90 169.90 170.90 171.90 172.90 173.90 174.90 175.90 176.90 177.90 178.90 179.90 180.90 181.90 182.90 183.90 184.90 185.90 186.90 187.90 188.90 189.90 190.90 191.90 192.90 193.90 194.90 195.90 196.90 197.90 198.90 199.90]
|
|
||||||
|
|
||||||
//#define lightMapDepthEstimation // If turned off, will use the player eye position and the Water_Top_Layer option to determine how deep the player is in water. It can look wrong in a lot of cases, and using minecraft light levels instead improves this but will look worse in oceans, lakes and rivers.
|
|
@ -1,8 +1,9 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_ARB_shader_texture_lod : enable
|
#extension GL_ARB_shader_texture_lod : enable
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
#define SHADOW_DISABLE_ALPHA_MIPMAPS // Disables mipmaps on the transparency of alpha-tested things like foliage, may cost a few fps in some cases
|
#include "lib/settings.glsl"
|
||||||
#define Stochastic_Transparent_Shadows // Highly recommanded to enable SHADOW_DISABLE_ALPHA_MIPMAPS with it. Uses noise to simulate transparent objects' shadows (not colored). It is also recommended to increase Min_Shadow_Filter_Radius with this.
|
|
||||||
|
|
||||||
varying vec2 texcoord;
|
varying vec2 texcoord;
|
||||||
uniform sampler2D tex;
|
uniform sampler2D tex;
|
||||||
uniform sampler2D noisetex;
|
uniform sampler2D noisetex;
|
||||||
@ -12,9 +13,7 @@ uniform int frameCounter;
|
|||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
//////////////////////////////VOID MAIN//////////////////////////////
|
//////////////////////////////VOID MAIN//////////////////////////////
|
||||||
// float blueNoise(){
|
|
||||||
// return texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a;
|
|
||||||
// }
|
|
||||||
float R2_dither(){
|
float R2_dither(){
|
||||||
vec2 alpha = vec2(0.75487765, 0.56984026);
|
vec2 alpha = vec2(0.75487765, 0.56984026);
|
||||||
return fract(alpha.x * gl_FragCoord.x + alpha.y * gl_FragCoord.y + 1.0/1.6180339887 ) ;
|
return fract(alpha.x * gl_FragCoord.x + alpha.y * gl_FragCoord.y + 1.0/1.6180339887 ) ;
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
#version 120
|
#version 120
|
||||||
#extension GL_EXT_gpu_shader4 : enable
|
#extension GL_EXT_gpu_shader4 : enable
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
!! DO NOT REMOVE !!
|
!! DO NOT REMOVE !!
|
||||||
This code is from Chocapic13' shaders
|
This code is from Chocapic13' shaders
|
||||||
Read the terms of modification and sharing before changing something below please !
|
Read the terms of modification and sharing before changing something below please !
|
||||||
!! DO NOT REMOVE !!
|
!! DO NOT REMOVE !!
|
||||||
*/
|
*/
|
||||||
//#define SHADOW_FRUSTRUM_CULLING // BROKEN IN 1.17+. If enabled, removes most of the blocks during shadow rendering that would not cast shadows on the player field of view. Improves performance but can be sometimes incorrect and causes flickering shadows on distant occluders
|
#include "lib/settings.glsl"
|
||||||
#define WAVY_PLANTS
|
|
||||||
#define WAVY_STRENGTH 1.0 //[0.1 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0]
|
|
||||||
#define WAVY_SPEED 1.0 //[0.001 0.01 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1.0 1.25 1.5 2.0 3.0 4.0]
|
|
||||||
#include "lib/Shadow_Params.glsl"
|
#include "lib/Shadow_Params.glsl"
|
||||||
|
|
||||||
#define SHADOW_MAP_BIAS 0.5
|
#define SHADOW_MAP_BIAS 0.5
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
#define indirect_effect 1 // Choose what effect is applied to indirect light. [0 1 2 3]
|
#define indirect_effect 1 // Choose what effect is applied to indirect light. [0 1 2 3]
|
||||||
#define AO_Strength 0.8 // strength of shadowed areas [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
#define AO_Strength 0.8 // strength of shadowed areas [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
#define GI_Strength 5.0 // strength of bounced light areas [ 1 2 3 4 5 6 7 8 9 10]
|
|
||||||
|
|
||||||
|
#define GI_Strength 1.0 // strength of bounced light areas [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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
|
|
||||||
// #define HQ_SSGI
|
// #define HQ_SSGI
|
||||||
|
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
#define TORCH_B 0.5 // [0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0]
|
||||||
#define indirect_effect 1 // Choose what effect is applied to indirect light. [0 1 2 3]
|
#define indirect_effect 1 // Choose what effect is applied to indirect light. [0 1 2 3]
|
||||||
#define AO_Strength 0.8 // strength of shadowed areas [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
#define AO_Strength 0.8 // strength of shadowed areas [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
#define GI_Strength 5.0 // strength of bounced light areas [ 1 2 3 4 5 6 7 8 9 10]
|
|
||||||
|
#define GI_Strength 1.0 // strength of bounced light areas [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 2.6 2.7 2.8 2.9 3.0 ]
|
||||||
// #define Glass_Tint // multiply the background through glass by the color of the glass for a strong tint.
|
// #define Glass_Tint // multiply the background through glass by the color of the glass for a strong tint.
|
||||||
|
|
||||||
// #define HQ_SSGI
|
// #define HQ_SSGI
|
||||||
|
@ -30,7 +30,7 @@ uniform vec3 sunPosition;
|
|||||||
|
|
||||||
|
|
||||||
#define cloudCoverage 0.4 // Cloud coverage [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
|
#define cloudCoverage 0.4 // Cloud coverage [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
|
||||||
// #define Rain_coverage 0.8 // how much the coverage of the clouds change during rain [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 3.0 4.0 5.0]
|
#define Rain_coverage 0.6 // how much the coverage of the clouds change during rain [ 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 3.0 4.0 5.0]
|
||||||
|
|
||||||
/////// shape
|
/////// shape
|
||||||
#define cloudDensity 0.0514 // Cloud Density, 0.04-0.06 is around irl values [0.0010 0.0011 0.0013 0.0015 0.0017 0.0020 0.0023 0.0026 0.0030 0.0034 0.0039 0.0045 0.0051 0.0058 0.0067 0.0077 0.0088 0.0101 0.0115 0.0132 0.0151 0.0173 0.0199 0.0228 0.0261 0.0299 0.0342 0.0392 0.0449 0.0514 0.0589 0.0675 0.0773 0.0885 0.1014 0.1162 0.1331 0.1524 0.1746 0.2000 0.3 0.35 0.4 0.45 0.5 0.6 0.7 0.8 0.9 1.0]
|
#define cloudDensity 0.0514 // Cloud Density, 0.04-0.06 is around irl values [0.0010 0.0011 0.0013 0.0015 0.0017 0.0020 0.0023 0.0026 0.0030 0.0034 0.0039 0.0045 0.0051 0.0058 0.0067 0.0077 0.0088 0.0101 0.0115 0.0132 0.0151 0.0173 0.0199 0.0228 0.0261 0.0299 0.0342 0.0392 0.0449 0.0514 0.0589 0.0675 0.0773 0.0885 0.1014 0.1162 0.1331 0.1524 0.1746 0.2000 0.3 0.35 0.4 0.45 0.5 0.6 0.7 0.8 0.9 1.0]
|
||||||
|
Loading…
Reference in New Issue
Block a user