智慧水务管理系统 - 精河县供水工程综合管理平台

SkyAtmosphereFS.js 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "in vec3 v_outerPositionWC;\n\
  3. \n\
  4. uniform vec3 u_hsbShift;\n\
  5. \n\
  6. #ifndef PER_FRAGMENT_ATMOSPHERE\n\
  7. in vec3 v_mieColor;\n\
  8. in vec3 v_rayleighColor;\n\
  9. in float v_opacity;\n\
  10. in float v_translucent;\n\
  11. #endif\n\
  12. \n\
  13. void main (void)\n\
  14. {\n\
  15. float lightEnum = u_radiiAndDynamicAtmosphereColor.z;\n\
  16. vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);\n\
  17. \n\
  18. vec3 mieColor;\n\
  19. vec3 rayleighColor;\n\
  20. float opacity;\n\
  21. float translucent;\n\
  22. \n\
  23. #ifdef PER_FRAGMENT_ATMOSPHERE\n\
  24. computeAtmosphereScattering(\n\
  25. v_outerPositionWC,\n\
  26. lightDirection,\n\
  27. rayleighColor,\n\
  28. mieColor,\n\
  29. opacity,\n\
  30. translucent\n\
  31. );\n\
  32. #else\n\
  33. mieColor = v_mieColor;\n\
  34. rayleighColor = v_rayleighColor;\n\
  35. opacity = v_opacity;\n\
  36. translucent = v_translucent;\n\
  37. #endif\n\
  38. \n\
  39. vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);\n\
  40. \n\
  41. #ifndef HDR\n\
  42. color.rgb = czm_pbrNeutralTonemapping(color.rgb);\n\
  43. color.rgb = czm_inverseGamma(color.rgb);\n\
  44. #endif\n\
  45. \n\
  46. #ifdef COLOR_CORRECT\n\
  47. const bool ignoreBlackPixels = true;\n\
  48. color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);\n\
  49. #endif\n\
  50. \n\
  51. // For the parts of the sky atmosphere that are not behind a translucent globe,\n\
  52. // we mix in the default opacity so that the sky atmosphere still appears at distance.\n\
  53. // This is needed because the opacity in the sky atmosphere is initially adjusted based\n\
  54. // on the camera height.\n\
  55. if (translucent == 0.0) {\n\
  56. color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);\n\
  57. }\n\
  58. \n\
  59. out_FragColor = color;\n\
  60. }\n\
  61. ";