FragShader.cpp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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: FragShader.fsh ********
  10. // File data
  11. static const char _FragShader_fsh[] =
  12. "uniform sampler2D sReflectTex;\r\n"
  13. "uniform sampler2D sNormalMap;\r\n"
  14. "\r\n"
  15. "uniform bool bHighDetail;\r\n"
  16. "\r\n"
  17. "varying mediump vec3 EyeDirection;\r\n"
  18. "varying mediump vec2 TexCoord;\r\n"
  19. "\r\n"
  20. "void main()\r\n"
  21. "{\r\n"
  22. "\tif (bHighDetail)\r\n"
  23. "\t{\r\n"
  24. "\t\t// Get the normal direction per pixel from the normal map\r\n"
  25. "\t\t// The tNormal vector is defined in surface local coordinates (tangent space).\r\n"
  26. "\t\tmediump vec3 normal = texture2D(sNormalMap, TexCoord).rgb * 2.0 - 1.0;\r\n"
  27. "\t\t\r\n"
  28. "\t\t// reflect(): For the incident vector I and surface orientation N, returns the reflection direction:\r\n"
  29. "\t\t// I - 2 * dot(N, I) * N, N must already be normalized in order to achieve the desired result.\r\n"
  30. "\t\tmediump vec3 reflectDir = reflect(normal, EyeDirection);\r\n"
  31. "\t\tmediump vec2 reflectCoord = (reflectDir.xy) * 0.5 + 0.5;\r\n"
  32. "\t\r\n"
  33. "\t\t// Look-up in the 2D texture using the normal map disturbance\r\n"
  34. "\t\tgl_FragColor = texture2D(sReflectTex, reflectCoord);\r\n"
  35. "\t}\r\n"
  36. "\telse\r\n"
  37. "\t{\r\n"
  38. "\t\tgl_FragColor = texture2D(sReflectTex, TexCoord);\r\n"
  39. "\t}\r\n"
  40. "}\r\n";
  41. // Register FragShader.fsh in memory file system at application startup time
  42. static CPVRTMemoryFileSystem RegisterFile_FragShader_fsh("FragShader.fsh", _FragShader_fsh, 949);
  43. // ******** End: FragShader.fsh ********
  44. // This file was created by Filewrap 1.1
  45. // Little endian mode
  46. // DO NOT EDIT
  47. #include "../PVRTMemoryFileSystem.h"
  48. // using 32 bit to guarantee alignment.
  49. #ifndef A32BIT
  50. #define A32BIT static const unsigned int
  51. #endif
  52. // ******** Start: FragShader.fsc ********
  53. // File data
  54. A32BIT _FragShader_fsc[] = {
  55. 0x10fab438,0xab4327e6,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0xe7060000,0x1000000,0x4000000,0x0,0x18000000,0x2e140203,0x2,0x2020000,0x0,0x43014,0xd0020000,0x55535020,0x20,0x2c4,0x1,0x0,0x0,0x224,0x0,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x770009,0xffff,0x10004,0x0,0x30000,0x4,0x0,0x0,0x0,0x0,0x3fffc,0x40003,0x1,0x3,0xffff0003,0xffffffff,0x30001,0x800000,0x4,0x30001,0x20002,0x0,0x2,0x10000,0x10000,0x2,0x10000,0xc0002,0x0,0xd0002,0x100000,
  56. 0x1,0x1,0x70003,0x20000,0x58b0000,0x1ffea160,0xffff4080,0xffffffff,0xffff,0x0,0x40000,0x30000,0x2,0x20001,0x80018001,0x80018001,0x0,0x0,0x5300000,0x1281d000,0x348a9,0x0,0x400000,0x4f900,0x5,0x20001,0x80018001,0x80018001,0x0,0x0,0x10000,0xf000f,0x3060a,0x30003,0x30003,0x30003,0x40003,0x40004,0x4,0x20001,0x10003,0x0,0x20000,0x30002,0x0,0x400000,0x5f800,0x4,0x50004,0x10000,0x80010002,0x80018001,0x8001,0x0,0x40000,0x70000,0x60a0007,0x30003,0x3,0x20002,0x2,0x40004,0x4,0x10000,
  57. 0x2,0x1,0x0,0x20002,0x2,0x20004,0x80018001,0x80018001,0x0,0x0,0x40004,0x40004,0xd840a5b8,0x88119306,0xa0064102,0x40001f7c,0xa0640100,0x40011fbe,0x80202040,0x10601002,0x2,0x20004,0x80008001,0x80018001,0x0,0x0,0x40004,0x40004,0x1000101,0xfa100000,0xa0308182,0x401006,0xd0406930,0x411006,0x8020a040,0x601086,0x2,0x20002,0x80018001,0x80008000,0x0,0x0,0x40004,0x1010000,0xfa100000,0xf00069d3,0x601006,0x5,0x20000,0x80018001,0x80008000,0x0,0x0,0x10000,0xf000f,0x3060a,0x30003,0x30003,0x30003,0x40003,0x40004,0x4,0x20001,0x10003,
  58. 0x0,0x0,0x1404a000,0x4e003,0x50000,0x6,0x14030000,0x55535020,0x20,0x308,0x1,0x0,0x0,0x2a4,0x0,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x770009,0xffff,0x30004,0x0,0x30000,0x4,0x0,0x0,0x0,0x0,0x1fffc,0x40000,0x1,0x0,0xffff0003,0xffffffff,0x30001,0x800000,0x4,0x30001,0x20002,0x0,0x2,0x10000,0x10000,0x2,0x10000,0xc0002,0x0,0xd0002,0x100000,0x1,0x1,0x70003,0x20000,0x58b0000,0x1ffea160,0xffff4080,0xffffffff,0xffff,0x0,0x40000,
  59. 0x30000,0x2,0x20001,0x80018001,0x80018001,0x0,0x0,0x5300000,0x1281d000,0x348a9,0x0,0x400000,0x4f900,0x5,0x20001,0x80018001,0x80018001,0x0,0x0,0x10000,0xf000f,0x1060a,0x10001,0x1,0x0,0x40000,0x40004,0x4,0x20001,0x10003,0x1,0x20000,0x30002,0x0,0x400000,0x5f800,0x4,0x20004,0x10000,0x80010002,0x80018001,0x8001,0x0,0x40000,0xa0000000,0x28031000,0x5,0x20001,0x80018001,0x80018001,0x0,0x0,0x4,0x70007,0x1060a,0x10001,0x0,0x0,0x40000,0x40004,0x0,0x20001,0x10000,0x1,
  60. 0x20000,0x20002,0x30000,0x80010002,0x80018001,0x8001,0x0,0x40000,0x40004,0xd80025b8,0x88119300,0x464000,0x40001f7c,0x20240000,0x40011fbc,0x2,0x20002,0x80018000,0x80018001,0x0,0x0,0x40004,0x10101,0xfa100000,0x80002044,0x10601000,0x2,0x20004,0x80008001,0x80018001,0x0,0x0,0x40004,0x40004,0x1000101,0xfa100000,0x108080,0x401004,0xd0002930,0x411000,0x80202044,0x601080,0x2,0x20002,0x80018001,0x80008000,0x0,0x0,0x40004,0x1010000,0xfa100000,0xf00069d3,0x601000,0x5,0x20000,0x80018001,0x80008000,0x0,0x0,0x10000,0xf000f,0x1060a,0x10001,0x1,
  61. 0x0,0x40000,0x40004,0x4,0x20001,0x10003,0x2,0x0,0x1400a000,0x4e003,0x50000,0x6,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x400000,0x0,0x0,0x0,0x803f0000,0x400000,0x3f0000,0x0,0x0,0x5000000,0x67694862,0x74654468,0x6c6961,0x30a0000,0x1000000,0x10000,0x1000100,0x4e730000,0x616d726f,0x70614d6c,0x18000000,0x103,0x2000001,0x10000,0x54000001,0x6f437865,0x64726f,0x6030000,0x1000002,0x10000,0x3000204,0x79450000,0x72694465,0x69746365,0x6e6f,0x2060400,0x10000,0x100,0x70003,0x65527300,0x63656c66,0x78655474,0x18000000,0x103,0x2000001,
  62. 0x10100,0x1,
  63. };
  64. // Register FragShader.fsc in memory file system at application startup time
  65. static CPVRTMemoryFileSystem RegisterFile_FragShader_fsc("FragShader.fsc", _FragShader_fsc, 1799);
  66. // ******** End: FragShader.fsc ********