propane 3.10.0-java → 3.11.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  3. data/CHANGELOG.md +2 -0
  4. data/README.md +7 -7
  5. data/lib/propane/app.rb +2 -5
  6. data/lib/propane/helper_methods.rb +6 -6
  7. data/lib/propane/version.rb +1 -1
  8. data/lib/{propane-3.10.0.jar → propane-3.11.0.jar} +0 -0
  9. data/pom.rb +6 -6
  10. data/pom.xml +6 -6
  11. data/propane.gemspec +3 -3
  12. data/src/main/java/monkstone/noise/OpenSimplex2F.java +838 -737
  13. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +8 -13
  14. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +14 -28
  15. data/src/main/java/processing/awt/PImageAWT.java +6 -4
  16. data/src/main/java/processing/core/PApplet.java +71 -59
  17. data/src/main/java/processing/core/PImage.java +14 -14
  18. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
  19. data/src/main/java/processing/opengl/PShader.java +1 -6
  20. data/src/main/java/processing/opengl/PSurfaceJOGL.java +6 -6
  21. data/{lib/java/processing/opengl → src/main/resources}/cursors/arrow.png +0 -0
  22. data/{lib/java/processing/opengl → src/main/resources}/cursors/cross.png +0 -0
  23. data/{lib/java/processing/opengl → src/main/resources}/cursors/hand.png +0 -0
  24. data/{lib/java/processing/opengl → src/main/resources}/cursors/license.txt +0 -0
  25. data/{lib/java/processing/opengl → src/main/resources}/cursors/move.png +0 -0
  26. data/{lib/java/processing/opengl → src/main/resources}/cursors/text.png +0 -0
  27. data/{lib/java/processing/opengl → src/main/resources}/cursors/wait.png +0 -0
  28. data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorFrag.glsl +0 -0
  29. data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorVert.glsl +0 -0
  30. data/{lib/java/processing/opengl → src/main/resources}/shaders/LightFrag.glsl +0 -0
  31. data/{lib/java/processing/opengl → src/main/resources}/shaders/LightVert.glsl +0 -0
  32. data/{lib/java/processing/opengl → src/main/resources}/shaders/LineFrag.glsl +0 -0
  33. data/{lib/java/processing/opengl → src/main/resources}/shaders/LineVert.glsl +0 -0
  34. data/{lib/java/processing/opengl → src/main/resources}/shaders/MaskFrag.glsl +0 -0
  35. data/{lib/java/processing/opengl → src/main/resources}/shaders/PointFrag.glsl +0 -0
  36. data/{lib/java/processing/opengl → src/main/resources}/shaders/PointVert.glsl +0 -0
  37. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexFrag.glsl +0 -0
  38. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightFrag.glsl +0 -0
  39. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightVert.glsl +0 -0
  40. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexVert.glsl +0 -0
  41. data/test/test_helper.rb +1 -0
  42. data/vendors/Rakefile +1 -1
  43. metadata +29 -155
  44. data/lib/java/japplemenubar/JAppleMenuBar.java +0 -88
  45. data/lib/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
  46. data/lib/java/monkstone/ColorUtil.java +0 -127
  47. data/lib/java/monkstone/MathToolModule.java +0 -287
  48. data/lib/java/monkstone/PropaneLibrary.java +0 -46
  49. data/lib/java/monkstone/core/LibraryProxy.java +0 -136
  50. data/lib/java/monkstone/fastmath/DegLutTables.java +0 -111
  51. data/lib/java/monkstone/fastmath/Deglut.java +0 -71
  52. data/lib/java/monkstone/fastmath/package-info.java +0 -6
  53. data/lib/java/monkstone/filechooser/Chooser.java +0 -39
  54. data/lib/java/monkstone/noise/FastTerrain.java +0 -874
  55. data/lib/java/monkstone/noise/Noise.java +0 -90
  56. data/lib/java/monkstone/noise/NoiseGenerator.java +0 -75
  57. data/lib/java/monkstone/noise/NoiseMode.java +0 -28
  58. data/lib/java/monkstone/noise/OpenSimplex2F.java +0 -881
  59. data/lib/java/monkstone/noise/OpenSimplex2S.java +0 -1106
  60. data/lib/java/monkstone/noise/SmoothTerrain.java +0 -1099
  61. data/lib/java/monkstone/slider/CustomHorizontalSlider.java +0 -164
  62. data/lib/java/monkstone/slider/CustomVerticalSlider.java +0 -178
  63. data/lib/java/monkstone/slider/SimpleHorizontalSlider.java +0 -145
  64. data/lib/java/monkstone/slider/SimpleSlider.java +0 -166
  65. data/lib/java/monkstone/slider/SimpleVerticalSlider.java +0 -157
  66. data/lib/java/monkstone/slider/Slider.java +0 -61
  67. data/lib/java/monkstone/slider/SliderBar.java +0 -245
  68. data/lib/java/monkstone/slider/SliderGroup.java +0 -56
  69. data/lib/java/monkstone/slider/WheelHandler.java +0 -35
  70. data/lib/java/monkstone/vecmath/GfxRender.java +0 -86
  71. data/lib/java/monkstone/vecmath/JRender.java +0 -56
  72. data/lib/java/monkstone/vecmath/ShapeRender.java +0 -87
  73. data/lib/java/monkstone/vecmath/package-info.java +0 -20
  74. data/lib/java/monkstone/vecmath/vec2/Vec2.java +0 -802
  75. data/lib/java/monkstone/vecmath/vec2/package-info.java +0 -6
  76. data/lib/java/monkstone/vecmath/vec3/Vec3.java +0 -727
  77. data/lib/java/monkstone/vecmath/vec3/package-info.java +0 -6
  78. data/lib/java/monkstone/videoevent/CaptureEvent.java +0 -27
  79. data/lib/java/monkstone/videoevent/MovieEvent.java +0 -32
  80. data/lib/java/monkstone/videoevent/package-info.java +0 -20
  81. data/lib/java/processing/awt/PGraphicsJava2D.java +0 -3040
  82. data/lib/java/processing/awt/PImageAWT.java +0 -377
  83. data/lib/java/processing/awt/PShapeJava2D.java +0 -387
  84. data/lib/java/processing/awt/PSurfaceAWT.java +0 -1581
  85. data/lib/java/processing/awt/ShimAWT.java +0 -581
  86. data/lib/java/processing/core/PApplet.java +0 -15156
  87. data/lib/java/processing/core/PConstants.java +0 -523
  88. data/lib/java/processing/core/PFont.java +0 -1126
  89. data/lib/java/processing/core/PGraphics.java +0 -8600
  90. data/lib/java/processing/core/PImage.java +0 -3377
  91. data/lib/java/processing/core/PMatrix.java +0 -208
  92. data/lib/java/processing/core/PMatrix2D.java +0 -562
  93. data/lib/java/processing/core/PMatrix3D.java +0 -890
  94. data/lib/java/processing/core/PShape.java +0 -3561
  95. data/lib/java/processing/core/PShapeOBJ.java +0 -483
  96. data/lib/java/processing/core/PShapeSVG.java +0 -2016
  97. data/lib/java/processing/core/PStyle.java +0 -63
  98. data/lib/java/processing/core/PSurface.java +0 -198
  99. data/lib/java/processing/core/PSurfaceNone.java +0 -431
  100. data/lib/java/processing/core/PVector.java +0 -1066
  101. data/lib/java/processing/core/ThinkDifferent.java +0 -115
  102. data/lib/java/processing/data/DoubleDict.java +0 -850
  103. data/lib/java/processing/data/DoubleList.java +0 -928
  104. data/lib/java/processing/data/FloatDict.java +0 -847
  105. data/lib/java/processing/data/FloatList.java +0 -936
  106. data/lib/java/processing/data/IntDict.java +0 -807
  107. data/lib/java/processing/data/IntList.java +0 -936
  108. data/lib/java/processing/data/JSONArray.java +0 -1260
  109. data/lib/java/processing/data/JSONObject.java +0 -2282
  110. data/lib/java/processing/data/JSONTokener.java +0 -435
  111. data/lib/java/processing/data/LongDict.java +0 -802
  112. data/lib/java/processing/data/LongList.java +0 -937
  113. data/lib/java/processing/data/Sort.java +0 -46
  114. data/lib/java/processing/data/StringDict.java +0 -613
  115. data/lib/java/processing/data/StringList.java +0 -800
  116. data/lib/java/processing/data/Table.java +0 -4936
  117. data/lib/java/processing/data/TableRow.java +0 -198
  118. data/lib/java/processing/data/XML.java +0 -1156
  119. data/lib/java/processing/dxf/RawDXF.java +0 -404
  120. data/lib/java/processing/event/Event.java +0 -125
  121. data/lib/java/processing/event/KeyEvent.java +0 -70
  122. data/lib/java/processing/event/MouseEvent.java +0 -114
  123. data/lib/java/processing/event/TouchEvent.java +0 -57
  124. data/lib/java/processing/javafx/PGraphicsFX2D.java +0 -32
  125. data/lib/java/processing/javafx/PSurfaceFX.java +0 -173
  126. data/lib/java/processing/net/Client.java +0 -744
  127. data/lib/java/processing/net/Server.java +0 -388
  128. data/lib/java/processing/opengl/FontTexture.java +0 -378
  129. data/lib/java/processing/opengl/FrameBuffer.java +0 -513
  130. data/lib/java/processing/opengl/LinePath.java +0 -627
  131. data/lib/java/processing/opengl/LineStroker.java +0 -681
  132. data/lib/java/processing/opengl/PGL.java +0 -3483
  133. data/lib/java/processing/opengl/PGraphics2D.java +0 -615
  134. data/lib/java/processing/opengl/PGraphics3D.java +0 -281
  135. data/lib/java/processing/opengl/PGraphicsOpenGL.java +0 -13753
  136. data/lib/java/processing/opengl/PJOGL.java +0 -2008
  137. data/lib/java/processing/opengl/PShader.java +0 -1484
  138. data/lib/java/processing/opengl/PShapeOpenGL.java +0 -5269
  139. data/lib/java/processing/opengl/PSurfaceJOGL.java +0 -1385
  140. data/lib/java/processing/opengl/Texture.java +0 -1696
  141. data/lib/java/processing/opengl/VertexBuffer.java +0 -88
  142. data/lib/java/processing/pdf/PGraphicsPDF.java +0 -581
  143. data/lib/java/processing/svg/PGraphicsSVG.java +0 -378
  144. data/src/main/java/processing/opengl/cursors/arrow.png +0 -0
  145. data/src/main/java/processing/opengl/cursors/cross.png +0 -0
  146. data/src/main/java/processing/opengl/cursors/hand.png +0 -0
  147. data/src/main/java/processing/opengl/cursors/license.txt +0 -27
  148. data/src/main/java/processing/opengl/cursors/move.png +0 -0
  149. data/src/main/java/processing/opengl/cursors/text.png +0 -0
  150. data/src/main/java/processing/opengl/cursors/wait.png +0 -0
  151. data/src/main/java/processing/opengl/shaders/ColorFrag.glsl +0 -32
  152. data/src/main/java/processing/opengl/shaders/ColorVert.glsl +0 -34
  153. data/src/main/java/processing/opengl/shaders/LightFrag.glsl +0 -33
  154. data/src/main/java/processing/opengl/shaders/LightVert.glsl +0 -151
  155. data/src/main/java/processing/opengl/shaders/LineFrag.glsl +0 -32
  156. data/src/main/java/processing/opengl/shaders/LineVert.glsl +0 -100
  157. data/src/main/java/processing/opengl/shaders/MaskFrag.glsl +0 -40
  158. data/src/main/java/processing/opengl/shaders/PointFrag.glsl +0 -32
  159. data/src/main/java/processing/opengl/shaders/PointVert.glsl +0 -56
  160. data/src/main/java/processing/opengl/shaders/TexFrag.glsl +0 -37
  161. data/src/main/java/processing/opengl/shaders/TexLightFrag.glsl +0 -37
  162. data/src/main/java/processing/opengl/shaders/TexLightVert.glsl +0 -157
  163. data/src/main/java/processing/opengl/shaders/TexVert.glsl +0 -38
