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.
 
 
 

58 lines
1.0 KiB

  1. -- GLSL.Vert --
  2. #version 120
  3. attribute vec2 in_Position;
  4. varying vec2 pass_Position;
  5. void main()
  6. {
  7. pass_Position = in_Position;
  8. gl_Position = vec4(in_Position, 0.0, 1.0);
  9. }
  10. -- GLSL.Frag --
  11. #version 120
  12. uniform sampler2D in_Texture;
  13. uniform float in_Flag;
  14. uniform vec3 in_Point;
  15. uniform vec3 in_Color;
  16. varying vec2 pass_Position;
  17. void main(void)
  18. {
  19. if (in_Flag == 0.0)
  20. {
  21. float s = 4.0 + 4.0 * in_Point.z;
  22. vec2 p = pass_Position - in_Point.xy * 0.8;
  23. float f = clamp(1.0 - dot(s * p, s * p), 0.0, 1.0);
  24. f = sqrt(f);
  25. gl_FragColor = vec4(f * in_Color, f + 0.1);
  26. }
  27. else
  28. {
  29. vec2 texcoords = pass_Position * 0.5 + vec2(0.5, 0.5);
  30. gl_FragColor = vec4(texture2D(in_Texture, texcoords).xyz, 1.0);
  31. }
  32. }
  33. -- HLSL.Vert --
  34. void main(float2 in_Position : POSITION,
  35. out float4 out_Position : POSITION)
  36. {
  37. out_Position = float4(in_Position, 0.0, 1.0);
  38. }
  39. -- HLSL.Frag --
  40. void main(out float4 out_FragColor : COLOR)
  41. {
  42. out_FragColor = float4(0.7, 0.2, 0.5, 1.0);
  43. }