cc-global.chunk 2.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
  2. // have to specify precisions explicitly
  3. // if shared among stages with different precisions
  4. #pragma builtin(global)
  5. layout(set = 0, binding = 0) uniform CCGlobal {
  6. highp vec4 cc_time; // x: global time since started in seconds, y: delta time for current frame, z: total frames since started, w: fractinal part of x, better precious, should be used with uv animation
  7. mediump vec4 cc_screenSize; // xy: screen size, zw: inverse screen size
  8. mediump vec4 cc_nativeSize; // xy: shading size, zw: inverse shading size
  9. mediump vec4 cc_probeInfo; // x: reflection probe count
  10. mediump vec4 cc_debug_view_mode; // x: single mode, yzw: composite and misc flags combination value
  11. };
  12. #pragma builtin(global)
  13. layout(set = 0, binding = 1) uniform CCCamera {
  14. highp mat4 cc_matView; // view matrix
  15. highp mat4 cc_matViewInv; // inverse view matrix
  16. highp mat4 cc_matProj; // projection matrix
  17. highp mat4 cc_matProjInv; // inverse projection matrix
  18. highp mat4 cc_matViewProj; // view-projection matrix
  19. highp mat4 cc_matViewProjInv; // inverse view-projection matrix
  20. highp vec4 cc_cameraPos; // xyz: camera position w: flip NDC sign
  21. mediump vec4 cc_surfaceTransform; // x: surface transform y: camera usage zw: skybox rotation angle cos/sin value
  22. mediump vec4 cc_screenScale; // xy: screen scale, zw: inverse screen scale
  23. mediump vec4 cc_exposure; // x: exposure, y: inverse exposure, z: HDR flag, w: inverse standard exposure value
  24. mediump vec4 cc_mainLitDir; // xyz: main direcitonal light direction, w: enable shadow
  25. mediump vec4 cc_mainLitColor; // xyz: main direcitonal light color, w: intensity
  26. mediump vec4 cc_ambientSky; //xyz: sky illumination color, w: intensity
  27. mediump vec4 cc_ambientGround; // xyz: ground albedo color, w: envmap LOD
  28. mediump vec4 cc_fogColor; // xyz: global fog color
  29. mediump vec4 cc_fogBase; // xyz: fogStart, fogEnd, fogDensity
  30. mediump vec4 cc_fogAdd; // xyz: fogTop, fogRange, fogAtten
  31. mediump vec4 cc_nearFar; // xy: frustum near, frustum far z: clipspace minz (vulkan: 0 metal: 0 other: -1)
  32. mediump vec4 cc_viewPort; // xyzw: camera view port, default(0, 0, 1, 1)
  33. };