diff options
Diffstat (limited to 'src/datavisualization/engine/shaders/texture.frag')
-rw-r--r-- | src/datavisualization/engine/shaders/texture.frag | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/datavisualization/engine/shaders/texture.frag b/src/datavisualization/engine/shaders/texture.frag deleted file mode 100644 index a6d7b2eb..00000000 --- a/src/datavisualization/engine/shaders/texture.frag +++ /dev/null @@ -1,35 +0,0 @@ -#version 120 - -uniform highp vec3 lightPosition_wrld; -uniform highp vec3 color_mdl; -uniform highp float lightStrength; -uniform highp float ambientStrength; -uniform sampler2D textureSampler; - -varying highp vec2 UV; -varying highp vec3 position_wrld; -varying highp vec3 normal_cmr; -varying highp vec3 eyeDirection_cmr; -varying highp vec3 lightDirection_cmr; - -void main() { - highp vec3 materialDiffuseColor = texture2D(textureSampler, UV).rgb; - highp vec3 materialAmbientColor = vec3(ambientStrength, ambientStrength, ambientStrength) * materialDiffuseColor; - highp vec3 materialSpecularColor = vec3(1.0, 1.0, 1.0); - - highp float distance = length(lightPosition_wrld - position_wrld); - highp vec3 n = normalize(normal_cmr); - highp vec3 l = normalize(lightDirection_cmr); - highp float cosTheta = clamp(dot(n, l), 0.0, 1.0); - - highp vec3 E = normalize(eyeDirection_cmr); - highp vec3 R = reflect(-l, n); - highp float cosAlpha = clamp(dot(E, R), 0.0, 1.0); - - gl_FragColor.rgb = - materialAmbientColor + - materialDiffuseColor * lightStrength * (cosTheta * cosTheta) / distance + - materialSpecularColor * lightStrength * pow(cosAlpha, 10) / distance; - gl_FragColor.a = texture2D(textureSampler, UV).a; -} - |