25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12_voronoi_setup.lolfx 1.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //-----------------------------------------------------------------------------
  2. //GLSL
  3. //-----------------------------------------------------------------------------
  4. [vert.glsl]
  5. #version 120
  6. attribute vec2 in_Position;
  7. uniform vec2 in_screen_res;
  8. varying vec2 pass_position;
  9. void main()
  10. {
  11. pass_position = ((vec2(1.0) + in_Position) * 0.5 * in_screen_res);
  12. gl_Position = vec4(in_Position, 0.0, 1.0);
  13. }
  14. [frag.glsl]
  15. #version 120
  16. #if defined GL_ES
  17. precision highp float;
  18. #endif
  19. uniform sampler2D in_texture;
  20. uniform vec3 in_source_point;
  21. uniform vec2 in_screen_res;
  22. varying vec2 pass_position;
  23. void main(void)
  24. {
  25. if (floor(in_source_point.xy) == floor(pass_position))
  26. gl_FragColor = vec4(in_source_point.xy / in_screen_res, in_source_point.z, 1.0);
  27. else
  28. {
  29. vec4 src_color = texture2D(in_texture, pass_position / in_screen_res);
  30. gl_FragColor = src_color;//vec4(0.0, 0.0, 0.0, 1.0);
  31. }
  32. //vec4(pass_position / in_screen_res, 0.0, 1.0);
  33. }
  34. //-----------------------------------------------------------------------------
  35. //HLSL
  36. //-----------------------------------------------------------------------------
  37. [vert.hlsl]
  38. void main(float2 in_Position : POSITION,
  39. out float2 pass_Position : TEXCOORD0,
  40. out float4 out_Position : POSITION)
  41. {
  42. pass_Position = in_Position;
  43. out_Position = float4(in_Position, 0.0, 1.0);
  44. }
  45. [frag.hlsl]
  46. void main(in float2 pass_Position : TEXCOORD0,
  47. uniform float in_Flag,
  48. uniform float3 in_Point,
  49. uniform float3 in_Color,
  50. out float4 out_FragColor : COLOR)
  51. {
  52. out_FragColor = float4(0.0);
  53. }