declare const fragmentShader = "#version 300 es\n#define SHADER_NAME graph-layer-fragment-shader\n\nprecision highp float;\n\nin vec3 vColor;\nin vec3 position_commonspace;\nin vec3 cameraPosition;\nflat in int cell_index_fs;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  \n  if (picking_uActive) {\n    // Express cell index in 255 system.\n    float r = 0.0;\n    float g = 0.0;\n    float b = 0.0;\n\n    int cell_index = cell_index_fs;\n\n    if (cell_index >= (256 * 256) - 1) {\n       r = floor(float(cell_index) / (256.0 * 256.0));\n       cell_index -= int(r * (256.0 * 256.0));\n    }\n\n    if (cell_index >= 256 - 1) {\n       g = floor(float(cell_index) / 256.0);\n       cell_index -= int(g * 256.0);\n    }\n\n    b = float(cell_index);\n\n    fragColor = vec4(r / 255.0, g / 255.0, b / 255.0,  1.0);\n    return;\n  }\n\n  // KEEP. Disable lighting for now. Better with uniform color pver a cell.\n  // vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n\n  // // Use normal lighting.\n  // vec3 lightColor = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n  // fragColor = vec4(lightColor, 1.0);\n\n  fragColor = vec4(vColor, 1.0);\n}\n";
export default fragmentShader;
