01_triangle.lolfx 677 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Awesome triangle shader
  3. */
  4. technique FlatColor
  5. {
  6. pass DefaultPass
  7. {
  8. vertexshader = vert;
  9. pixelshader = frag;
  10. }
  11. }
  12. [vert.glsl]
  13. #version 120
  14. attribute vec2 in_Position;
  15. void main(void)
  16. {
  17. gl_Position = vec4(in_Position, 0.0, 1.0);
  18. }
  19. [frag.glsl]
  20. #version 120
  21. #if defined GL_ES
  22. precision highp float;
  23. #endif
  24. void main(void)
  25. {
  26. gl_FragColor = vec4(0.7, 0.2, 0.5, 1.0);
  27. }
  28. [vert.hlsl]
  29. void main(float2 in_Position : POSITION,
  30. out float4 out_Position : POSITION)
  31. {
  32. out_Position = float4(in_Position, 0.0, 1.0);
  33. }
  34. [frag.hlsl]
  35. void main(out float4 out_FragColor : COLOR)
  36. {
  37. out_FragColor = float4(0.7, 0.2, 0.5, 1.0);
  38. }