VertShader.cpp 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. "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 mediump vec3 LightDirection;\r\n"
  18. "uniform mediump\tfloat DisplacementFactor;\r\n"
  19. "\r\n"
  20. "varying lowp float LightIntensity;\r\n"
  21. "varying mediump vec2 TexCoord;\r\n"
  22. "\r\n"
  23. "uniform sampler2D sDisMap;\r\n"
  24. "\r\n"
  25. "void main()\r\n"
  26. "{\r\n"
  27. "\t/* \r\n"
  28. "\t\tCalculate the displacemnt value by taking the colour value from our texture\r\n"
  29. "\t\tand scale it by out displacement factor.\r\n"
  30. "\t*/\r\n"
  31. "\tmediump float disp = texture2D(sDisMap, inTexCoord).r * DisplacementFactor;\r\n"
  32. "\r\n"
  33. "\t/* \r\n"
  34. "\t\tTransform position by the model-view-projection matrix but first\r\n"
  35. "\t\tmove the untransformed position along the normal by our displacement\r\n"
  36. "\t\tvalue.\r\n"
  37. "\t*/\r\n"
  38. "\tgl_Position = MVPMatrix * vec4(inVertex + (inNormal * disp), 1.0);\r\n"
  39. "\r\n"
  40. "\t// Pass through texcoords\r\n"
  41. "\tTexCoord = inTexCoord;\r\n"
  42. "\t\r\n"
  43. "\t// Simple diffuse lighting in model space\r\n"
  44. "\tLightIntensity = dot(inNormal, -LightDirection);\r\n"
  45. "}";
  46. // Register VertShader.vsh in memory file system at application startup time
  47. static CPVRTMemoryFileSystem RegisterFile_VertShader_vsh("VertShader.vsh", _VertShader_vsh, 949);
  48. // ******** End: VertShader.vsh ********
  49. // This file was created by Filewrap 1.1
  50. // Little endian mode
  51. // DO NOT EDIT
  52. #include "../PVRTMemoryFileSystem.h"
  53. // using 32 bit to guarantee alignment.
  54. #ifndef A32BIT
  55. #define A32BIT static const unsigned int
  56. #endif
  57. // ******** Start: VertShader.vsc ********
  58. // File data
  59. A32BIT _VertShader_vsc[] = {
  60. 0x10fab438,0x1df38676,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0x3f040000,0x0,0x4000000,0x0,0x19000000,0x202,0x0,0x1020000,0x0,0x0,0x8a020000,0x55535020,0x20,0x27e,0x1,0x1,0x0,0x204,0x80,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x122000a,0xffff,0xb,0x0,0x0,0x14,0x0,0x1,0x0,0x0,0xfffc,0x0,0x0,0x0,0xffff0003,0xffffffff,0x120000,0x80000b,0x2,0x0,0x10002,0x100000,0x20002,0x1,0x30002,0x100001,0x80001,0x2,0x90001,0x3,0xa0001,
  61. 0x4,0xb0001,0x5,0xc0001,0x6,0xd0001,0x7,0xe0001,0x8,0xf0001,0x9,0x100001,0xa,0x110001,0xb,0x120001,0xc,0x130001,0xd,0x140001,0xe,0x150001,0xf,0x160001,0x10,0x170001,0x11,0x773,0xffffffff,0xffffffff,0x0,0x0,0x4,0x20003,0x10000,0x80010002,0x80018001,0x8001,0x0,0x0,0xa0400001,0x40801d7e,0x5,0x20000,0x80018001,0x80018001,0x0,0x0,0x0,0x10001,0x30688,0x0,0x20000,0x0,0x20000,0x0,0x0,0x0,0x10000,0x0,0x80300000,0x160c9000,0x2e083,0x10000,
  62. 0x80010002,0x80018001,0x8001,0x0,0x0,0xd0512a30,0xc11006,0x2,0x20002,0x80018001,0x80018000,0x0,0x0,0x4,0x1010001,0xfa100000,0xa0e10108,0xa02006,0x2,0x2000b,0x80018001,0x80018001,0x0,0x0,0x4,0x0,0x10001,0x1,0x10001,0x1010001,0x101,0xfa10,0x1001a080,0x25528a1,0x2009b080,0xc60d10e0,0x606f001,0x81138ab,0x606f002,0x4a153882,0x606f002,0x1a183882,0x1001701f,0xc70f00a2,0x606f001,0x91338ab,0x606f002,0x4b173882,0x606f002,0x1a1a3882,0x1001705f,0x600a2,0x18000000,0x0,0x0,0x0,0x0,0x803f,0x0,0x0,0x0,0x0,0x0,0x0,
  63. 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x44730a00,0x614d7369,0x70,0x10318,0x100,0x1000002,0x100,0x65546e69,0x6f6f4378,0x6472,0x2040300,0x10000,0x100,0x30004,0x73694400,0x63616c70,0x6e656d65,0x63614674,0x726f74,0x3020000,0x1000002,0x10000,0x1000100,0x6e690000,0x6d726f4e,0x6c61,0x2040400,0x10000,0x4000100,0x70004,0x566e6900,0x65747265,0x78,0x30404,0x100,0x4080001,0x700,0x505f6c67,0x7469736f,0x6e6f69,0x5050100,0x1000003,0x10000,0xf000400,0x564d0000,0x74614d50,0x786972,0x3160000,0x1000003,0x10000,0xffff1008,
  64. 0x65540000,0x6f6f4378,0x6472,0x2050300,0x10000,0x100,0x30002,0x67694c00,0x69447468,0x74636572,0x6e6f69,0x3040000,0x1000002,0x10000,0x7000301,0x694c0000,0x49746867,0x6e65746e,0x79746973,0x2000000,0x105,0x1000001,0x10400,0x1,
  65. };
  66. // Register VertShader.vsc in memory file system at application startup time
  67. static CPVRTMemoryFileSystem RegisterFile_VertShader_vsc("VertShader.vsc", _VertShader_vsc, 1119);
  68. // ******** End: VertShader.vsc ********