Force projector implementation

This commit is contained in:
Anuken
2018-09-07 23:24:55 -04:00
parent d046591512
commit 7dd487ccc5
20 changed files with 968 additions and 797 deletions

View File

@ -30,19 +30,19 @@ void main() {
vec2 T = v_texCoord.xy;
vec2 coords = (T * u_texsize) + u_offset;
T += vec2(sin(coords.y / 3.0 + u_time / 20.0) / 240.0, sin(coords.x / 3.0 + u_time / 20.0) / 240.0) * u_scaling;
float si = 1.0 + sin(u_time / 20.0) / 8.0;
float si = sin(u_time / 20.0) / 8.0;
vec4 color = texture2D(u_texture, T) * vec4(si, si, si, 1.0);
vec4 color = texture2D(u_texture, T);
vec2 v = vec2(1.0/u_texsize.x, 1.0/u_texsize.y);
bool any = false;
float thickness = 1.0;
float step = 1.5;
float step = 2.0;
if(texture2D(u_texture, T).a < 0.1 &&
(texture2D(u_texture, T + vec2(0, step) * v).a > 0.1 || texture2D(u_texture, T + vec2(0, -step) * v).a > 0.1 ||
@ -50,7 +50,7 @@ void main() {
any = true;
if(any){
gl_FragColor = u_color * vec4(si, si, si, 1.0);
gl_FragColor = mix(u_color, vec4(1.0), si);
}else{
if(color.a > 0.1){
@ -67,7 +67,7 @@ void main() {
float fin = 1.0 - hit.z;
if(abs(distance(vec2(hit.x, hit.y), coords - u_texsize/2.0) - rad) < 1.0){
color = mix(color, u_color* vec4(si, si, si, 1.0), (1.0 * fin));
color = mix(color, mix(u_color, vec4(1.0), si), (1.0 * fin));
color.a = ALPHA + 0.82 *fin;
}
}