attribute vec3 position;
attribute vec2 texcoord;
uniform mat4 modelViewProjectionMatrix;
uniform mat4 normalMatrix;
uniform sampler2D heatMap;
varying vec2 fragTexCoord;
varying vec3 fragNormal;
void main()
{
fragTexCoord = texcoord;
vec3 pos = position;
vec3 heatColor = texture2D(heatMap, vec2(1.0 - fragTexCoord.x, fragTexCoord.y)).rgb;
float displacement = (heatColor.r + heatColor.g + heatColor.b) / 3.0;
pos.z += displacement * 0.05;
gl_Position = modelViewProjectionMatrix * vec4(pos, 1.0);
}
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D diffuseMap;
varying vec2 fragTexCoord;
varying float displacement;
void main()
{
vec3 diffuse = texture2D(diffuseMap, vec2(1.0 - fragTexCoord.x, fragTexCoord.y)).rgb;
gl_FragColor = vec4(diffuse, 1.0);
}