VertShader.cpp 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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: VertShader.vsh ********
  10. // File data
  11. static const char _VertShader_vsh[] =
  12. "/******************************************************************************\r\n"
  13. "* Vertex Shader\r\n"
  14. "******************************************************************************/\r\n"
  15. "/* \r\n"
  16. "\tThe vertex and fragment shaders implement two techniques for reflections.\r\n"
  17. "\tWhich version is used for drawing the object is dependent on the value of \r\n"
  18. "\tbHighDetail. If bHighDetail is true it uses the method described in \r\n"
  19. "\tOGLES2PerturbedUVs and for false it uses OGLES2Reflections. \r\n"
  20. "\t\r\n"
  21. "\tReason for using 2 methods is that when the object is far away you aren't\r\n"
  22. "\tgoing to notice all the detail that the PerturbedUVs method adds to\r\n"
  23. "\tthe mesh so you may as well use a simpler method for creating reflections.\r\n"
  24. "\tThis way you aren't using valuable resources on something you aren't \r\n"
  25. "\tgoing to notice.\r\n"
  26. "\r\n"
  27. "\tAlso, when the training course is in 'low detail' mode it uses a different mesh.\r\n"
  28. "\tThe mesh that is being drawn contains only 7% of the original meshes vertices.\r\n"
  29. "*/\r\n"
  30. "\r\n"
  31. "attribute highp vec3 inVertex;\r\n"
  32. "attribute mediump vec3 inNormal;\r\n"
  33. "attribute mediump vec2 inTexCoord;\r\n"
  34. "attribute mediump vec3 inTangent;\r\n"
  35. "\r\n"
  36. "uniform highp mat4 MVPMatrix;\r\n"
  37. "uniform mediump mat3 ModelWorld;\r\n"
  38. "uniform mediump vec3 EyePosModel;\r\n"
  39. "uniform bool bHighDetail;\r\n"
  40. "\r\n"
  41. "varying mediump vec3 EyeDirection;\r\n"
  42. "varying mediump vec2 TexCoord;\r\n"
  43. "\r\n"
  44. "void main()\r\n"
  45. "{\r\n"
  46. "\t// Transform position\r\n"
  47. "\tgl_Position = MVPMatrix * vec4(inVertex,1.0);\r\n"
  48. "\r\n"
  49. "\t// Calculate direction from eye position in model space\r\n"
  50. "\tmediump vec3 eyeDirModel = normalize(EyePosModel - inVertex);\r\n"
  51. "\r\n"
  52. "\tif (bHighDetail)\r\n"
  53. "\t{\t\r\n"
  54. "\t\t// transform light direction from model space to tangent space\r\n"
  55. "\t\tmediump vec3 binormal = cross(inNormal, inTangent);\r\n"
  56. "\t\tmediump mat3 tangentSpaceXform = mat3(inTangent, binormal, inNormal);\r\n"
  57. "\t\tEyeDirection = eyeDirModel * tangentSpaceXform;\t\r\n"
  58. "\r\n"
  59. "\t\tTexCoord = inTexCoord;\r\n"
  60. "\t}\r\n"
  61. "\telse\r\n"
  62. "\t{\r\n"
  63. "\t\t// reflect eye direction over normal and transform to world space\r\n"
  64. "\t\tmediump vec3 reflectDir = ModelWorld * reflect(eyeDirModel, inNormal);\r\n"
  65. "\t\tTexCoord = normalize(reflectDir).xy * 0.5 + 0.5;\r\n"
  66. "\t}\r\n"
  67. "}\r\n";
  68. // Register VertShader.vsh in memory file system at application startup time
  69. static CPVRTMemoryFileSystem RegisterFile_VertShader_vsh("VertShader.vsh", _VertShader_vsh, 2049);
  70. // ******** End: VertShader.vsh ********
  71. // This file was created by Filewrap 1.1
  72. // Little endian mode
  73. // DO NOT EDIT
  74. #include "../PVRTMemoryFileSystem.h"
  75. // using 32 bit to guarantee alignment.
  76. #ifndef A32BIT
  77. #define A32BIT static const unsigned int
  78. #endif
  79. // ******** Start: VertShader.vsc ********
  80. // File data
  81. A32BIT _VertShader_vsc[] = {
  82. 0x10fab438,0xe4c3828c,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0xd2060000,0x0,0x4000000,0x0,0x19000000,0x203,0x0,0x2020000,0x0,0x0,0xca040000,0x55535020,0x20,0x4be,0x1,0x1,0x0,0x204,0x80,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x122000a,0xffff,0x7000e,0x0,0x0,0x23,0x0,0x0,0x0,0x0,0xfffc,0x0,0x0,0x0,0xffff0003,0xffffffff,0x1a0000,0x80000e,0x140002,0x0,0x150002,0x100000,0x160002,0x1,0x170002,0x100001,0x1a0002,0x2,0x1b0002,0x100002,0x1e0002,
  83. 0x3,0x1f0002,0x100003,0x220002,0x4,0x230002,0x100004,0x180002,0x5,0x190002,0x100005,0x1c0002,0x6,0x1d0002,0x100006,0x200002,0x7,0x210002,0x100007,0x240002,0x8,0x250002,0x100008,0x40001,0x9,0x50001,0xa,0x80001,0xb,0x90001,0xc,0xc0001,0xd,0xd0001,0xe,0x60001,0xf,0x70001,0x10,0xa0001,0x11,0xb0001,0x12,0xe0001,0x13,0xf0001,0x14,0x10001,0x15,0x100001,0x16,0x110001,0x17,0x120001,0x18,0x130001,0x19,0x3777,0xffffffff,0xffffffff,0x0,0x0,0x4,0x20003,
  84. 0x10000,0x80010003,0x80018001,0x8001,0x0,0x40000,0x101,0xfd100000,0x2,0x30002,0x8001400e,0x80018000,0x0,0x0,0x4,0xe010001,0xfa100008,0x70001a54,0xe22084,0x2,0x30005,0x40148001,0x80008001,0x0,0x0,0x4,0x0,0x1000000,0x40114,0x8183fa10,0x14020060,0x30080,0x10022060,0x1800080,0x12008020,0xb00880,0x20001080,0x200a1,0xa0000,0x80010003,0x80008001,0x8001,0x0,0x40000,0x0,0x10001,0x1,0x10001,0x10001,0x101,0xfb0fa10,0x1281d000,0x9944889,0x606f060,0x4a9638ab,0x606f060,0x8b983882,0x606f060,0x1a203882,0x1001701f,0xc9a00a2,0x606f000,0x4d9c38ab,0x606f000,
  85. 0x8e9e3882,0x606f000,0x1a223882,0x1001705f,0x300a2,0x0,0x400000,0x4f900,0x2,0x30002,0x80018000,0x40098001,0x0,0x0,0x4,0x10109,0xfa100001,0x80000204,0x10a02002,0x2,0x30003,0x80008001,0x40098001,0x0,0x0,0x4,0x1090000,0x10100,0x2baffa10,0x1006d000,0x20400c1,0x20868020,0x200a0,0x20000,0x80000003,0x80028001,0x8001,0x0,0x40000,0x2010000,0x1,0x2c01fa10,0x2002e080,0x210e0,0x90000,0x80010003,0x80008001,0x8000,0x0,0x40000,0x10000,0x10001,0x10001,0x10001,0x1010000,0xfa100000,0xf0006f5f,0x38ab0606,0xf000b061,0x38820606,0xf000f163,0x38820606,0xf01f0081,0x831402,
  86. 0xa0010200,0x801006,0x80000000,0x8801202,0xa0000000,0x3888c606,0xf0ef3264,0xe01001,0x3,0x0,0xf8000040,0x40005,0x40000,0x2,0x30007,0x80018001,0x80018000,0x0,0x0,0x0,0x10000,0x10001,0x6000001,0x1001a0e0,0x6802881,0x1001a100,0x5052881,0x6068001,0x840038ab,0x100eb021,0x82810081,0x1003b001,0x82090089,0x20520c1,0x450138aa,0x100eb001,0x20081,0x20000,0x80000003,0x80018001,0x8001,0x0,0x40000,0x1010000,0x1,0x280fa10,0x10022040,0x210a0,0x50000,0x80010003,0x80f78000,0x8002,0x0,0x40000,0x10000,0x1,0x100f702,0xfa100000,0x80020285,0x38ab0606,0xb0210480,0x81100e,0xb0018481,0x811002,
  87. 0xa0810500,0xa01001,0x4,0x60005,0x28000000,0x803f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0x0,0x0,0x0,0x6e690b00,0x74726556,0x7865,0x3040400,0x10000,0x100,0x70004,0x5f6c6700,0x69736f50,0x6e6f6974,0x5010000,0x305,0x1000001,0x40000,0x4d00000f,0x614d5056,0x78697274,0x16000000,0x303,
  88. 0x1000001,0xff100400,0x450000ff,0x6f506579,0x646f4d73,0x6c65,0x2030400,0x10000,0x14000100,0x70003,0x69486200,0x65446867,0x6c696174,0xa000000,0x3,0x1000001,0x10100,0x69000001,0x726f4e6e,0x6c616d,0x4040000,0x1000002,0x10000,0x7000404,0x6e690000,0x676e6154,0x746e65,0x4040000,0x1000002,0x10000,0x7000408,0x79450000,0x72694465,0x69746365,0x6e6f,0x2050400,0x10000,0x100,0x70003,0x78655400,0x726f6f43,0x64,0x20503,0x100,0x2040001,0x300,0x65546e69,0x6f6f4378,0x6472,0x2040300,0x10000,0xc000100,0x30004,0x646f4d00,0x6f576c65,0x646c72,0x3120000,0x1000002,0x10000,0x77070c18,0x0,
  89. };
  90. // Register VertShader.vsc in memory file system at application startup time
  91. static CPVRTMemoryFileSystem RegisterFile_VertShader_vsc("VertShader.vsc", _VertShader_vsc, 1778);
  92. // ******** End: VertShader.vsc ********