ModelFShader.cpp 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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: ModelFShader.fsh ********
  10. // File data
  11. static const char _ModelFShader_fsh[] =
  12. "#define ENABLE_TEXTURE\r\n"
  13. "#ifdef ENABLE_TEXTURE\r\n"
  14. "uniform sampler2D\t\tModelTexture;\r\n"
  15. "#endif\r\n"
  16. "\r\n"
  17. "#ifdef ENABLE_FOG_DEPTH\r\n"
  18. "uniform lowp vec3 \t\tFogColour;\r\n"
  19. "uniform mediump float \tRcpMaxFogDepth;\r\n"
  20. "#endif\r\n"
  21. "\r\n"
  22. "#ifdef ENABLE_LIGHTING\r\n"
  23. "\tvarying lowp float\t\tLightIntensity;\r\n"
  24. "#endif\r\n"
  25. "#ifdef ENABLE_TEXTURE\r\n"
  26. "\tvarying mediump vec2 \tTexCoord;\r\n"
  27. "#endif\r\n"
  28. "#ifdef ENABLE_FOG_DEPTH\r\n"
  29. "\tvarying mediump float \tVertexDepth;\r\n"
  30. "#endif\r\n"
  31. "\r\n"
  32. "void main()\r\n"
  33. "{\t\r\n"
  34. "\t#ifdef ONLY_ALPHA\r\n"
  35. "\t\tgl_FragColor = vec4(vec3(0.5),0.0);\r\n"
  36. "\t#else\r\n"
  37. "\t\t#ifdef ENABLE_TEXTURE\r\n"
  38. "\t\t\t#ifdef ENABLE_FOG_DEPTH\t\t\r\n"
  39. "\t\t\t\t// Mix the object's colour with the fogging colour based on fragment's depth\r\n"
  40. "\t\t\t\tlowp vec3 vFragColour = texture2D(ModelTexture, TexCoord).rgb;\r\n"
  41. "\t\t\t\t\r\n"
  42. "\t\t\t\t// Perform depth test and clamp the values\r\n"
  43. "\t\t\t\tlowp float fFogBlend = clamp(VertexDepth * RcpMaxFogDepth, 0.0, 1.0);\r\n"
  44. "\t\t\t\t\r\n"
  45. "\t\t\t\t#ifdef ENABLE_LIGHTING\r\n"
  46. "\t\t\t\t\tvFragColour.rgb = mix(vFragColour.rgb * LightIntensity, FogColour.rgb, fFogBlend);\r\n"
  47. "\t\t\t\t#else\r\n"
  48. "\t\t\t\t\tvFragColour.rgb = mix(vFragColour.rgb, FogColour.rgb, fFogBlend);\r\n"
  49. "\t\t\t\t#endif\r\n"
  50. "\t\t\t\tgl_FragColor = vec4(vFragColour,1.0);\r\n"
  51. "\t\t\t#else\r\n"
  52. "\t\t\t\t#ifdef ENABLE_LIGHTING\r\n"
  53. "\t\t\t\t\tgl_FragColor = vec4(texture2D(ModelTexture, TexCoord).rgb * LightIntensity, 1.0);\r\n"
  54. "\t\t\t\t#else\r\n"
  55. "\t\t\t\t\tgl_FragColor = vec4(texture2D(ModelTexture, TexCoord).rgb, 1.0);\r\n"
  56. "\t\t\t\t#endif\r\n"
  57. "\t\t\t#endif\r\n"
  58. "\t\t#else\r\n"
  59. "\t\t\t// Solid colour is used instead of texture colour\r\n"
  60. "\t\t\t#ifdef ENABLE_LIGHTING\r\n"
  61. "\t\t\t\tgl_FragColor = vec4(vec3(0.3,0.3,0.3)* LightIntensity, 1.0);\r\n"
  62. "\t\t\t#else\r\n"
  63. "\t\t\t\tgl_FragColor = vec4(vec3(0.3,0.3,0.3), 1.0);\t\r\n"
  64. "\t\t\t#endif\r\n"
  65. "\t\t#endif\r\n"
  66. "\t#endif\r\n"
  67. "}\r\n";
  68. // Register ModelFShader.fsh in memory file system at application startup time
  69. static CPVRTMemoryFileSystem RegisterFile_ModelFShader_fsh("ModelFShader.fsh", _ModelFShader_fsh, 1568);
  70. // ******** End: ModelFShader.fsh ********
  71. // This file was created by Filewrap 1.1
  72. // Little endian mode
  73. // DO NOT EDIT
  74. #include "../PVRTMemoryFileSystem.h"
  75. // using 32 bit to guarantee alignment.
  76. #ifndef A32BIT
  77. #define A32BIT static const unsigned int
  78. #endif
  79. // ******** Start: ModelFShader.fsc ********
  80. // File data
  81. A32BIT _ModelFShader_fsc[] = {
  82. 0x10fab438,0x1f78449a,0x30050100,0x2501,0xd363e337,0x2000000,0x20000000,0x2030000,0x1000000,0x4000000,0x0,0x8000000,0x2,0x0,0x20000,0x0,0x0,0x44010000,0x55535020,0x20,0x138,0x1,0x0,0x0,0x224,0x0,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x770009,0xffff,0x1,0x0,0x10000,0x0,0x0,0x0,0x0,0x0,0x3fffc,0x40000,0x1,0x0,0xffff0003,0xffffffff,0x10001,0x800000,0x0,0x1,0x10000,0x9120c038,0x4083103e,0xffffffff,0xffffffff,0x0,0x0,0x4,0x20003,0x10000,0x80010002,
  83. 0x80018001,0x8001,0x0,0x40000,0xa0000000,0x28031000,0x5,0x20001,0x80018001,0x80018001,0x0,0x0,0x10,0x70007,0x3060a,0x30003,0x0,0x0,0x40000,0x40004,0x0,0x20001,0x10000,0x1,0x10000,0x20002,0x10000,0x80010002,0x80018001,0x8001,0x0,0x100000,0xe0030480,0x40811022,0x6,0x44010000,0x55535020,0x20,0x138,0x1,0x0,0x0,0x2a4,0x0,0x2,0x7d,0x0,0x8,0x0,0xffffffff,0x0,0x770009,0xffff,0x10001,0x0,0x10000,0x0,0x0,0x0,0x0,0x0,0x1fffc,0x40000,0x1,
  84. 0x0,0xffff0003,0xffffffff,0x10001,0x800000,0x0,0x1,0x10000,0x9120c038,0x4083103e,0xffffffff,0xffffffff,0x0,0x0,0x4,0x20003,0x10000,0x80010002,0x80018001,0x8001,0x0,0x0,0xa0000000,0x28831000,0x5,0x20001,0x80018001,0x80018001,0x0,0x0,0x0,0x70007,0x1060a,0x10001,0x0,0x0,0x40000,0x40004,0x0,0x20001,0x10000,0x1,0x10000,0x20002,0x10000,0x80010002,0x80018001,0x8001,0x0,0x0,0xe0030480,0x40811020,0x6,0x400,0x0,0x0,0x803f0000,0x2000000,0x65646f4d,0x7865546c,0x65727574,0x18000000,0x103,0x2000001,
  85. 0x10000,0x54000001,0x6f437865,0x64726f,0x6030000,0x1000002,0x10000,0x3000200,0x0,
  86. };
  87. // Register ModelFShader.fsc in memory file system at application startup time
  88. static CPVRTMemoryFileSystem RegisterFile_ModelFShader_fsc("ModelFShader.fsc", _ModelFShader_fsc, 802);
  89. // ******** End: ModelFShader.fsc ********