Greaserpirate | 2014-02-27 04:16
Crisp Detail Shader (increases visibility)
17
points ]
 (3 votes)
edited by Eihrul

I was messing around with GLSL effects, and I created a shader that actually increases visibility, making enemies as well as map details easier to see. Eihrul came along and cleaned up the code, as well as making it compatible with /forceglsl 0. It's currently included as an option in Red Eclipse SVN, but it works on any Cube2 game.

How to use:

1) back up your data/glsl.cfg and stdshader.cfg files

2) merge the "data" folder with the mod

3) when in-game, type "/setpostfx sharpen"

(you can also add "/setpostfx sharpen" to your autoexec.cfg)

Source code for glsl.cfg usage:

setupfinecorners = [
gl_TexCoord[1].xy = gl_MultiTexCoord0.xy + vec2(-1.0, 0.0);
gl_TexCoord[2].xy = gl_MultiTexCoord0.xy + vec2( 1.0, 0.0);
gl_TexCoord[3].xy = gl_MultiTexCoord0.xy + vec2( 0.0, -1.0);
gl_TexCoord[4].xy = gl_MultiTexCoord0.xy + vec2( 0.0, 1.0);
]

lazyshader 4 "sharpen" [ @fsvs @setupfinecorners } ] [
@fsps
@sample4corners
gl_FragColor = vec4(sample.xyz*1.95 - 0.25*(s00.xyz + s02.xyz + s20.xyz + s22.xyz), sample.w);
}
]

for stdshader.cfg:

setupfinecorners = [
ADD result.texcoord[1], vertex.texcoord[0], { -1, 0, 0, 0 };
ADD result.texcoord[2], vertex.texcoord[0], { 1, 0, 0, 0 };
ADD result.texcoord[3], vertex.texcoord[0], { 0, -1, 0, 0 };
ADD result.texcoord[4], vertex.texcoord[0], { 0, 1, 0, 0 };
]

lazyshader 0 "sharpen" [ @fsvs @setupfinecorners END ] [
@fsps
@sample4corners
ADD s00.xyz, s00, s02;
ADD s00.xyz, s00, s20;
ADD s00.xyz, s00, s22;
MUL sample.xyz, sample, 1.95;
MAD result.color.rgb, s00, -0.25, sample;
MOV result.color.a, sample.a;
END
]

sharp_shader.zip (26.67 KB)
17
points
 (3 votes)
User login
Users on Quadropolis
1 guest & no users online
7
points ]
 (1 vote)
Created 2022-04-21 09:26
6 weeks 17 hours ago
8
points ]
 (1 vote)
Created 2022-01-23 15:48
18 weeks 4 days ago
Created 2021-11-05 01:27
30 weeks 1 hour ago
36
points ]
 (4 votes)
Created 2020-12-10 12:49
1 year 24 weeks ago
32
points ]
 (4 votes)
Created 2012-08-30 04:30
9 years 39 weeks ago
10
points ]
 (1 vote)
Created 2019-10-16 01:26
2 years 33 weeks ago
9
points ]
 (1 vote)
Created 2021-06-17 22:42
50 weeks 4 hours ago
30
points ]
 (3 votes)
Created 2020-11-30 04:00
1 year 26 weeks ago
10
points ]
 (1 vote)
Created 2021-05-24 00:01
1 year 1 week ago
MisanthropX
92
points ]
 (10 votes)
Created 2019-12-05 20:57
2 years 25 weeks ago
20
points ]
 (2 votes)
Created 2020-12-20 03:04
1 year 23 weeks ago
30
points ]
 (3 votes)
Created 2020-12-04 12:05
1 year 25 weeks ago
20
points ]
 (2 votes)
Created 2020-12-03 17:12
1 year 25 weeks ago
30
points ]
 (3 votes)
Created 2020-06-13 21:05
1 year 50 weeks ago
60
points ]
 (6 votes)
Created 2020-01-23 12:57
2 years 18 weeks ago
78
points ]
 (8 votes)
Created 2020-10-11 13:46
1 year 33 weeks ago
64
points ]
 (7 votes)
Created 2018-12-04 15:12
3 years 25 weeks ago
Gangler
36
points ]
 (4 votes)
Created 2020-10-22 00:50
1 year 32 weeks ago
LURKing
13
points ]
 (2 votes)
Created 2020-11-22 21:21
1 year 27 weeks ago
LURKing
37
points ]
 (4 votes)
Created 2020-11-18 21:08
1 year 28 weeks ago
Who's new
  • ColdIV
  • Aidan
  • Hunk
  • letic86
  • BATMAN