diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-05-23 08:07:20 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-05-23 08:07:20 -0400 |
commit | f6f6bf484081a3c0c877b35e522a5bfb3a12fdc7 (patch) | |
tree | ee0349f8b0077644f7dcb9009dd8395559f36879 /shaders | |
parent | 3d5820da8b91f676a6b5663ff19ccc68c30905ff (diff) | |
parent | eff05df9465fbe052d028284143a6d3f69876476 (diff) |
Merge branch 'master' of https://github.com/tcsullivan/gamedev
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/world.frag | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/shaders/world.frag b/shaders/world.frag index c103433..d50e01d 100644 --- a/shaders/world.frag +++ b/shaders/world.frag @@ -1,11 +1,25 @@ -uniform sampler2D sampler; +uniform sampler2D texture; +uniform sampler2D normalTex; varying vec2 texCoord; varying vec4 color; -void main(){ - vec4 pixTex = texture2D(sampler, vec2(texCoord.x, 1-texCoord.y)); - if(pixTex.a == 0.0) - discard; - gl_FragColor = pixTex * color; +uniform vec4 ambientLight; +uniform vec4 light[128]; +uniform vec4 lightColor[128]; +uniform float lightImpact; +uniform int lightSize; + +void main() +{ + + vec4 pixTex = texture2D(texture, vec2(texCoord.x, 1-texCoord.y)); + if (pixTex.a < 0.1) + discard; + + if (lightSize > 0) { + + } + + gl_FragColor = pixTex * color * pixTex.a; } |