kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
3 lines (2 loc) • 1.11 kB
TypeScript
declare const _default: "#define SHADER_NAME raster-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\n\nuniform bool flatShading;\nuniform float opacity;\n\nvarying vec2 vTexCoord;\nvarying vec3 cameraPosition;\nvarying vec3 normals_commonspace;\nvarying vec4 position_commonspace;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n vec4 image;\n DECKGL_CREATE_COLOR(image, vTexCoord);\n\n DECKGL_MUTATE_COLOR(image, vTexCoord);\n\n vec3 normal;\n if (flatShading) {\n\n// This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec3 lightColor = lighting_getLightColor(image.rgb, cameraPosition, position_commonspace.xyz, normal);\n gl_FragColor = vec4(lightColor, opacity);\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n";
export default _default;