summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/shaders/shadowNoTexColorOnY.frag
diff options
context:
space:
mode:
Diffstat (limited to 'src/datavisualization/engine/shaders/shadowNoTexColorOnY.frag')
-rw-r--r--src/datavisualization/engine/shaders/shadowNoTexColorOnY.frag8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/datavisualization/engine/shaders/shadowNoTexColorOnY.frag b/src/datavisualization/engine/shaders/shadowNoTexColorOnY.frag
index 68ba2368..9882cd92 100644
--- a/src/datavisualization/engine/shaders/shadowNoTexColorOnY.frag
+++ b/src/datavisualization/engine/shaders/shadowNoTexColorOnY.frag
@@ -3,8 +3,10 @@
uniform highp float lightStrength;
uniform highp float ambientStrength;
uniform highp float shadowQuality;
-uniform highp vec3 color_mdl;
uniform highp sampler2DShadow shadowMap;
+uniform sampler2D textureSampler;
+uniform highp float gradMin;
+uniform highp float gradHeight;
varying highp vec4 shadowCoord;
varying highp vec3 position_wrld;
@@ -37,8 +39,8 @@ highp vec2 poissonDisk[16] = vec2[16](vec2(-0.94201624, -0.39906216),
}*/
void main() {
- highp float heightMod = (coords_mdl.y * 0.3) + 0.7; // Add 30% black to the bottom
- highp vec3 materialDiffuseColor = heightMod * color_mdl;
+ highp vec2 gradientUV = vec2(0.0, gradMin + ((coords_mdl.y + 1.0) * gradHeight));
+ highp vec3 materialDiffuseColor = texture2D(textureSampler, gradientUV).xyz;
highp vec3 materialAmbientColor = vec3(ambientStrength, ambientStrength, ambientStrength) * materialDiffuseColor;
highp vec3 materialSpecularColor = vec3(1.0, 1.0, 1.0);