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

ConvolveSpecularMapVS.js 848B

1234567891011121314151617181920212223242526
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "in vec3 position;\n\
  3. out vec3 v_textureCoordinates;\n\
  4. \n\
  5. uniform vec3 u_faceDirection;\n\
  6. \n\
  7. vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {\n\
  8. vec2 scaledUV = uv;\n\
  9. \n\
  10. if (faceDir.x != 0.0) {\n\
  11. return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);\n\
  12. } else if (faceDir.y != 0.0) {\n\
  13. return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);\n\
  14. } else {\n\
  15. return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); \n\
  16. }\n\
  17. }\n\
  18. \n\
  19. void main() \n\
  20. {\n\
  21. v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);\n\
  22. v_textureCoordinates.y = -v_textureCoordinates.y;\n\
  23. v_textureCoordinates.z = -v_textureCoordinates.z;\n\
  24. gl_Position = vec4(position, 1.0);\n\
  25. }\n\
  26. ";