VertShader.cpp 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. "attribute highp vec3 inVertex;\r\n"
  13. "\r\n"
  14. "uniform highp mat4 ModelViewMatrix;\r\n"
  15. "uniform highp mat4 MVPMatrix;\r\n"
  16. "uniform highp vec3 EyePosition;\t\t// Eye (aka Camera) positon in model-space\r\n"
  17. "uniform mediump vec2 BumpTranslation0;\r\n"
  18. "uniform mediump vec2 BumpScale0;\r\n"
  19. "uniform mediump vec2 BumpTranslation1;\r\n"
  20. "uniform mediump vec2 BumpScale1;\r\n"
  21. "\r\n"
  22. "uniform highp float PerturbScale;\r\n"
  23. " \r\n"
  24. "varying mediump vec2 BumpCoord0;\r\n"
  25. "varying mediump vec2 BumpCoord1;\r\n"
  26. "varying mediump vec3\tWaterToEye;\r\n"
  27. "varying mediump float\tWaterToEyeLength;\r\n"
  28. "\r\n"
  29. "void main()\r\n"
  30. "{\r\n"
  31. "\t// Convert each vertex into projection-space and output the value\r\n"
  32. "\thighp vec4 vInVertex = vec4(inVertex, 1.0);\r\n"
  33. "\tgl_Position = MVPMatrix * vInVertex;\r\n"
  34. "\r\n"
  35. "\t// The texture coordinate is calculated this way to reduce the number of attributes needed\r\n"
  36. "\tmediump vec2 vTexCoord = inVertex.xz;\r\n"
  37. "\r\n"
  38. "\t// Scale and translate texture coordinates used to sample the normal map - section 2.2 of white paper\r\n"
  39. "\tBumpCoord0 = vTexCoord.xy * BumpScale0;\r\n"
  40. "\tBumpCoord0 += BumpTranslation0;\r\n"
  41. "\t\r\n"
  42. "\tBumpCoord1 = vTexCoord.xy * BumpScale1;\r\n"
  43. "\tBumpCoord1 += BumpTranslation1;\r\n"
  44. "\t\r\n"
  45. "\t/* \t\r\n"
  46. "\t\tThe water to eye vector is used to calculate the Fresnel term\r\n"
  47. "\t\tand to fade out perturbations based on distance from the viewer\r\n"
  48. "\t*/\r\n"
  49. "\tWaterToEye = EyePosition - inVertex;\r\n"
  50. "\tWaterToEyeLength = length(WaterToEye);\r\n"
  51. "}\r\n";
  52. // Register VertShader.vsh in memory file system at application startup time
  53. static CPVRTMemoryFileSystem RegisterFile_VertShader_vsh("VertShader.vsh", _VertShader_vsh, 1311);
  54. // ******** End: VertShader.vsh ********
  55. // This file was created by Filewrap 1.1
  56. // Little endian mode
  57. // DO NOT EDIT
  58. #include "../PVRTMemoryFileSystem.h"
  59. // using 32 bit to guarantee alignment.
  60. #ifndef A32BIT
  61. #define A32BIT static const unsigned int
  62. #endif
  63. // ******** Start: VertShader.vsc ********
  64. // File data
  65. A32BIT _VertShader_vsc[] = {
  66. 0x10fab438,0x2af41692,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0x71040000,0x0,0x4000000,0x0,0x79000000,0x2020203,0x0,0x2020000,0x202,0x0,0x68020000,0x55535020,0x20,0x25c,0x1,0x1,0x0,0x204,0x80,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x122000a,0xffff,0x20003,0x0,0x0,0x1b,0x0,0x0,0x0,0x0,0xfffc,0x0,0x0,0x0,0xffff0003,0xffffffff,0x170000,0x800003,0x140002,0x0,0x150002,0x100000,0x160002,0x1,0x170002,0x100001,0x180002,0x2,0x190002,0x100002,0x1a0002,
  67. 0x3,0x1b0002,0x100003,0x10001,0x4,0x20001,0x5,0x30001,0x6,0x40001,0x7,0x50001,0x8,0x60001,0x9,0x70001,0xa,0x80001,0xb,0x90001,0xc,0xa0001,0xd,0xb0001,0xe,0xc0001,0xf,0xd0001,0x10,0xe0001,0x11,0xf0001,0x12,0x100001,0x13,0x110001,0x14,0x120001,0x15,0x130001,0x16,0x7,0xffffffff,0xffffffff,0x0,0x0,0x4,0x20003,0x50000,0x80010002,0x80018001,0x8001,0x0,0x0,0x0,0x0,0xf0e02a56,0xc01005,0xf100aad7,0xc01005,0xf1202c5a,0xc01005,0xf140acdb,0xc01005,
  68. 0x70801a0e,0xa22085,0x2,0x2000e,0x80018001,0x80018002,0x0,0x0,0x4,0x0,0x0,0x10000,0x10001,0x10000,0x10001,0x1010201,0xfa100000,0x60000200,0x28a11000,0x50000285,0x801401,0x50004300,0x801001,0x40000000,0x8801201,0x41600000,0x8801001,0xf0000892,0x38ab0605,0xf0004a96,0x38820605,0xf0008c9a,0x38820605,0x701f1a1d,0xa21001,0xf0000994,0x38ab0606,0xf0004b98,0x38820606,0xf0008d9c,0x38820606,0x705f1a1f,0xa21001,0x6,0x803f1c00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
  69. 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc000000,0x65566e69,0x78657472,0x4000000,0x304,0x1000001,0x40000,0x67000007,0x6f505f6c,0x69746973,0x6e6f,0x3050501,0x10000,0x100,0xf0004,0x50564d00,0x7274614d,0x7869,0x3031600,0x10000,0x4000100,0xffff10,0x6d754200,0x6f6f4370,0x306472,0x5030000,0x1000002,0x10000,0x3000204,0x75420000,0x6353706d,0x30656c61,0x3000000,0x203,0x1000001,0x21400,0x42000003,0x54706d75,0x736e6172,0x6974616c,0x306e6f,0x3030000,0x1000002,0x10000,0x3000216,0x75420000,0x6f43706d,0x3164726f,0x3000000,0x205,0x1000001,0x20800,0x42000003,0x53706d75,0x656c6163,0x31,
  70. 0x20303,0x100,0x2180001,0x300,0x706d7542,0x6e617254,0x74616c73,0x316e6f69,0x3000000,0x203,0x1000001,0x21a00,0x45000003,0x6f506579,0x69746973,0x6e6f,0x3030400,0x10000,0x1000100,0x70003,0x74615700,0x6f547265,0x657945,0x5040000,0x1000002,0x10000,0x7000300,0x61570000,0x54726574,0x6579456f,0x676e654c,0x6874,0x2050200,0x10000,0xc000100,0x10001,0x0,
  71. };
  72. // Register VertShader.vsc in memory file system at application startup time
  73. static CPVRTMemoryFileSystem RegisterFile_VertShader_vsc("VertShader.vsc", _VertShader_vsc, 1169);
  74. // ******** End: VertShader.vsc ********