You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 line
840 B

  1. [vert.glsl]
  2. #version 120
  3. attribute vec3 in_Vertex;
  4. attribute vec3 in_Color;
  5. uniform mat4 in_Matrix;
  6. varying vec3 pass_Color;
  7. void main(void)
  8. {
  9. gl_Position = in_Matrix * vec4(in_Vertex, 1.0);
  10. pass_Color = in_Color;
  11. }
  12. [frag.glsl]
  13. #version 120
  14. #if defined GL_ES
  15. precision highp float;
  16. #endif
  17. varying vec3 pass_Color;
  18. void main(void)
  19. {
  20. gl_FragColor = vec4(pass_Color, 1.0);
  21. }
  22. [vert.hlsl]
  23. void main(float3 in_Vertex : POSITION,
  24. float3 in_Color : COLOR,
  25. uniform float4x4 in_Matrix,
  26. out float4 out_Position : POSITION,
  27. out float3 pass_Color : COLOR)
  28. {
  29. pass_Color = in_Color;
  30. out_Position = mul(in_Matrix, float4(in_Vertex, 1.0));
  31. }
  32. [frag.hlsl]
  33. void main(float3 pass_Color : COLOR,
  34. out float4 out_FragColor : COLOR)
  35. {
  36. out_FragColor = float4(pass_Color, 1.0);
  37. }