instancingPS.h 885 B

1234567891011121314151617181920212223242526272829303132333435
  1. //this file is autogenerated using stringify.bat (premake --stringify) in the build folder of this project
  2. static const char* instancingFragmentShader= \
  3. "#version 330\n"
  4. "precision highp float;\n"
  5. "in Fragment\n"
  6. "{\n"
  7. " vec4 color;\n"
  8. "} fragment;\n"
  9. "in Vert\n"
  10. "{\n"
  11. " vec2 texcoord;\n"
  12. "} vert;\n"
  13. "uniform sampler2D Diffuse;\n"
  14. "in vec3 lightDir,normal,ambient;\n"
  15. "out vec4 color;\n"
  16. "void main_textured(void)\n"
  17. "{\n"
  18. " color = vec4(0.1,0.2,0.3,0.3);\n"
  19. "}\n"
  20. "void main(void)\n"
  21. "{\n"
  22. " vec4 texel = fragment.color*texture(Diffuse,vert.texcoord);//fragment.color;\n"
  23. " vec3 ct,cf;\n"
  24. " float intensity,at,af;\n"
  25. " \n"
  26. " intensity = 0.5+0.5*clamp( dot( normalize(normal),lightDir ), -1,1 );\n"
  27. " cf = intensity*(vec3(1.0,1.0,1.0)-ambient)+ambient;\n"
  28. " af = 1.0;\n"
  29. " \n"
  30. " ct = texel.rgb;\n"
  31. " at = texel.a;\n"
  32. " \n"
  33. " color = vec4(ct * cf, at * af); \n"
  34. "}\n"
  35. ;