Sha256: c114dc62cca13ad0f953b2046948a28e2a0a578ee362c397898c37f55daf7d8a
Contents?: true
Size: 1.72 KB
Versions: 4
Compression:
Stored size: 1.72 KB
Contents
//This file is automatically rebuilt by the Cesium build process. /*global define*/ define(function() { "use strict"; return "#ifdef GL_OES_standard_derivatives\n\ #extension GL_OES_standard_derivatives : enable\n\ #endif\n\ uniform vec4 color;\n\ uniform float cellAlpha;\n\ uniform vec2 lineCount;\n\ uniform vec2 lineThickness;\n\ czm_material czm_getMaterial(czm_materialInput materialInput)\n\ {\n\ czm_material material = czm_getDefaultMaterial(materialInput);\n\ vec2 st = materialInput.st;\n\ float scaledWidth = fract(lineCount.s * st.s);\n\ scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n\ float scaledHeight = fract(lineCount.t * st.t);\n\ scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n\ float value;\n\ #ifdef GL_OES_standard_derivatives\n\ const float fuzz = 1.2;\n\ vec2 thickness = lineThickness - 1.0;\n\ vec2 dx = abs(dFdx(st));\n\ vec2 dy = abs(dFdy(st));\n\ vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\n\ value = min(\n\ smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\n\ smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n\ #else\n\ const float fuzz = 0.05;\n\ vec2 range = 0.5 - (lineThickness * 0.05);\n\ value = min(\n\ 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n\ 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n\ #endif\n\ float dRim = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\n\ float sRim = smoothstep(0.8, 1.0, dRim);\n\ value *= (1.0 - sRim);\n\ vec3 halfColor = color.rgb * 0.5;\n\ material.diffuse = halfColor;\n\ material.emission = halfColor;\n\ material.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\n\ return material;\n\ }\n\ "; });
Version data entries
4 entries across 4 versions & 1 rubygems