DotMaterial.js 694 B

1234567891011121314151617181920
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "uniform vec4 lightColor;\n\
  3. uniform vec4 darkColor;\n\
  4. uniform vec2 repeat;\n\
  5. \n\
  6. czm_material czm_getMaterial(czm_materialInput materialInput)\n\
  7. {\n\
  8. czm_material material = czm_getDefaultMaterial(materialInput);\n\
  9. \n\
  10. // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\n\
  11. float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0\n\
  12. \n\
  13. vec4 color = mix(lightColor, darkColor, b);\n\
  14. color = czm_gammaCorrect(color);\n\
  15. material.diffuse = color.rgb;\n\
  16. material.alpha = color.a;\n\
  17. \n\
  18. return material;\n\
  19. }\n\
  20. ";