1#ifdef GL_ES 2precision mediump float; 3precision mediump sampler2DArray; 4#endif 5 6uniform sampler2DArray u_textureArray; 7 8in vec3 v_texCoords; 9 10out vec4 color; 11 12void main() { 13 vec4 currentLayer = texture(u_textureArray, v_texCoords); 14 vec4 nextLayer = texture(u_textureArray, v_texCoords + vec3(0.0, 0.0, 1.0)); 15 16 float interp = fract(v_texCoords.z - 0.5); 17 color.rgb = mix(currentLayer.rgb, nextLayer.rgb, interp); 18} 19