textureCube.glsl 428 B

1234567891011121314151617
  1. /**
  2. * A wrapper around the texture (WebGL2) / textureCube (WebGL1)
  3. * function to allow for WebGL 1 support.
  4. *
  5. * @name czm_textureCube
  6. * @glslFunction
  7. *
  8. * @param {samplerCube} sampler The sampler.
  9. * @param {vec3} p The coordinates to sample the texture at.
  10. */
  11. vec4 czm_textureCube(samplerCube sampler, vec3 p) {
  12. #if __VERSION__ == 300
  13. return texture(sampler, p);
  14. #else
  15. return textureCube(sampler, p);
  16. #endif
  17. }