From be9d14233e9fc7b7c5e4fc3711125132e3cee151 Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Tue, 24 Sep 2019 02:29:41 -0400 Subject: Increased texture size for world, made world a little more detailed, and added bouncing ball --- Shaders/world.frag | 2 ++ Shaders/world.vert | 3 +++ 2 files changed, 5 insertions(+) (limited to 'Shaders') diff --git a/Shaders/world.frag b/Shaders/world.frag index 18945a8..79d87aa 100644 --- a/Shaders/world.frag +++ b/Shaders/world.frag @@ -9,6 +9,7 @@ precision mediump float; uniform sampler2D textu; uniform sampler2D normu; +in float fragTrans; in vec2 texCoord; in vec4 fragCoord; out vec4 FragColor; @@ -25,6 +26,7 @@ void main() vec3 Falloff = vec3(0.4, 0.1, 0.002); vec4 DiffuseColor = texture2D(textu, texCoord); + DiffuseColor *= fragTrans; if (DiffuseColor.a < 0.1f) discard; diff --git a/Shaders/world.vert b/Shaders/world.vert index aa183a2..28fd307 100644 --- a/Shaders/world.vert +++ b/Shaders/world.vert @@ -3,16 +3,19 @@ //layout(location = 0)in vec3 vertex; in vec3 vertex; in vec2 texc; +in float trans; uniform mat4 projection; uniform mat4 view; uniform mat4 model; +out float fragTrans; out vec2 texCoord; out vec4 fragCoord; void main() { + fragTrans = trans; texCoord = texc; fragCoord = vec4(vertex, 1.0f); gl_Position = projection * view * model * fragCoord; -- cgit v1.2.3