DotMaterial.js 729 B

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