precision mediump float; uniform sampler2D uTexture; uniform sampler2D refractTexture; varying vec2 vTexCoordinate; varying vec2 vRefTexCoordinate; void main() { vec2 scaleVec = vec2(0.05, 0.05); vec4 bumpTex = 2.0 * texture2D(refractTexture, vRefTexCoordinate) - 1.0; vec2 refCoords = vTexCoordinate.xy + bumpTex.xy * scaleVec; gl_FragColor = texture2D(uTexture, refCoords); }
vec4 bumpTex = 2.0 * texture2D(refractTexture, vRefTexCoordinate) - 1.0;
vec4 bumpTex = 2.0 * texture2D(refractTexture, vRefTexCoordinate) - 1.0; vec2 refCoords = vTexCoordinate.xy + bumpTex.xy * scaleVec;