mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 00:37:35 +08:00
surprise commit
new stuff reworked clouds, general lighting, end and nether shaders still WIP lighting is more balanced in general.
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
#version 120
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
|
||||
#include "lib/settings.glsl"
|
||||
//downsample 1st pass (half res) for bloom
|
||||
#include "lib/res_params.glsl"
|
||||
uniform sampler2D colortex3;
|
||||
// Compute 3x3 min max for TAA
|
||||
|
||||
// uniform sampler2D colortex8;
|
||||
uniform vec2 texelSize;
|
||||
uniform float viewWidth;
|
||||
uniform float viewHeight;
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
@ -12,35 +14,31 @@ uniform sampler2D colortex3;
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
|
||||
void main() {
|
||||
/* DRAWBUFFERS:06 */
|
||||
ivec2 center = ivec2(gl_FragCoord.xy);
|
||||
vec3 current = texelFetch2D(colortex3, center, 0).rgb;
|
||||
vec3 cMin = current;
|
||||
vec3 cMax = current;
|
||||
current = texelFetch2D(colortex3, center + ivec2(-1, -1), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
current = texelFetch2D(colortex3, center + ivec2(-1, 0), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
current = texelFetch2D(colortex3, center + ivec2(-1, 1), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
current = texelFetch2D(colortex3, center + ivec2(0, -1), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
current = texelFetch2D(colortex3, center + ivec2(0, 1), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
current = texelFetch2D(colortex3, center + ivec2(1, -1), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
current = texelFetch2D(colortex3, center + ivec2(1, 0), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
current = texelFetch2D(colortex3, center + ivec2(1, 1), 0).rgb;
|
||||
cMin = min(cMin, current);
|
||||
cMax = max(cMax, current);
|
||||
gl_FragData[0].rgb = cMax;
|
||||
gl_FragData[1].rgb = cMin;
|
||||
|
||||
/* DRAWBUFFERS:6 */
|
||||
vec2 resScale = max(vec2(viewWidth,viewHeight),vec2(1920.0,1080.))/vec2(1920.,1080.);
|
||||
vec2 quarterResTC = gl_FragCoord.xy*texelSize*2.;
|
||||
|
||||
//0.5
|
||||
gl_FragData[0] = texture2D(colortex3,quarterResTC-1.0*vec2(texelSize.x,texelSize.y))/4.*0.5;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+1.0*vec2(texelSize.x,texelSize.y))/4.*0.5;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+vec2(-1.0*texelSize.x,1.0*texelSize.y))/4.*0.5;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+vec2(1.0*texelSize.x,-1.0*texelSize.y))/4.*0.5;
|
||||
|
||||
//0.25
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC-2.0*vec2(texelSize.x,0.0))/2.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+2.0*vec2(0.0,texelSize.y))/2.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+2.0*vec2(0,-texelSize.y))/2*0.125;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+2.0*vec2(-texelSize.x,0.0))/2*0.125;
|
||||
|
||||
//0.125
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC-2.0*vec2(texelSize.x,texelSize.y))/4.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+2.0*vec2(texelSize.x,texelSize.y))/4.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+vec2(-2.0*texelSize.x,2.0*texelSize.y))/4.*0.125;
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC+vec2(2.0*texelSize.x,-2.0*texelSize.y))/4.*0.125;
|
||||
|
||||
//0.125
|
||||
gl_FragData[0] += texture2D(colortex3,quarterResTC)*0.125;
|
||||
|
||||
gl_FragData[0].rgb = clamp(gl_FragData[0].rgb,0.0,65000.);
|
||||
}
|
||||
|
Reference in New Issue
Block a user