@@ -1,32 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- #ifdef GL_ES
24
- precision mediump float;
25
- precision mediump int;
26
- #endif
27
-
28
- varying vec4 vertColor;
29
-
30
- void main() {
31
- gl_FragColor = vertColor;
32
- }
@@ -1,100 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- #define PROCESSING_LINE_SHADER
24
-
25
- uniform mat4 modelviewMatrix;
26
- uniform mat4 projectionMatrix;
27
-
28
- uniform vec4 viewport;
29
- uniform int perspective;
30
- uniform vec3 scale;
31
-
32
- attribute vec4 position;
33
- attribute vec4 color;
34
- attribute vec4 direction;
35
-
36
- varying vec4 vertColor;
37
-
38
- void main() {
39
- vec4 posp = modelviewMatrix * position;
40
- vec4 posq = modelviewMatrix * (position + vec4(direction.xyz, 0));
41
-
42
- // Moving vertices slightly toward the camera
43
- // to avoid depth-fighting with the fill triangles.
44
- // Discussed here:
45
- // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848
46
- posp.xyz = posp.xyz * scale;
47
- posq.xyz = posq.xyz * scale;
48
-
49
- vec4 p = projectionMatrix * posp;
50
- vec4 q = projectionMatrix * posq;
51
-
52
- // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])
53
- // screen_p = (p.xy/p.w + <1,1>) * 0.5 * viewport.zw
54
-
55
- // prevent division by W by transforming the tangent formula (div by 0 causes
56
- // the line to disappear, see https://github.com/processing/processing/issues/5183)
57
- // t = screen_q - screen_p
58
- //
59
- // tangent is normalized and we don't care which direction it points to (+-)
60
- // t = +- normalize( screen_q - screen_p )
61
- // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*viewport.zw - (p.xy/p.w+<1,1>)*0.5*viewport.zw )
62
- //
63
- // extract common factor, <1,1> - <1,1> cancels out
64
- // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * viewport.zw )
65
- //
66
- // convert to common divisor
67
- // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * viewport.zw )
68
- //
69
- // remove the common scalar divisor/factor, not needed due to normalize and +-
70
- // (keep viewport - can't remove because it has different components for x and y
71
- // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181)
72
- // t = +- normalize( (q.xy*p.w - p.xy*q.w) * viewport.zw )
73
-
74
- vec2 tangent = (q.xy*p.w - p.xy*q.w) * viewport.zw;
75
-
76
- // don't normalize zero vector (line join triangles and lines perpendicular to the eye plane)
77
- tangent = length(tangent) == 0.0 ? vec2(0.0, 0.0) : normalize(tangent);
78
-
79
- // flip tangent to normal (it's already normalized)
80
- vec2 normal = vec2(-tangent.y, tangent.x);
81
-
82
- float thickness = direction.w;
83
- vec2 offset = normal * thickness;
84
-
85
- // Perspective ---
86
- // convert from world to clip by multiplying with projection scaling factor
87
- // to get the right thickness (see https://github.com/processing/processing/issues/5182)
88
- // invert Y, projections in Processing invert Y
89
- vec2 perspScale = (projectionMatrix * vec4(1, -1, 0, 0)).xy;
90
-
91
- // No Perspective ---
92
- // multiply by W (to cancel out division by W later in the pipeline) and
93
- // convert from screen to clip (derived from clip to screen above)
94
- vec2 noPerspScale = p.w / (0.5 * viewport.zw);
95
-
96
- gl_Position.xy = p.xy + offset.xy * mix(noPerspScale, perspScale, float(perspective > 0));
97
- gl_Position.zw = p.zw;
98
-
99
- vertColor = color;
100
- }
@@ -1,40 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- #ifdef GL_ES
24
- precision mediump float;
25
- precision mediump int;
26
- #endif
27
-
28
- #define PROCESSING_TEXTURE_SHADER
29
-
30
- uniform sampler2D texture;
31
- uniform sampler2D mask;
32
-
33
- varying vec4 vertTexCoord;
34
-
35
- void main() {
36
- vec3 texColor = texture2D(texture, vertTexCoord.st).rgb;
37
- vec3 maskColor = texture2D(mask, vertTexCoord.st).rgb;
38
- float luminance = dot(maskColor, vec3(0.2126, 0.7152, 0.0722));
39
- gl_FragColor = vec4(texColor, luminance);
40
- }
@@ -1,32 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- #ifdef GL_ES
24
- precision mediump float;
25
- precision mediump int;
26
- #endif
27
-
28
- varying vec4 vertColor;
29
-
30
- void main() {
31
- gl_FragColor = vertColor;
32
- }
@@ -1,56 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- uniform mat4 projectionMatrix;
24
- uniform mat4 modelviewMatrix;
25
-
26
- uniform vec4 viewport;
27
- uniform int perspective;
28
-
29
- attribute vec4 position;
30
- attribute vec4 color;
31
- attribute vec2 offset;
32
-
33
- varying vec4 vertColor;
34
-
35
- void main() {
36
- vec4 pos = modelviewMatrix * position;
37
- vec4 clip = projectionMatrix * pos;
38
-
39
- // Perspective ---
40
- // convert from world to clip by multiplying with projection scaling factor
41
- // invert Y, projections in Processing invert Y
42
- vec2 perspScale = (projectionMatrix * vec4(1, -1, 0, 0)).xy;
43
-
44
- // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height])
45
- // screen_p = (p.xy/p.w + <1,1>) * 0.5 * viewport.zw
46
-
47
- // No Perspective ---
48
- // multiply by W (to cancel out division by W later in the pipeline) and
49
- // convert from screen to clip (derived from clip to screen above)
50
- vec2 noPerspScale = clip.w / (0.5 * viewport.zw);
51
-
52
- gl_Position.xy = clip.xy + offset.xy * mix(noPerspScale, perspScale, float(perspective > 0));
53
- gl_Position.zw = clip.zw;
54
-
55
- vertColor = color;
56
- }
@@ -1,37 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- #ifdef GL_ES
24
- precision mediump float;
25
- precision mediump int;
26
- #endif
27
-
28
- uniform sampler2D texture;
29
-
30
- uniform vec2 texOffset;
31
-
32
- varying vec4 vertColor;
33
- varying vec4 vertTexCoord;
34
-
35
- void main() {
36
- gl_FragColor = texture2D(texture, vertTexCoord.st) * vertColor;
37
- }
@@ -1,37 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
- #ifdef GL_ES
23
- precision mediump float;
24
- precision mediump int;
25
- #endif
26
-
27
- uniform sampler2D texture;
28
-
29
- uniform vec2 texOffset;
30
-
31
- varying vec4 vertColor;
32
- varying vec4 backVertColor;
33
- varying vec4 vertTexCoord;
34
-
35
- void main() {
36
- gl_FragColor = texture2D(texture, vertTexCoord.st) * (gl_FrontFacing ? vertColor : backVertColor);
37
- }
@@ -1,157 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- uniform mat4 modelviewMatrix;
24
- uniform mat4 transformMatrix;
25
- uniform mat3 normalMatrix;
26
- uniform mat4 texMatrix;
27
-
28
- uniform int lightCount;
29
- uniform vec4 lightPosition[8];
30
- uniform vec3 lightNormal[8];
31
- uniform vec3 lightAmbient[8];
32
- uniform vec3 lightDiffuse[8];
33
- uniform vec3 lightSpecular[8];
34
- uniform vec3 lightFalloff[8];
35
- uniform vec2 lightSpot[8];
36
-
37
- attribute vec4 position;
38
- attribute vec4 color;
39
- attribute vec3 normal;
40
- attribute vec2 texCoord;
41
-
42
- attribute vec4 ambient;
43
- attribute vec4 specular;
44
- attribute vec4 emissive;
45
- attribute float shininess;
46
-
47
- varying vec4 vertColor;
48
- varying vec4 backVertColor;
49
- varying vec4 vertTexCoord;
50
-
51
- const float zero_float = 0.0;
52
- const float one_float = 1.0;
53
- const vec3 zero_vec3 = vec3(0);
54
-
55
- float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
56
- vec3 lpv = lightPos - vertPos;
57
- vec3 dist = vec3(one_float);
58
- dist.z = dot(lpv, lpv);
59
- dist.y = sqrt(dist.z);
60
- return one_float / dot(dist, coeff);
61
- }
62
-
63
- float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
64
- vec3 lpv = normalize(lightPos - vertPos);
65
- vec3 nln = -one_float * lightNorm;
66
- float spotCos = dot(nln, lpv);
67
- return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
68
- }
69
-
70
- float lambertFactor(vec3 lightDir, vec3 vecNormal) {
71
- return max(zero_float, dot(lightDir, vecNormal));
72
- }
73
-
74
- float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) {
75
- vec3 np = normalize(vertPos);
76
- vec3 ldp = normalize(lightDir - np);
77
- return pow(max(zero_float, dot(ldp, vecNormal)), shine);
78
- }
79
-
80
- void main() {
81
- // Vertex in clip coordinates
82
- gl_Position = transformMatrix * position;
83
-
84
- // Vertex in eye coordinates
85
- vec3 ecVertex = vec3(modelviewMatrix * position);
86
-
87
- // Normal vector in eye coordinates
88
- vec3 ecNormal = normalize(normalMatrix * normal);
89
- vec3 ecNormalInv = ecNormal * -one_float;
90
-
91
- // Light calculations
92
- vec3 totalAmbient = vec3(0, 0, 0);
93
-
94
- vec3 totalFrontDiffuse = vec3(0, 0, 0);
95
- vec3 totalFrontSpecular = vec3(0, 0, 0);
96
-
97
- vec3 totalBackDiffuse = vec3(0, 0, 0);
98
- vec3 totalBackSpecular = vec3(0, 0, 0);
99
-
100
- for (int i = 0; i < 8; i++) {
101
- if (lightCount == i) break;
102
-
103
- vec3 lightPos = lightPosition[i].xyz;
104
- bool isDir = lightPosition[i].w < one_float;
105
- float spotCos = lightSpot[i].x;
106
- float spotExp = lightSpot[i].y;
107
-
108
- vec3 lightDir;
109
- float falloff;
110
- float spotf;
111
-
112
- if (isDir) {
113
- falloff = one_float;
114
- lightDir = -one_float * lightNormal[i];
115
- } else {
116
- falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
117
- lightDir = normalize(lightPos - ecVertex);
118
- }
119
-
120
- spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i],
121
- spotCos, spotExp)
122
- : one_float;
123
-
124
- if (any(greaterThan(lightAmbient[i], zero_vec3))) {
125
- totalAmbient += lightAmbient[i] * falloff;
126
- }
127
-
128
- if (any(greaterThan(lightDiffuse[i], zero_vec3))) {
129
- totalFrontDiffuse += lightDiffuse[i] * falloff * spotf *
130
- lambertFactor(lightDir, ecNormal);
131
- totalBackDiffuse += lightDiffuse[i] * falloff * spotf *
132
- lambertFactor(lightDir, ecNormalInv);
133
- }
134
-
135
- if (any(greaterThan(lightSpecular[i], zero_vec3))) {
136
- totalFrontSpecular += lightSpecular[i] * falloff * spotf *
137
- blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess);
138
- totalBackSpecular += lightSpecular[i] * falloff * spotf *
139
- blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess);
140
- }
141
- }
142
-
143
- // Calculating final color as result of all lights (plus emissive term).
144
- // Transparency is determined exclusively by the diffuse component.
145
- vertColor = vec4(totalAmbient, 0) * ambient +
146
- vec4(totalFrontDiffuse, 1) * color +
147
- vec4(totalFrontSpecular, 0) * specular +
148
- vec4(emissive.rgb, 0);
149
-
150
- backVertColor = vec4(totalAmbient, 0) * ambient +
151
- vec4(totalBackDiffuse, 1) * color +
152
- vec4(totalBackSpecular, 0) * specular +
153
- vec4(emissive.rgb, 0);
154
-
155
- // Calculating texture coordinates, with r and q set both to one
156
- vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
157
- }
@@ -1,38 +0,0 @@
1
- /*
2
- Part of the Processing project - http://processing.org
3
-
4
- Copyright (c) 2012-15 The Processing Foundation
5
- Copyright (c) 2004-12 Ben Fry and Casey Reas
6
- Copyright (c) 2001-04 Massachusetts Institute of Technology
7
-
8
- This library is free software; you can redistribute it and/or
9
- modify it under the terms of the GNU Lesser General Public
10
- License as published by the Free Software Foundation, version 2.1.
11
-
12
- This library is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- Lesser General Public License for more details.
16
-
17
- You should have received a copy of the GNU Lesser General
18
- Public License along with this library; if not, write to the
19
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
- Boston, MA 02111-1307 USA
21
- */
22
-
23
- uniform mat4 transformMatrix;
24
- uniform mat4 texMatrix;
25
-
26
- attribute vec4 position;
27
- attribute vec4 color;
28
- attribute vec2 texCoord;
29
-
30
- varying vec4 vertColor;
31
- varying vec4 vertTexCoord;
32
-
33
- void main() {
34
- gl_Position = transformMatrix * position;
35
-
36
- vertColor = color;
37
- vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
38
- }