diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2018-10-19 23:22:07 +0300 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2018-10-19 23:30:23 +0300 |
commit | 7c1edef3ac501d40e3de495b9434df71f535e9bc (patch) | |
tree | fd7f4264bdf5c30f7182a147ed9e6c7935c69bf2 /frag.glsl | |
parent | 91b543a29cb8852251908a49cd120a6f7d9f2f11 (diff) | |
download | faqe-7c1edef3ac501d40e3de495b9434df71f535e9bc.tar.gz faqe-7c1edef3ac501d40e3de495b9434df71f535e9bc.tar.xz faqe-7c1edef3ac501d40e3de495b9434df71f535e9bc.zip |
Allow multiple shaders while reducing duplication
This change also stops using bie as eventually it will be replaced with
a more sophisticated asset handling system which will also allow custom
shaders.
Diffstat (limited to 'frag.glsl')
-rw-r--r-- | frag.glsl | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/frag.glsl b/frag.glsl deleted file mode 100644 index 2f0a367..0000000 --- a/frag.glsl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> - * SPDX-License-Identifier: MIT - */ -#version 330 core -out vec4 color; -in vec3 fnorm; -in vec3 fpos; -in vec2 fuv; -in vec3 lipos; - -uniform sampler2D tex; - -void main() -{ - vec3 objco = vec3(texture(tex, fuv)); - vec3 lico = vec3(1.0, 1.0, 1.0); - - float amb = 0.1; - - vec3 norm = normalize(fnorm); - vec3 lidir = normalize(lipos - fpos); - float dif = max(dot(norm, lidir), 0.0); - - float speen = max(sign(dot(lidir, norm)), 0.0); - vec3 vwdir = normalize(-fpos); - vec3 mid = normalize(lidir + vwdir); - - float spe = pow(max(dot(norm, mid), 0.0), 256) * speen; - - color = vec4((amb + dif + spe) * lico * objco, 1.0); -} |