summaryrefslogtreecommitdiffstats
path: root/src/datavis3d/engine/shaders
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-03-15 07:46:36 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-03-15 07:46:36 +0200
commit43bfc75bc7d4f403683dc0a67785e08dfa11fd5d (patch)
tree14f743f01e86c8b00740128a93294d48a7c046fb /src/datavis3d/engine/shaders
parent2689cc833c8479763e56e4abf725c159d0a832a1 (diff)
Implemented bar selection and highlighting
Implemented highlighting on selected bar's row and column Note: There's still a problem with lights and colors from center row backwards (not due to selection)
Diffstat (limited to 'src/datavis3d/engine/shaders')
-rw-r--r--src/datavis3d/engine/shaders/fragmentShaderColorOnY6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/datavis3d/engine/shaders/fragmentShaderColorOnY b/src/datavis3d/engine/shaders/fragmentShaderColorOnY
index 43ede08e..464cfe8c 100644
--- a/src/datavis3d/engine/shaders/fragmentShaderColorOnY
+++ b/src/datavis3d/engine/shaders/fragmentShaderColorOnY
@@ -1,4 +1,3 @@
-varying highp vec2 UV;
varying highp vec3 position_wrld;
varying highp vec3 normal_cmr;
varying highp vec3 eyeDirection_cmr;
@@ -9,7 +8,7 @@ uniform highp vec3 color_mdl;
uniform highp float lightStrength;
void main() {
highp vec3 materialDiffuseColor = vec3(coords_mdl.y * color_mdl.x, coords_mdl.y * color_mdl.y, coords_mdl.y * color_mdl.z);
- highp vec3 materialAmbientColor = vec3(0.2, 0.2, 0.2) * materialDiffuseColor;
+ highp vec3 materialAmbientColor = vec3(0.1, 0.1, 0.1) * color_mdl;//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);
@@ -25,7 +24,6 @@ void main() {
gl_FragColor.rgb = //color_mdl + color_mdl * vec3(cosTheta * cosTheta) / (distance * distance) + vec3(cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha) / (distance * distance);
materialAmbientColor +
materialDiffuseColor * lightStrength * (cosTheta * cosTheta) / distance +
- materialSpecularColor * lightStrength * (cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha) / distance;//(distance * distance);
- gl_FragColor.a = 1.0;
+ materialSpecularColor * lightStrength * (cosAlpha * cosAlpha * cosAlpha * cosAlpha * cosAlpha) / distance;
}