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:
30
shaders/world-1/deferred2.fsh
Normal file
30
shaders/world-1/deferred2.fsh
Normal file
@ -0,0 +1,30 @@
|
||||
#version 120
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
#include "/lib/settings.glsl"
|
||||
|
||||
uniform sampler2D colortex4;
|
||||
uniform sampler2D depthtex1;
|
||||
|
||||
uniform float near;
|
||||
uniform float far;
|
||||
|
||||
|
||||
float linZ(float depth) {
|
||||
return (2.0 * near) / (far + near - depth * (far - near));
|
||||
}
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
|
||||
void main() {
|
||||
/* DRAWBUFFERS:4 */
|
||||
vec3 oldTex = texelFetch2D(colortex4, ivec2(gl_FragCoord.xy), 0).xyz;
|
||||
float newTex = texelFetch2D(depthtex1, ivec2(gl_FragCoord.xy*4), 0).x;
|
||||
|
||||
if (newTex < 1.0)
|
||||
gl_FragData[0] = vec4(oldTex, linZ(newTex)*linZ(newTex)*65000.0);
|
||||
else
|
||||
gl_FragData[0] = vec4(oldTex, 2.0);
|
||||
}
|
Reference in New Issue
Block a user