mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 00:37:35 +08:00
fix shadowmap blending when DH is enabled. Fix slime not being shiny. add CLOUDS INTERSECT TERRAIN misc setting. make minimum DH overdraw prevention distance 2 chunks
This commit is contained in:
@ -101,7 +101,7 @@ uniform vec3 cameraPosition;
|
||||
void main() {
|
||||
|
||||
#ifdef DH_OVERDRAW_PREVENTION
|
||||
if(clamp(1.0-length(pos.xyz)/max(far - 32.0,0.0),0.0,1.0) > 0.0 ){
|
||||
if(clamp(1.0-length(pos.xyz)/max(far - 32.0,32.0),0.0,1.0) > 0.0 ){
|
||||
discard;
|
||||
return;
|
||||
}
|
||||
|
@ -385,7 +385,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
#ifdef SNELLS_WINDOW
|
||||
if(isEyeInWater == 1) fresnel = pow(clamp(1.5 + normalDotEye,0.0,1.0), 25.0);
|
||||
#endif
|
||||
|
||||
#ifdef SCREENSPACE_REFLECTIONS
|
||||
vec3 rtPos = rayTrace(reflectedVector, viewPos, interleaved_gradientNoise(), fresnel, false);
|
||||
if (rtPos.z < 1.){
|
||||
@ -398,13 +397,13 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WATER_BACKGROUND_SPECULAR
|
||||
BackgroundReflection = skyCloudsFromTex(mat3(gbufferModelViewInverse) * reflectedVector, colortex4).rgb / 30.0;
|
||||
#endif
|
||||
#ifdef WATER_SUN_SPECULAR
|
||||
SunReflection = Direct_lighting * GGX(normalize(normals), -normalize(viewPos), normalize(WsunVec2), roughness, f0);
|
||||
SunReflection = Direct_lighting * GGX(normalize(normals), -normalize(viewPos), normalize(WsunVec2), roughness, f0) * (1.0-Reflections.a);
|
||||
#endif
|
||||
|
||||
Reflections_Final = mix(BackgroundReflection, Reflections.rgb, Reflections.a) * fresnel;
|
||||
Reflections_Final += SunReflection;
|
||||
|
||||
|
@ -456,6 +456,7 @@ void main() {
|
||||
gl_FragData[3].a = 0.0;
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////// ////////////////////////////////
|
||||
//////////////////////////////// NORMAL ////////////////////////////////
|
||||
//////////////////////////////// ////////////////////////////////
|
||||
|
@ -752,10 +752,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
#ifdef DAMAGE_BLOCK_EFFECT
|
||||
#undef WATER_REFLECTIONS
|
||||
#endif
|
||||
|
||||
// #ifdef ENTITIES
|
||||
// #undef WATER_BACKGROUND_SPECULAR
|
||||
// #endif
|
||||
|
||||
#ifndef OVERWORLD_SHADER
|
||||
#undef WATER_SUN_SPECULAR
|
||||
@ -889,7 +885,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
#ifndef HAND
|
||||
gl_FragData[1] = vec4(Albedo, MATERIALS);
|
||||
#endif
|
||||
|
||||
#if DEBUG_VIEW == debug_DH_WATER_BLENDING
|
||||
if(gl_FragCoord.x*texelSize.x < 0.47) gl_FragData[0] = vec4(0.0);
|
||||
#endif
|
||||
|
@ -116,7 +116,7 @@ void main() {
|
||||
// translucent entities
|
||||
#if defined ENTITIES || defined BLOCKENTITIES
|
||||
mat = 0.9;
|
||||
if (entityId == 1403) mat = 0.8;
|
||||
if (entityId == 1803) mat = 0.8;
|
||||
#endif
|
||||
|
||||
// translucent blocks
|
||||
|
@ -8,9 +8,10 @@ flat varying vec2 TAA_Offset;
|
||||
|
||||
uniform sampler2D depthtex0;
|
||||
uniform sampler2D depthtex1;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#endif
|
||||
|
||||
uniform sampler2D colortex1;
|
||||
@ -23,11 +24,11 @@ uniform sampler2D colortex15; // Noise
|
||||
|
||||
uniform sampler2D shadow;
|
||||
|
||||
// #ifdef TRANSLUCENT_COLORED_SHADOWS
|
||||
#ifdef TRANSLUCENT_COLORED_SHADOWS
|
||||
uniform sampler2D shadowcolor0;
|
||||
uniform sampler2D shadowtex0;
|
||||
uniform sampler2D shadowtex1;
|
||||
// #endif
|
||||
#endif
|
||||
|
||||
|
||||
uniform sampler2D noisetex;
|
||||
|
@ -170,6 +170,7 @@ vec3 toScreenSpace(vec3 p) {
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
// #define CLOUDS_INTERSECT_TERRAIN
|
||||
#endif
|
||||
|
||||
#include "/lib/util.glsl"
|
||||
@ -360,120 +361,6 @@ vec3 worldToView(vec3 worldPos) {
|
||||
return pos.xyz;
|
||||
}
|
||||
|
||||
void waterVolumetrics_notoverworld(inout vec3 inColor, vec3 rayStart, vec3 rayEnd, float estEndDepth, float estSunDepth, float rayLength, float dither, vec3 waterCoefs, vec3 scatterCoef, vec3 ambient){
|
||||
inColor *= exp(-rayLength * waterCoefs); //No need to take the integrated value
|
||||
int spCount = rayMarchSampleCount;
|
||||
vec3 start = toShadowSpaceProjected(rayStart);
|
||||
vec3 end = toShadowSpaceProjected(rayEnd);
|
||||
vec3 dV = (end-start);
|
||||
//limit ray length at 32 blocks for performance and reducing integration error
|
||||
//you can't see above this anyway
|
||||
float maxZ = min(rayLength,12.0)/(1e-8+rayLength);
|
||||
dV *= maxZ;
|
||||
vec3 dVWorld = -mat3(gbufferModelViewInverse) * (rayEnd - rayStart) * maxZ;
|
||||
rayLength *= maxZ;
|
||||
estEndDepth *= maxZ;
|
||||
estSunDepth *= maxZ;
|
||||
vec3 absorbance = vec3(1.0);
|
||||
vec3 vL = vec3(0.0);
|
||||
|
||||
|
||||
float expFactor = 11.0;
|
||||
vec3 progressW = gbufferModelViewInverse[3].xyz+cameraPosition;
|
||||
for (int i=0;i<spCount;i++) {
|
||||
float d = (pow(expFactor, float(i+dither)/float(spCount))/expFactor - 1.0/expFactor)/(1-1.0/expFactor);
|
||||
float dd = pow(expFactor, float(i+dither)/float(spCount)) * log(expFactor) / float(spCount)/(expFactor-1.0);
|
||||
vec3 spPos = start.xyz + dV*d;
|
||||
progressW = gbufferModelViewInverse[3].xyz+cameraPosition + d*dVWorld;
|
||||
|
||||
vec3 ambientMul = exp(-max(estEndDepth * d,0.0) * waterCoefs);
|
||||
|
||||
vec3 light = (ambientMul*ambient) * scatterCoef;
|
||||
|
||||
vL += (light - light * exp(-waterCoefs * dd * rayLength)) / waterCoefs *absorbance;
|
||||
absorbance *= exp(-dd * rayLength * waterCoefs);
|
||||
}
|
||||
inColor += vL;
|
||||
}
|
||||
|
||||
#ifdef OVERWORLD_SHADER
|
||||
|
||||
|
||||
float fogPhase(float lightPoint){
|
||||
float linear = 1.0 - clamp(lightPoint*0.5+0.5,0.0,1.0);
|
||||
float linear2 = 1.0 - clamp(lightPoint,0.0,1.0);
|
||||
|
||||
float exponential = exp2(pow(linear,0.3) * -15.0 ) * 1.5;
|
||||
exponential += sqrt(exp2(sqrt(linear) * -12.5));
|
||||
|
||||
return exponential;
|
||||
}
|
||||
|
||||
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){
|
||||
int spCount = rayMarchSampleCount;
|
||||
|
||||
vec3 start = toShadowSpaceProjected(rayStart);
|
||||
vec3 end = toShadowSpaceProjected(rayEnd);
|
||||
vec3 dV = (end-start);
|
||||
|
||||
//limit ray length at 32 blocks for performance and reducing integration error
|
||||
//you can't see above this anyway
|
||||
float maxZ = min(rayLength,12.0)/(1e-8+rayLength);
|
||||
dV *= maxZ;
|
||||
rayLength *= maxZ;
|
||||
estEndDepth *= maxZ;
|
||||
estSunDepth *= maxZ;
|
||||
|
||||
vec3 wpos = mat3(gbufferModelViewInverse) * rayStart + gbufferModelViewInverse[3].xyz;
|
||||
vec3 dVWorld = (wpos - gbufferModelViewInverse[3].xyz);
|
||||
|
||||
inColor *= exp(-rayLength * waterCoefs); // No need to take the integrated value
|
||||
float phase = fogPhase(VdotL) * 5.0;
|
||||
vec3 absorbance = vec3(1.0);
|
||||
vec3 vL = vec3(0.0);
|
||||
|
||||
float expFactor = 11.0;
|
||||
for (int i=0;i<spCount;i++) {
|
||||
float d = (pow(expFactor, float(i+dither)/float(spCount))/expFactor - 1.0/expFactor)/(1-1.0/expFactor);
|
||||
float dd = pow(expFactor, float(i+dither)/float(spCount)) * log(expFactor) / float(spCount)/(expFactor-1.0);
|
||||
vec3 spPos = start.xyz + dV*d;
|
||||
|
||||
vec3 progressW = start.xyz+cameraPosition+dVWorld;
|
||||
|
||||
//project into biased shadowmap space
|
||||
#ifdef DISTORT_SHADOWMAP
|
||||
float distortFactor = calcDistort(spPos.xy);
|
||||
#else
|
||||
float distortFactor = 1.0;
|
||||
#endif
|
||||
|
||||
vec3 pos = vec3(spPos.xy*distortFactor, spPos.z);
|
||||
float sh = 1.0;
|
||||
if (abs(pos.x) < 1.0-0.5/2048. && abs(pos.y) < 1.0-0.5/2048){
|
||||
pos = pos*vec3(0.5,0.5,0.5/6.0)+0.5;
|
||||
sh = shadow2D( shadow, pos).x;
|
||||
}
|
||||
|
||||
#ifdef VL_CLOUDS_SHADOWS
|
||||
sh *= GetCloudShadow_VLFOG(progressW,WsunVec);
|
||||
#endif
|
||||
|
||||
vec3 sunMul = exp(-estSunDepth * d * waterCoefs * 1.1);
|
||||
vec3 ambientMul = exp(-estEndDepth * d * waterCoefs );
|
||||
|
||||
vec3 Directlight = (lightSource * phase * sunMul) * sh;
|
||||
vec3 Indirectlight = ambient * ambientMul;
|
||||
|
||||
vec3 light = (Indirectlight + Directlight) * scatterCoef;
|
||||
|
||||
vL += (light - light * exp(-waterCoefs * dd * rayLength)) / waterCoefs * absorbance;
|
||||
absorbance *= exp(-waterCoefs * dd * rayLength);
|
||||
}
|
||||
inColor += vL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
vec2 SSRT_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, float noise, bool isSSS, bool hand){
|
||||
|
||||
float handSwitch = hand ? 1.0 : 0.0;
|
||||
@ -930,16 +817,7 @@ void main() {
|
||||
vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B);
|
||||
vec3 dirtEpsilon = vec3(Dirt_Absorb_R, Dirt_Absorb_G, Dirt_Absorb_B);
|
||||
vec3 totEpsilon = dirtEpsilon*dirtAmount + waterEpsilon;
|
||||
vec3 scatterCoef = dirtAmount * vec3(Dirt_Scatter_R, Dirt_Scatter_G, Dirt_Scatter_B) / 3.14;
|
||||
|
||||
#ifdef BIOME_TINT_WATER
|
||||
// yoink the biome tint written in this buffer for water only.
|
||||
if(isWater){
|
||||
vec2 translucentdata = texture2D(colortex11,texcoord).gb;
|
||||
vec3 wateralbedo = vec3(decodeVec2(translucentdata.x),decodeVec2(translucentdata.y).x);
|
||||
scatterCoef = dirtAmount * wateralbedo / 3.14;
|
||||
}
|
||||
#endif
|
||||
vec3 Absorbtion = vec3(1.0);
|
||||
vec3 AmbientLightColor = vec3(0.0);
|
||||
vec3 MinimumLightColor = vec3(1.0);
|
||||
@ -971,11 +849,6 @@ void main() {
|
||||
bool inShadowmapBounds = false;
|
||||
#endif
|
||||
|
||||
#ifdef CLOUDS_INFRONT_OF_WORLD
|
||||
float heightRelativeToClouds = clamp(cameraPosition.y - LAYER0_minHEIGHT,0.0,1.0);
|
||||
vec4 Clouds = texture2D_bicubic_offset(colortex0, texcoord*CLOUDS_QUALITY, noise, RENDER_SCALE.x);
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////// FILTER STUFF //////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1036,13 +909,9 @@ void main() {
|
||||
vec3 Sky = skyFromTex(feetPlayerPos_normalized, colortex4)/30.0;
|
||||
Background += Sky;
|
||||
|
||||
#ifdef VOLUMETRIC_CLOUDS
|
||||
#ifdef CLOUDS_INFRONT_OF_WORLD
|
||||
if(heightRelativeToClouds < 1.0) Background = Background * Clouds.a + Clouds.rgb;
|
||||
#else
|
||||
vec4 Clouds = texture2D_bicubic_offset(colortex0, texcoord*CLOUDS_QUALITY, noise, RENDER_SCALE.x);
|
||||
Background = Background * Clouds.a + Clouds.rgb;
|
||||
#endif
|
||||
#if defined VOLUMETRIC_CLOUDS && !defined CLOUDS_INTERSECT_TERRAIN
|
||||
vec4 Clouds = texture2D_bicubic_offset(colortex0, texcoord*CLOUDS_QUALITY, noise, RENDER_SCALE.x);
|
||||
Background = Background * Clouds.a + Clouds.rgb;
|
||||
#endif
|
||||
|
||||
gl_FragData[0].rgb = clamp(fp10Dither(Background, triangularize(noise_2)), 0.0, 65000.);
|
||||
@ -1296,8 +1165,8 @@ void main() {
|
||||
float sunSSS_density = LabSSS;
|
||||
float SSS_shadow = ShadowAlpha * Shadows;
|
||||
|
||||
#ifdef DISTANT_HORIZONS_SHADOWMAP
|
||||
shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / min(shadowDistance, far-32),0.0)*5.0,1.0));
|
||||
#ifdef DISTANT_HORIZONS
|
||||
shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / min(shadowDistance, max(far-32.0,32.0)),0.0)*5.0,1.0));
|
||||
#endif
|
||||
|
||||
#ifndef RENDER_ENTITY_SHADOWS
|
||||
@ -1370,6 +1239,15 @@ void main() {
|
||||
gl_FragData[0].rgb = gl_FragData[0].rgb * vlBehingTranslucents.a + vlBehingTranslucents.rgb;
|
||||
}
|
||||
|
||||
#if defined VOLUMETRIC_CLOUDS && defined CLOUDS_INTERSECT_TERRAIN
|
||||
vec4 Clouds = texture2D_bicubic_offset(colortex0, texcoord*CLOUDS_QUALITY, noise, RENDER_SCALE.x);
|
||||
// vec4 Clouds = BilateralUpscale_REUSE_Z_clouds(colortex0, colortex12, DH_mixedLinearZ, gl_FragCoord.xy*CLOUDS_QUALITY, texcoord*CLOUDS_QUALITY);
|
||||
|
||||
gl_FragData[1] = texture2D(colortex2, texcoord);
|
||||
gl_FragData[0].rgb = gl_FragData[0].rgb * Clouds.a + Clouds.rgb;
|
||||
gl_FragData[1].a = gl_FragData[1].a * pow(Clouds.a,5.0);
|
||||
#endif
|
||||
|
||||
// gl_FragData[0].rgb = vec3(1.0) * clamp(1.0 - filteredShadow.y/1,0,1);
|
||||
// if(hideGUI > 0) gl_FragData[0].rgb = vec3(1.0) * Shadows;
|
||||
////// DEBUG VIEW STUFF
|
||||
@ -1403,24 +1281,5 @@ void main() {
|
||||
// if(hideGUI == 0) gl_FragData[0].rgb = vec3(1) * filteredShadow.z;//exp(-7*(1-clamp(1.0 - filteredShadow.x,0.0,1.0)));
|
||||
#endif
|
||||
|
||||
|
||||
// float shadew = clamp(1.0 - filteredShadow.y/1,0.0,1.0);
|
||||
// // if(hideGUI == 1)
|
||||
|
||||
|
||||
|
||||
#ifdef CLOUDS_INFRONT_OF_WORLD
|
||||
gl_FragData[1] = texture2D(colortex2, texcoord);
|
||||
if(heightRelativeToClouds > 0.0 && !hand){
|
||||
gl_FragData[0].rgb = gl_FragData[0].rgb * Clouds.a + Clouds.rgb;
|
||||
gl_FragData[1].a = gl_FragData[1].a*Clouds.a*Clouds.a*Clouds.a;
|
||||
}
|
||||
|
||||
/* DRAWBUFFERS:32 */
|
||||
|
||||
#else
|
||||
|
||||
/* DRAWBUFFERS:3 */
|
||||
|
||||
#endif
|
||||
/* DRAWBUFFERS:3 */
|
||||
}
|
@ -217,6 +217,7 @@ void ApplyDistortion(inout vec2 Texcoord, vec2 TangentNormals, float lineardista
|
||||
|
||||
uniform int dhRenderDistance;
|
||||
uniform float eyeAltitude;
|
||||
|
||||
void main() {
|
||||
/* DRAWBUFFERS:73 */
|
||||
|
||||
|
@ -236,7 +236,6 @@ if (gl_FragCoord.x > pixelPos6.x && gl_FragCoord.x < pixelPos6.x + 1 && gl_FragC
|
||||
#else
|
||||
if (gl_FragCoord.x > 6. && gl_FragCoord.x < 7. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )
|
||||
gl_FragData[0] = vec4(lightSourceColor,1.0);
|
||||
|
||||
if (gl_FragCoord.x > 8. && gl_FragCoord.x < 9. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )
|
||||
gl_FragData[0] = vec4(sunColor,1.0);
|
||||
if (gl_FragCoord.x > 9. && gl_FragCoord.x < 10. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )
|
||||
|
@ -19,7 +19,10 @@ uniform sampler2D depthtex0;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
uniform sampler2D dhDepthTex;
|
||||
uniform sampler2D dhDepthTex1;
|
||||
#endif
|
||||
|
||||
|
||||
// uniform sampler2D colortex4;
|
||||
uniform sampler2D noisetex;
|
||||
|
||||
@ -37,8 +40,12 @@ uniform mat4 gbufferModelViewInverse;
|
||||
uniform vec3 cameraPosition;
|
||||
|
||||
uniform mat4 gbufferModelView;
|
||||
uniform mat4 gbufferProjection;
|
||||
// flat varying vec2 TAA_Offset;
|
||||
|
||||
#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);
|
||||
@ -47,6 +54,9 @@ vec3 toScreenSpace(vec3 p) {
|
||||
return fragposition.xyz / fragposition.w;
|
||||
}
|
||||
|
||||
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
float R2_dither(){
|
||||
#ifdef TAA
|
||||
vec2 coord = gl_FragCoord.xy + (frameCounter%40000) * 2.0;
|
||||
@ -86,14 +96,26 @@ float blueNoise(){
|
||||
vec3 normVec (vec3 vec){
|
||||
return vec*inversesqrt(dot(vec,vec));
|
||||
}
|
||||
uniform float far;
|
||||
|
||||
|
||||
float ld(float dist) {
|
||||
return (2.0 * near) / (far + near - dist * (far - near));
|
||||
}
|
||||
|
||||
uniform int dhRenderDistance;
|
||||
|
||||
#include "/lib/lightning_stuff.glsl"
|
||||
|
||||
#include "/lib/sky_gradient.glsl"
|
||||
|
||||
// #define CLOUDS_INTERSECT_TERRAIN
|
||||
#include "/lib/volumetricClouds.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
@ -105,12 +127,22 @@ void main() {
|
||||
/* DRAWBUFFERS:0 */
|
||||
#if defined OVERWORLD_SHADER && defined VOLUMETRIC_CLOUDS
|
||||
vec2 halfResTC = vec2(floor(gl_FragCoord.xy)/CLOUDS_QUALITY/RENDER_SCALE+0.5+offsets[framemod8]*CLOUDS_QUALITY*RENDER_SCALE*0.5);
|
||||
|
||||
float depth = texture2D(depthtex0, halfResTC*texelSize).x;
|
||||
|
||||
|
||||
// vec3 viewPos = toScreenSpace(vec3(halfResTC*texelSize, depth));
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_depth = texture2D(dhDepthTex, halfResTC*texelSize).x;
|
||||
vec3 viewPos = toScreenSpace_DH(halfResTC*texelSize, depth, DH_depth);
|
||||
#else
|
||||
vec3 viewPos = toScreenSpace(vec3(halfResTC*texelSize, depth));
|
||||
#endif
|
||||
|
||||
vec3 viewPos = toScreenSpace(vec3(halfResTC*texelSize,1.0));
|
||||
|
||||
vec4 VolumetricClouds = renderClouds(viewPos, vec2(R2_dither(), blueNoise()), sunColor/80.0, averageSkyCol/30.0);
|
||||
|
||||
// gl_FragData[0] = vec4(0.0,0.0,0.0,1.0);
|
||||
gl_FragData[0] = VolumetricClouds;
|
||||
#else
|
||||
gl_FragData[0] = vec4(0.0,0.0,0.0,1.0);
|
||||
|
@ -155,14 +155,6 @@ void main() {
|
||||
|
||||
applyGameplayEffects_FRAGMENT(FINAL_COLOR, texcoord, interleaved_gradientNoise()); // for making the fun, more fun
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// float reprojectedBuffer = texture2D(colortex14, texcoord).a;
|
||||
|
||||
// gl_FragColor.rgb = vec3(1.0) * reprojectedBuffer;
|
||||
|
||||
gl_FragColor.rgb = FINAL_COLOR;
|
||||
|
||||
#if DEBUG_VIEW == debug_SHADOWMAP
|
||||
|
@ -24,6 +24,7 @@ uniform sampler2D colortex3;
|
||||
// uniform sampler2D colortex4;
|
||||
uniform sampler2D colortex6;
|
||||
uniform sampler2D colortex7;
|
||||
uniform sampler2D colortex11;
|
||||
uniform sampler2D colortex14;
|
||||
|
||||
flat varying vec3 WsunVec;
|
||||
@ -319,6 +320,15 @@ void main() {
|
||||
vec3 totEpsilon = dirtEpsilon*dirtAmount + waterEpsilon;
|
||||
vec3 scatterCoef = dirtAmount * vec3(Dirt_Scatter_R, Dirt_Scatter_G, Dirt_Scatter_B) / 3.14;
|
||||
|
||||
#ifdef BIOME_TINT_WATER
|
||||
// yoink the biome tint written in this buffer for water only.
|
||||
if(iswater){
|
||||
vec2 translucentdata = texture2D(colortex11,tc).gb;
|
||||
vec3 wateralbedo = normalize(vec3(decodeVec2(translucentdata.x),decodeVec2(translucentdata.y).x)+0.00001) * 0.5 + 0.5;
|
||||
scatterCoef = dirtAmount * wateralbedo / 3.14;
|
||||
}
|
||||
#endif
|
||||
|
||||
vec3 directLightColor = lightCol.rgb/80.0;
|
||||
vec3 indirectLightColor = averageSkyCol/30.0;
|
||||
vec3 indirectLightColor_dynamic = averageSkyCol_Clouds/30.0;
|
||||
@ -350,9 +360,9 @@ void main() {
|
||||
|
||||
|
||||
|
||||
indirectLightColor_dynamic *= ambient_brightness * pow(1.0-pow(1.0-lightmap.y,0.5),3.0) ;
|
||||
float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*exposure),0.0,1.0)) ;
|
||||
indirectLightColor_dynamic += vec3(TORCH_R,TORCH_G,TORCH_B) * TorchBrightness_autoAdjust * pow(1.0-sqrt(1.0-clamp(lightmap.x,0.0,1.0)),2.0) * 2.0;
|
||||
// indirectLightColor_dynamic *= ambient_brightness * pow(1.0-pow(1.0-lightmap.y,0.5),3.0) ;
|
||||
// float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*exposure),0.0,1.0)) ;
|
||||
// indirectLightColor_dynamic += vec3(TORCH_R,TORCH_G,TORCH_B) * TorchBrightness_autoAdjust * pow(1.0-sqrt(1.0-clamp(lightmap.x,0.0,1.0)),2.0) * 2.0;
|
||||
|
||||
vec4 VolumetricFog2 = vec4(0,0,0,1);
|
||||
#ifdef OVERWORLD_SHADER
|
||||
|
Reference in New Issue
Block a user