UNPKG

@cesium/engine

Version:

CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.

21 lines (20 loc) 823 B
//This file is automatically rebuilt by the Cesium build process. export default "//\n\ // Fragment shader for Gaussian splats.\n\ // Renders a Gaussian splat within a quad, discarding fragments outside the unit circle.\n\ // Applies an approximate Gaussian falloff based on distance from the center and outputs\n\ // a color modulated by the alpha and Gaussian weight.\n\ //\n\ void main() {\n\ if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;\n\ if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;\n\ \n\ mediump float A = dot(v_vertPos, v_vertPos);\n\ if(A > 1.0) {\n\ discard;\n\ }\n\ mediump float scale = 4.0;\n\ mediump float B = exp(-A * scale) * (v_splatColor.a);\n\ out_FragColor = vec4(v_splatColor.rgb * B, B);\n\ }\n\ ";