Compare commits
5 commits
f89d8ac3c9
...
6fc995e5cb
Author | SHA1 | Date | |
---|---|---|---|
6fc995e5cb | |||
b9dcdd22d6 | |||
c36e1076f7 | |||
e4c5715b3f | |||
5937638895 |
4 changed files with 24 additions and 16 deletions
10
shaders/gbuffers_damagedblock.fsh
Normal file
10
shaders/gbuffers_damagedblock.fsh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#version 120
|
||||
|
||||
varying vec2 texcoord;
|
||||
|
||||
uniform sampler2D texture;
|
||||
|
||||
void main() {
|
||||
gl_FragData[0] = texture2D(texture, texcoord);
|
||||
}
|
||||
|
3
shaders/gbuffers_damagedblock.vsh
Normal file
3
shaders/gbuffers_damagedblock.vsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
#include "/gbuffers_basic.vsh"
|
||||
|
|
@ -8,21 +8,16 @@ float avg(float l, float c, float r) {
|
|||
vec3 hblur() {
|
||||
vec3 center = texture2D(gcolor, texcoord).rgb;
|
||||
|
||||
vec2 leftPos = texcoord - neighborOffset;
|
||||
vec2 rightPos = texcoord + neighborOffset;
|
||||
|
||||
vec3 left;
|
||||
if(leftPos.x >= 0)
|
||||
left = texture2D(gcolor, leftPos).rgb;
|
||||
else
|
||||
left = center;
|
||||
|
||||
vec3 right;
|
||||
if(rightPos.x >= 0)
|
||||
right = texture2D(gcolor, rightPos).rgb;
|
||||
else
|
||||
right = center;
|
||||
|
||||
return vec3(avg(left.r, center.r, right.r), avg(left.g, center.g, right.g), avg(left.b, center.b, right.b));
|
||||
vec3 sum = vec3(0);
|
||||
int count = 0;
|
||||
for(int x = -2; x < 2; x++) {
|
||||
vec2 pos = texcoord - (neighborOffset * x);
|
||||
if(pos.x >= 0 && pos.x < viewWidth) {
|
||||
sum += texture2D(gcolor, pos).rgb;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return sum / count;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ screen.COLOR.columns=3
|
|||
screen.COLOR=colorMode dithering <empty> colorDepth <empty> monoPalette hueBits satBits valBits
|
||||
|
||||
# screen effects
|
||||
screen.SCREEN=signal wire <empty> <empty> interlacing scanline <empty> <empty> aberration
|
||||
screen.SCREEN=signal wire interlacing scanline <empty> <empty> aberration
|
||||
|
||||
# console effects
|
||||
screen.CONSOLE.columns=1
|
||||
|
|
Loading…
Reference in a new issue