SHVertShader.cpp 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // This file was created by Filewrap 1.1
  2. // Little endian mode
  3. // DO NOT EDIT
  4. #include "../PVRTMemoryFileSystem.h"
  5. // using 32 bit to guarantee alignment.
  6. #ifndef A32BIT
  7. #define A32BIT static const unsigned int
  8. #endif
  9. // ******** Start: SHVertShader.vsh ********
  10. // File data
  11. static const char _SHVertShader_vsh[] =
  12. "attribute highp vec3 inVertex;\r\n"
  13. "attribute mediump vec3 inNormal;\r\n"
  14. "attribute mediump vec2 inTexCoord;\r\n"
  15. "\r\n"
  16. "uniform highp mat4 MVPMatrix;\r\n"
  17. "uniform highp mat3 Model;\r\n"
  18. "\r\n"
  19. "// Precalculated constants used for lighting\r\n"
  20. "uniform highp vec4 cAr;\r\n"
  21. "uniform highp vec4 cAg;\r\n"
  22. "uniform highp vec4 cAb;\r\n"
  23. "\r\n"
  24. "uniform highp\tvec4 cBr;\r\n"
  25. "uniform highp\tvec4 cBg;\r\n"
  26. "uniform highp\tvec4 cBb;\r\n"
  27. "\r\n"
  28. "uniform highp\tvec3 cC;\r\n"
  29. "\r\n"
  30. "// varyings\r\n"
  31. "varying lowp vec4 LightColour;\r\n"
  32. "varying mediump vec2 TexCoord;\r\n"
  33. "\r\n"
  34. "void main()\r\n"
  35. "{\r\n"
  36. "\thighp vec4 r0, r1;\r\n"
  37. "\thighp vec3 r2, r3;\r\n"
  38. "\t\r\n"
  39. "\t// Transform position\r\n"
  40. "\tgl_Position = MVPMatrix * vec4(inVertex, 1.0);\r\n"
  41. "\r\n"
  42. "\t// Transform the Normal and add a homogenous 1\r\n"
  43. "\tr0 = vec4(Model * inNormal, 1.0);\r\n"
  44. "\r\n"
  45. "\t// Compute 1st 4 basis functions - linear + constant\r\n"
  46. "\t// r0 is the normal with a homegenous 1\r\n"
  47. "\t// c* are precomputed constants\r\n"
  48. "\tr2.x = dot(cAr, r0);\r\n"
  49. "\tr2.y = dot(cAg, r0);\r\n"
  50. "\tr2.z = dot(cAb, r0);\r\n"
  51. "\t\r\n"
  52. "\t// Compute polynomials for the next 4 basis functions\r\n"
  53. "\tr1 = r0.yzzx * r0.xyzz; // r1 is { yx, zy, z^2, xz}\r\n"
  54. "\r\n"
  55. "\t// Add contributions and store them in r3\r\n"
  56. "\tr3.x = dot(cBr, r1);\r\n"
  57. "\tr3.y = dot(cBg, r1);\r\n"
  58. "\tr3.z = dot(cBb, r1);\r\n"
  59. "\r\n"
  60. "\t// Compute the final basis function x^2 - y^2\r\n"
  61. "\tr0.z = r0.y * r0.y;\r\n"
  62. "\tr0.w = (r0.x * r0.x) - r0.z;\r\n"
  63. "\t\r\n"
  64. "\t// Combine the first 2 sets : 8 basis functions\r\n"
  65. "\tr1.xyz = r2 + r3;\r\n"
  66. "\r\n"
  67. "\t// Add in the final 9th basis function to create the final RGB Lighting\r\n"
  68. "\tLightColour.xyz = (cC * r0.w) + r1.xyz;\r\n"
  69. "\t\r\n"
  70. "\t// Set light alpha to 1.0\r\n"
  71. "\tLightColour.a = 1.0;\r\n"
  72. "\r\n"
  73. "\t// Pass through texcoords\r\n"
  74. "\tTexCoord = inTexCoord;\r\n"
  75. "}";
  76. // Register SHVertShader.vsh in memory file system at application startup time
  77. static CPVRTMemoryFileSystem RegisterFile_SHVertShader_vsh("SHVertShader.vsh", _SHVertShader_vsh, 1553);
  78. // ******** End: SHVertShader.vsh ********
  79. // This file was created by Filewrap 1.1
  80. // Little endian mode
  81. // DO NOT EDIT
  82. #include "../PVRTMemoryFileSystem.h"
  83. // using 32 bit to guarantee alignment.
  84. #ifndef A32BIT
  85. #define A32BIT static const unsigned int
  86. #endif
  87. // ******** Start: SHVertShader.vsc ********
  88. // File data
  89. A32BIT _SHVertShader_vsc[] = {
  90. 0x10fab438,0xdfaa00f0,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0xf9060000,0x0,0x4000000,0x0,0x19000000,0x204,0x0,0x2010000,0x0,0x0,0x66040000,0x55535020,0x20,0x45a,0x1,0x1,0x0,0x204,0x0,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x122000a,0xffff,0x3000a,0x0,0x0,0x35,0x0,0x0,0x0,0x0,0xfffc,0x0,0x0,0x0,0xffff0003,0xffffffff,0x350001,0x80000a,0x10001,0x0,0x20001,0x1,0x30001,0x2,0x40001,0x3,0x50001,0x4,0x60001,0x5,0x70001,
  91. 0x6,0x80001,0x7,0x90001,0x8,0xa0001,0x9,0xb0001,0xa,0xc0001,0xb,0xd0001,0xc,0xe0001,0xd,0xf0001,0xe,0x100001,0xf,0x110001,0x10,0x120001,0x11,0x130001,0x12,0x140001,0x13,0x150001,0x14,0x160001,0x15,0x180001,0x16,0x190001,0x17,0x1a0001,0x18,0x1c0001,0x19,0x1d0001,0x1a,0x1e0001,0x1b,0x200001,0x1c,0x210001,0x1d,0x220001,0x1e,0x230001,0x1f,0x240001,0x20,0x250001,0x21,0x260001,0x22,0x270001,0x23,0x280001,0x24,0x290001,0x25,0x2a0001,
  92. 0x26,0x2b0001,0x27,0x2c0001,0x28,0x2d0001,0x29,0x2e0001,0x2a,0x2f0001,0x2b,0x300001,0x2c,0x310001,0x2d,0x320001,0x2e,0x330001,0x2f,0x340001,0x30,0x350001,0x31,0x360001,0x32,0x370001,0x33,0x3b0003,0x340000,0x1f000000,0x1fbea7c4,0x3774081,0xffff0000,0xffffffff,0xffff,0x0,0x40000,0x30000,0x2,0x20002,0x80018000,0x80018003,0x0,0x0,0x4,0x10301,0xfa100000,0xe0400f84,0x10a02000,0x2,0x2001a,0x80018001,0x80018001,0x0,0x0,0x4,0x0,0x10001,0x1,0x10001,0x10001,0x10001,0x10001,0x10001,
  93. 0x10001,0x10001,0x10001,0x10001,0x1010101,0xfa100000,0xe0e01f00,0x28811001,0xa1000400,0x28a11001,0xf0600790,0x38ab0606,0xf0604994,0x38820606,0xf0608b98,0x38820606,0x705f1a1b,0xa21001,0xf0610e9e,0x38ab0606,0xf0615021,0x38820606,0xf0a191a4,0x38a20606,0x10014130,0x811004,0xe0c15700,0x3898c606,0xa0214306,0x801424,0xc0e19782,0x389e0606,0xd061dd30,0x811006,0xc1209802,0x389e0602,0x709f1a31,0x821002,0xe0625d83,0x801006,0xf100068e,0x38980606,0xe0021e03,0x801006,0xe0001e80,0x801002,0x60011a00,0x821006,0xe0c04600,0x801001,0xf0004892,0x38820606,0xf0008a96,0x38820606,0x701f1a19,0xa21001,0x2,0x20005,0x80018001,0x80048000,0x0,0x0,0x4,0x10001,
  94. 0x40001,0x101,0x532afa10,0x606f001,0x93ab38ab,0x606f001,0x942c3882,0x602f000,0x1a293882,0x1002703f,0x200a2,0x60000,0x80010002,0x80008001,0x8001,0x0,0x40000,0x10000,0x10001,0x10001,0x101,0xd936fa10,0x606f001,0x59b738ab,0x606f002,0x1a383882,0x606f002,0x1ab93882,0x602f000,0x5a003882,0x10067000,0x200a3,0x20000,0x80010002,0x80018000,0x8001,0x0,0x40000,0x1010000,0x100,0x4500fa10,0x1001e080,0x600a0,0x3c000000,0x803f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
  95. 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x803f,0x6e690f00,0x74726556,0x7865,0x3040400,0x10000,0x100,0x70004,0x5f6c6700,0x69736f50,0x6e6f6974,0x5010000,0x305,0x1000001,0x40000,0x4d00000f,0x614d5056,0x78697274,0x16000000,0x303,0x1000001,0xff100400,0x690000ff,0x726f4e6e,0x6c616d,
  96. 0x4040000,0x1000002,0x10000,0x7000404,0x6f4d0000,0x6c6564,0x3120000,0x1000003,0x10000,0x77070c14,0x41630000,0x72,0x30305,0x100,0x4200001,0xf00,0x674163,0x3050000,0x1000003,0x10000,0xf000424,0x41630000,0x62,0x30305,0x100,0x4280001,0xf00,0x724263,0x3050000,0x1000003,0x10000,0xf00042c,0x42630000,0x67,0x30305,0x100,0x4300001,0xf00,0x624263,0x3050000,0x1000003,0x10000,0xf000434,0x43630000,0x4000000,0x303,0x1000001,0x30100,0x4c000007,0x74686769,0x6f6c6f43,0x7275,0x1050500,0x10000,0x100,0xf0004,0x78655400,0x726f6f43,0x64,0x20503,0x100,0x2040001,0x300,0x65546e69,
  97. 0x6f6f4378,0x6472,0x2040300,0x10000,0x8000100,0x30004,0x0,
  98. };
  99. // Register SHVertShader.vsc in memory file system at application startup time
  100. static CPVRTMemoryFileSystem RegisterFile_SHVertShader_vsc("SHVertShader.vsc", _SHVertShader_vsc, 1817);
  101. // ******** End: SHVertShader.vsc ********