Office progress
Added vents button and hallway interactable Corrected buttons hitboxes
This commit is contained in:
29
assets/shaders/gameplay/fragment.glsl
Normal file
29
assets/shaders/gameplay/fragment.glsl
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
varying vec2 fragmentTexCoord;
|
||||
|
||||
void main() {
|
||||
float dir;
|
||||
vec2 coords;
|
||||
float offset;
|
||||
float pixelDistanceX;
|
||||
float pixelDistanceY;
|
||||
|
||||
pixelDistanceX = distance(fragmentTexCoord.x, 0.5);
|
||||
pixelDistanceY = distance(fragmentTexCoord.y, 0.5);
|
||||
|
||||
offset = (pixelDistanceX * 0.1) * pixelDistanceY;
|
||||
|
||||
if (fragmentTexCoord.y <= 0.5) {
|
||||
dir = 1.0;
|
||||
} else {
|
||||
dir = -1.0;
|
||||
}
|
||||
|
||||
coords = vec2(fragmentTexCoord.x, fragmentTexCoord.y + pixelDistanceX * (offset * 8.0 * dir));
|
||||
|
||||
gl_FragColor = vec4(texture2D(u_texture, coords).rgb, 1.0);
|
||||
}
|
||||
12
assets/shaders/gameplay/vertex.glsl
Normal file
12
assets/shaders/gameplay/vertex.glsl
Normal file
@@ -0,0 +1,12 @@
|
||||
attribute vec4 a_position;
|
||||
attribute vec4 a_color;
|
||||
attribute vec2 a_texCoord0;
|
||||
|
||||
uniform mat4 u_projTrans;
|
||||
|
||||
varying vec2 fragmentTexCoord;
|
||||
|
||||
void main() {
|
||||
fragmentTexCoord = a_texCoord0;
|
||||
gl_Position = u_projTrans * a_position;
|
||||
}
|
||||
Reference in New Issue
Block a user