ModelVShader.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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: ModelVShader.vsh ********
  10. // File data
  11. static const char _ModelVShader_vsh[] =
  12. "#define ENABLE_TEXTURE\r\n"
  13. "attribute highp vec3 \tinVertex;\r\n"
  14. "attribute highp vec3\tinNormal;\r\n"
  15. "attribute highp vec2\tinTexCoord;\r\n"
  16. "\r\n"
  17. "uniform highp mat4\t\tMVPMatrix;\r\n"
  18. "uniform mediump vec3\tLightDirection;\r\n"
  19. "#ifdef ENABLE_FOG_DEPTH\r\n"
  20. "uniform highp mat4\t\tModelMatrix;\r\n"
  21. "uniform mediump float\tWaterHeight;\t\t//Assume water always lies on the y-axis\r\n"
  22. "#endif\r\n"
  23. "\r\n"
  24. "#ifdef ENABLE_LIGHTING\r\n"
  25. "\tvarying lowp float\t\tLightIntensity;\t\r\n"
  26. "#endif\r\n"
  27. "#ifdef ENABLE_TEXTURE\r\n"
  28. "\tvarying mediump vec2 \tTexCoord;\r\n"
  29. "#endif\r\n"
  30. "#ifdef ENABLE_FOG_DEPTH\r\n"
  31. "\tvarying mediump float\tVertexDepth;\r\n"
  32. "#endif\r\n"
  33. "\r\n"
  34. "void main()\r\n"
  35. "{\r\n"
  36. "\t// Convert each vertex into projection-space and output the value\r\n"
  37. "\thighp vec4 vInVertex = vec4(inVertex, 1.0);\r\n"
  38. "\tgl_Position = MVPMatrix * vInVertex;\r\n"
  39. "\t\r\n"
  40. "\t#ifdef ENABLE_TEXTURE\r\n"
  41. "\t\tTexCoord = inTexCoord;\r\n"
  42. "\t#endif\r\n"
  43. "\t\r\n"
  44. "\t#ifdef ENABLE_FOG_DEPTH\r\n"
  45. "\t\t// Calculate the vertex's distance under water surface. This assumes clipping has removed all objects above the water\r\n"
  46. "\t\tmediump float vVertexHeight = (ModelMatrix * vec4(inVertex,1.0)).y;\r\n"
  47. "\t\tVertexDepth = WaterHeight - vVertexHeight;\r\n"
  48. "\t#endif\r\n"
  49. "\t\r\n"
  50. "\t#ifdef ENABLE_LIGHTING\r\n"
  51. "\t\t// Simple diffuse lighting in model space\r\n"
  52. "\t\tLightIntensity = 0.3 + clamp(dot(inNormal, -LightDirection),0.0,1.0);\t// 0.5 is ambient light\r\n"
  53. "\t#endif\r\n"
  54. "}\r\n";
  55. // Register ModelVShader.vsh in memory file system at application startup time
  56. static CPVRTMemoryFileSystem RegisterFile_ModelVShader_vsh("ModelVShader.vsh", _ModelVShader_vsh, 1239);
  57. // ******** End: ModelVShader.vsh ********
  58. // This file was created by Filewrap 1.1
  59. // Little endian mode
  60. // DO NOT EDIT
  61. #include "../PVRTMemoryFileSystem.h"
  62. // using 32 bit to guarantee alignment.
  63. #ifndef A32BIT
  64. #define A32BIT static const unsigned int
  65. #endif
  66. // ******** Start: ModelVShader.vsc ********
  67. // File data
  68. A32BIT _ModelVShader_vsc[] = {
  69. 0x10fab438,0x66f83f42,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0x9d020000,0x0,0x4000000,0x0,0x9000000,0x2,0x0,0x20000,0x0,0x0,0x94010000,0x55535020,0x20,0x188,0x1,0x1,0x0,0x204,0x80,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x122000a,0xffff,0x6,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0xfffc,0x0,0x0,0x0,0xffff0003,0xffffffff,0x100000,0x800006,0x40001,0x0,0x50001,0x1,0x60001,0x2,0x70001,0x3,0x80001,0x4,0x90001,0x5,0xa0001,
  70. 0x6,0xb0001,0x7,0xc0001,0x8,0xd0001,0x9,0xe0001,0xa,0xf0001,0xb,0x100001,0xc,0x110001,0xd,0x120001,0xe,0x130001,0xf,0x37,0xffffffff,0xffffffff,0x0,0x0,0x4,0x20003,0x90000,0x80010002,0x80018001,0x8001,0x0,0x0,0x10000,0x10001,0x10000,0x10001,0xa0800200,0x28a11001,0xf060050b,0x38ab0606,0xf060470f,0x38820606,0xf0608913,0x38820606,0x701f1a16,0xa21001,0xf000060d,0x38ab0606,0xf0004811,0x38820606,0xf0008a15,0x38820606,0x705f1a18,0xa21001,0x6,0x803f1400,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
  71. 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5000000,0x65566e69,0x78657472,0x4000000,0x304,0x1000001,0x40000,0x67000007,0x6f505f6c,0x69746973,0x6e6f,0x3050501,0x10000,0x100,0xf0004,0x50564d00,0x7274614d,0x7869,0x3031600,0x10000,0x4000100,0xffff10,0x78655400,0x726f6f43,0x64,0x20503,0x100,0x2000001,0x300,0x65546e69,0x6f6f4378,0x6472,0x3040300,0x10000,0x4000100,0x30004,0x0,
  72. };
  73. // Register ModelVShader.vsc in memory file system at application startup time
  74. static CPVRTMemoryFileSystem RegisterFile_ModelVShader_vsc("ModelVShader.vsc", _ModelVShader_vsc, 701);
  75. // ******** End: ModelVShader.vsc ********