/base/glsl/postfx.frag (e4a89947d2bdcbbfdbb90857d6260052448c32e7) (999 bytes) (mode 100644) (type blob)
/*
Formerly a bloom shader, now a simpler brightness shader.
Switches to a red vignette when u_fog.a < 0.001.
u_fog contains bloom parameters (not fog). u_fog.a is set to 0.0
when player health <= 25 so damage can be indicated visually.
*/
uniform sampler2D u_texture;
uniform vec4 u_fog;
uniform vec3 u_camera;
in vec2 v_UV;
in vec4 v_RelativePos;
out vec4 fragColor;
void main(){
float threshold = u_fog.z;
float amount = u_fog.w;
// Create a more pleasant hue.
vec3 color = texture( u_texture, v_UV ).rgb * vec3( 1.04, 1.02, 1.0 );
float value = color.r * 0.3 + color.g * 0.6 + color.b * 0.1;
vec3 result =
color * ( max( value - threshold, 0.0 ) * 0.8 + ( value > threshold ? 0.4 : 0.0 ) );
if( u_fog.a < 0.001 ){
// Red vignette.
vec2 c = v_UV * 2.0 - 1.0;
float f = dot( c, c * c * c ) * 0.5;
fragColor =
vec4( mix( color + result * amount, vec3( 1.0, 0.0, 0.0 ), f ), 1.0 );
}else{
// No vignette.
fragColor = vec4( color + result * amount, 1.0 );
}
}
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
98 |
227abf3bfa53b2530dcc74495da7bd0ccdcb0775 |
.gitignore |
100644 |
blob |
225 |
9b00c2c2e7b4f0c1e338fdead65f17ba0af089c1 |
COPYING |
100755 |
blob |
43 |
45aea818a4a3202b2467509f28a481cce08834d2 |
Confectioner.command |
100644 |
blob |
14015 |
649b7f0c112c3ac13287bfe88b949fec50356e4d |
Makefile |
100644 |
blob |
2723 |
b5a3f573f076ef740ca742ec9598043732e10c0e |
README.md |
040000 |
tree |
- |
6b3a1677d07517c1f83769dd7675fe6bb9d7a269 |
base |
100755 |
blob |
156 |
84cb1387849f2ca98e53e43536d00af2dfabf7d3 |
caveconfec |
100755 |
blob |
28 |
41b0ef285892c86306eaa269f366dd04cb633d21 |
caveconfec.bat |
100644 |
blob |
198037 |
a0180394c9bf29c02b7ef05916bd5573e3f37da2 |
confec.cpp |
100644 |
blob |
487269 |
29cfd3578eb40b1f039e271bcaa81af49d1b7f3c |
gamecontrollerdb.txt |
040000 |
tree |
- |
62e9d686bbab52d3d88886390b437a3ecef315de |
include |
100755 |
blob |
12081 |
ad29f012941aedfd4ee7232ed95fb68c8c5244c9 |
index-template.html |
100755 |
blob |
1065 |
a460e3c74b8fa53a6f609944ef7e41558479e73f |
libs.cpp |
100755 |
blob |
27581 |
8350a63e947e8a4a55608fd090d128fef7b969a1 |
micropather.cpp |
100644 |
blob |
141235 |
f54e2d2631a628876a631456c043b77da5db78bd |
openjdk.pem |
100755 |
blob |
8 |
e9a74187b02a27b165dfa4f93bf6f060376d0ee6 |
steam_appid.txt |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mse/ConfectionerEngine
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mse/ConfectionerEngine
Clone this repository using git:
git clone git://git.rocketgit.com/user/mse/ConfectionerEngine
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main