decode-base.chunk 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
  2. #pragma define-meta USE_INSTANCING editor(elevated: true)
  3. #include <common/common-define>
  4. struct StandardVertInput {
  5. highp vec4 position;
  6. vec3 normal;
  7. vec4 tangent;
  8. };
  9. layout(location = 0) in vec3 a_position;
  10. layout(location = 1) in vec3 a_normal;
  11. layout(location = 2) in vec2 a_texCoord;
  12. layout(location = 3) in vec4 a_tangent;
  13. #if CC_USE_SKINNING
  14. #if __VERSION__ > 310
  15. // strictly speaking this should be u16vec4, but due to poor driver support
  16. // somehow it seems we can get better results on many platforms using u32vec4
  17. layout(location = 4) in u32vec4 a_joints;
  18. #else
  19. #pragma format(RGBA16UI)
  20. layout(location = 4) in vec4 a_joints;
  21. #endif
  22. layout(location = 5) in vec4 a_weights;
  23. #endif
  24. #if USE_INSTANCING
  25. #if CC_USE_BAKED_ANIMATION
  26. in highp vec4 a_jointAnimInfo; // frameID, totalJoints, offset
  27. #endif
  28. in vec4 a_matWorld0;
  29. in vec4 a_matWorld1;
  30. in vec4 a_matWorld2;
  31. #if CC_USE_LIGHTMAP
  32. in vec4 a_lightingMapUVParam;
  33. #endif
  34. // TODO (jk20012001)
  35. #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW
  36. // temporary hack for effect-parser: can't detect logic OR.
  37. #if CC_RECEIVE_SHADOW
  38. #endif
  39. in vec4 a_localShadowBiasAndProbeId; // x:shadow bias, y:shadow normal bias, z: reflection probe id, w: reserved for blend reflection probe id
  40. #endif
  41. #if CC_USE_REFLECTION_PROBE
  42. in vec4 a_reflectionProbeData; // x:reflection probe blend weight
  43. #endif
  44. #if CC_USE_LIGHT_PROBE
  45. in vec4 a_sh_linear_const_r;
  46. in vec4 a_sh_linear_const_g;
  47. in vec4 a_sh_linear_const_b;
  48. #endif
  49. #endif
  50. #if CC_USE_MORPH
  51. #if __VERSION__ < 450
  52. in float a_vertexId;
  53. int getVertexId() {
  54. return int(a_vertexId);
  55. }
  56. #else
  57. int getVertexId() {
  58. return gl_VertexIndex; // vulkan convension
  59. }
  60. #endif
  61. #endif