FragShader.cpp 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 sBaseTex;\r\n"
  13. "uniform sampler2D sNormalMap;\r\n"
  14. "\t\t\r\n"
  15. "varying lowp vec3 LightVec;\r\n"
  16. "varying mediump vec2 TexCoord;\r\n"
  17. "\r\n"
  18. "void main()\r\n"
  19. "{\r\n"
  20. "\t// read the per-pixel normal from the normal map and expand to [-1, 1]\r\n"
  21. "\tlowp vec3 normal = texture2D(sNormalMap, TexCoord).rgb * 2.0 - 1.0;\r\n"
  22. "\t\r\n"
  23. "\t// linear interpolations of normals may cause shortened normals and thus\r\n"
  24. "\t// visible artifacts on low-poly models.\r\n"
  25. "\t// We omit the normalization here for performance reasons\r\n"
  26. "\t\r\n"
  27. "\t// calculate diffuse lighting as the cosine of the angle between light\r\n"
  28. "\t// direction and surface normal (both in surface local/tangent space)\r\n"
  29. "\t// We don't have to clamp to 0 here because the framebuffer write will be clamped\r\n"
  30. "\tlowp float lightIntensity = dot(LightVec, normal);\r\n"
  31. "\r\n"
  32. "\t// read base texture and modulate with light intensity\r\n"
  33. "\tlowp vec3 texColor = texture2D(sBaseTex, TexCoord).rgb;\t\r\n"
  34. "\tgl_FragColor = vec4(texColor * lightIntensity, 1.0);\r\n"
  35. "}\r\n";
  36. // Register FragShader.fsh in memory file system at application startup time
  37. static CPVRTMemoryFileSystem RegisterFile_FragShader_fsh("FragShader.fsh", _FragShader_fsh, 935);
  38. // ******** End: FragShader.fsh ********
  39. // This file was created by Filewrap 1.1
  40. // Little endian mode
  41. // DO NOT EDIT
  42. #include "../PVRTMemoryFileSystem.h"
  43. // using 32 bit to guarantee alignment.
  44. #ifndef A32BIT
  45. #define A32BIT static const unsigned int
  46. #endif
  47. // ******** Start: FragShader.fsc ********
  48. // File data
  49. A32BIT _FragShader_fsc[] = {
  50. 0x10fab438,0x20489b87,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0x66040000,0x1000000,0x4000000,0x0,0x18000000,0x203,0x0,0x2010000,0x0,0x0,0xbe010000,0x55535020,0x20,0x1b2,0x1,0x0,0x0,0x224,0x0,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x770009,0xffff,0x3,0x0,0x30000,0x1,0x0,0x0,0x0,0x0,0x3fffc,0x40000,0x1,0x0,0xffff0003,0xffffffff,0x10001,0x800000,0x4,0x30001,0x10003,0x0,0x2,0x10000,0x10000,0x2,0x10000,0x30003,0x0,0x4890000,0x1ffea120,
  51. 0xffff4080,0xffffffff,0xffff,0x0,0x40000,0x30000,0x5,0x20001,0x80018001,0x80018001,0x0,0x0,0x0,0x70007,0x3060a,0x30003,0x10000,0x10001,0x40000,0x40004,0x0,0x20001,0x10000,0x0,0x20000,0x20002,0x20000,0x80010002,0x80018001,0x8001,0x0,0x0,0x64b80000,0x9306d820,0x20418891,0x603a840,0x5c088,0x10000,0x80010002,0x80018001,0x8001,0x0,0x10000,0x70001,0x60a0007,0x30003,0x3,0x20002,0x2,0x40004,0x4,0x10000,0x2,0x1,0x40004,0x20002,0x2,0x20001,0x80018001,0x80018001,0x0,0x0,0x9c020011,0x1802601f,
  52. 0x689a2,0x0,0x5020ea01,0x205553,0x1de0000,0x10000,0x0,0x0,0x2a40000,0x0,0x20000,0x7d0000,0x0,0x80000,0x0,0xffff0000,0xffff,0x90000,0xffff0077,0x30000,0x1,0x0,0x10003,0x0,0x0,0x0,0x0,0xfffc0000,0x1,0x10004,0x0,0x30000,0xffffffff,0x1ffff,0x1,0x40080,0x10000,0x30003,0x1,0x20000,0x0,0x1,0x20001,0x0,0x30001,0x3,0x0,0xa1200489,0x40801ffe,0xffffffff,0xffffffff,0x0,0x0,0x4,0x20003,0x10000,0x80010002,0x80018001,0x8001,0x0,0x0,0xa0000000,0x28831000,0x5,
  53. 0x20001,0x80018001,0x80018001,0x0,0x0,0x0,0x70007,0x1060a,0x10001,0x0,0x0,0x40000,0x40004,0x0,0x20001,0x10000,0x1,0x20000,0x20002,0x30000,0x80010002,0x80018001,0x8001,0x0,0x0,0x10000,0xd80024b8,0x88919300,0x88402040,0xc0880603,0xa0000000,0x28831000,0x5,0x20001,0x80018001,0x80018001,0x0,0x0,0x10001,0x70007,0x1060a,0x10001,0x0,0x0,0x40000,0x40004,0x0,0x20001,0x10000,0x40001,0x20004,0x20002,0x10000,0x80010002,0x80018001,0x8001,0x0,0x10000,0x401f9c00,0x89a21800,0x6,0x800,0x0,0x0,
  54. 0x400000,0x0,0x0,0x0,0x803f0000,0x4000000,0x726f4e73,0x4d6c616d,0x7061,0x1031800,0x10000,0x200,0x10001,0x78655400,0x726f6f43,0x64,0x20603,0x100,0x2040001,0x300,0x6867694c,0x63655674,0x4000000,0x106,0x1000001,0x30000,0x73000007,0x65736142,0x786554,0x3180000,0x1000001,0x20000,0x1000101,0x0,
  55. };
  56. // Register FragShader.fsc in memory file system at application startup time
  57. static CPVRTMemoryFileSystem RegisterFile_FragShader_fsc("FragShader.fsc", _FragShader_fsc, 1158);
  58. // ******** End: FragShader.fsc ********