propane 2.9.0-java → 2.9.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -0
  3. data/Rakefile +2 -3
  4. data/lib/.gitignore +1 -0
  5. data/lib/export.txt +2 -0
  6. data/lib/propane/version.rb +1 -1
  7. data/pom.rb +2 -49
  8. data/pom.xml +1 -64
  9. data/propane.gemspec +13 -10
  10. data/src/main/java/processing/awt/PGraphicsJava2D.java +29 -20
  11. data/src/main/java/processing/core/PApplet.java +12854 -12803
  12. data/src/main/java/processing/core/PGraphics.java +17 -22
  13. data/src/main/java/processing/core/PShape.java +42 -20
  14. data/src/main/java/processing/core/PShapeSVG.java +20 -5
  15. data/src/main/java/processing/core/PSurfaceNone.java +1 -4
  16. data/src/main/java/processing/data/DoubleDict.java +848 -0
  17. data/src/main/java/processing/data/DoubleList.java +928 -0
  18. data/src/main/java/processing/data/FloatDict.java +18 -2
  19. data/src/main/java/processing/data/FloatList.java +26 -2
  20. data/src/main/java/processing/data/IntDict.java +12 -3
  21. data/src/main/java/processing/data/IntList.java +24 -1
  22. data/src/main/java/processing/data/JSONObject.java +2 -2
  23. data/src/main/java/processing/data/LongDict.java +800 -0
  24. data/src/main/java/processing/data/LongList.java +937 -0
  25. data/src/main/java/processing/data/Sort.java +1 -1
  26. data/src/main/java/processing/data/StringDict.java +12 -3
  27. data/src/main/java/processing/data/StringList.java +25 -2
  28. data/src/main/java/processing/data/Table.java +16 -5
  29. data/src/main/java/processing/data/XML.java +8 -1
  30. data/src/main/java/processing/opengl/PGL.java +23 -16
  31. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -10
  32. data/src/main/java/processing/opengl/PJOGL.java +35 -12
  33. data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +154 -0
  34. data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +2 -2
  35. data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +160 -0
  36. data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +2 -2
  37. metadata +22 -13
@@ -96,8 +96,8 @@ void main() {
96
96
  vec3 totalBackSpecular = vec3(0, 0, 0);
97
97
 
98
98
  // prevent register allocation failure by limiting ourselves to
99
- // two lights for now
100
- for (int i = 0; i < 2; i++) {
99
+ // four lights for now
100
+ for (int i = 0; i < 4; i++) {
101
101
  if (lightCount == i) break;
102
102
 
103
103
  vec3 lightPos = lightPosition[i].xyz;
@@ -0,0 +1,160 @@
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.0);
54
+ const vec3 minus_one_vec3 = vec3(0.0-1.0);
55
+
56
+ float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
57
+ vec3 lpv = lightPos - vertPos;
58
+ vec3 dist = vec3(one_float);
59
+ dist.z = dot(lpv, lpv);
60
+ dist.y = sqrt(dist.z);
61
+ return one_float / dot(dist, coeff);
62
+ }
63
+
64
+ float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
65
+ vec3 lpv = normalize(lightPos - vertPos);
66
+ vec3 nln = minus_one_vec3 * lightNorm;
67
+ float spotCos = dot(nln, lpv);
68
+ return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
69
+ }
70
+
71
+ float lambertFactor(vec3 lightDir, vec3 vecNormal) {
72
+ return max(zero_float, dot(lightDir, vecNormal));
73
+ }
74
+
75
+ float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) {
76
+ vec3 np = normalize(vertPos);
77
+ vec3 ldp = normalize(lightDir - np);
78
+ return pow(max(zero_float, dot(ldp, vecNormal)), shine);
79
+ }
80
+
81
+ void main() {
82
+ // Vertex in clip coordinates
83
+ gl_Position = transformMatrix * position;
84
+
85
+ // Vertex in eye coordinates
86
+ vec3 ecVertex = vec3(modelviewMatrix * position);
87
+
88
+ // Normal vector in eye coordinates
89
+ vec3 ecNormal = normalize(normalMatrix * normal);
90
+ vec3 ecNormalInv = ecNormal * minus_one_vec3;
91
+
92
+ // Light calculations
93
+ vec3 totalAmbient = vec3(0, 0, 0);
94
+
95
+ vec3 totalFrontDiffuse = vec3(0, 0, 0);
96
+ vec3 totalFrontSpecular = vec3(0, 0, 0);
97
+
98
+ vec3 totalBackDiffuse = vec3(0, 0, 0);
99
+ vec3 totalBackSpecular = vec3(0, 0, 0);
100
+
101
+ // prevent register allocation failure by limiting ourselves to
102
+ // two lights for now
103
+ for (int i = 0; i < 2; i++) {
104
+ if (lightCount == i) break;
105
+
106
+ vec3 lightPos = lightPosition[i].xyz;
107
+ bool isDir = lightPosition[i].w < one_float;
108
+ float spotCos = lightSpot[i].x;
109
+ float spotExp = lightSpot[i].y;
110
+
111
+ vec3 lightDir;
112
+ float falloff;
113
+ float spotf;
114
+
115
+ if (isDir) {
116
+ falloff = one_float;
117
+ lightDir = minus_one_vec3 * lightNormal[i];
118
+ } else {
119
+ falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
120
+ lightDir = normalize(lightPos - ecVertex);
121
+ }
122
+
123
+ spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i],
124
+ spotCos, spotExp)
125
+ : one_float;
126
+
127
+ if (any(greaterThan(lightAmbient[i], zero_vec3))) {
128
+ totalAmbient += lightAmbient[i] * falloff;
129
+ }
130
+
131
+ if (any(greaterThan(lightDiffuse[i], zero_vec3))) {
132
+ totalFrontDiffuse += lightDiffuse[i] * falloff * spotf *
133
+ lambertFactor(lightDir, ecNormal);
134
+ totalBackDiffuse += lightDiffuse[i] * falloff * spotf *
135
+ lambertFactor(lightDir, ecNormalInv);
136
+ }
137
+
138
+ if (any(greaterThan(lightSpecular[i], zero_vec3))) {
139
+ totalFrontSpecular += lightSpecular[i] * falloff * spotf *
140
+ blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess);
141
+ totalBackSpecular += lightSpecular[i] * falloff * spotf *
142
+ blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess);
143
+ }
144
+ }
145
+
146
+ // Calculating final color as result of all lights (plus emissive term).
147
+ // Transparency is determined exclusively by the diffuse component.
148
+ vertColor = vec4(totalAmbient, 0) * ambient +
149
+ vec4(totalFrontDiffuse, 1) * color +
150
+ vec4(totalFrontSpecular, 0) * specular +
151
+ vec4(emissive.rgb, 0);
152
+
153
+ backVertColor = vec4(totalAmbient, 0) * ambient +
154
+ vec4(totalBackDiffuse, 1) * color +
155
+ vec4(totalBackSpecular, 0) * specular +
156
+ vec4(emissive.rgb, 0);
157
+
158
+ // Calculating texture coordinates, with r and q set both to one
159
+ vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
160
+ }
@@ -99,8 +99,8 @@ void main() {
99
99
  vec3 totalBackSpecular = vec3(0, 0, 0);
100
100
 
101
101
  // prevent register allocation failure by limiting ourselves to
102
- // two lights for now
103
- for (int i = 0; i < 2; i++) {
102
+ // four lights for now
103
+ for (int i = 0; i < 4; i++) {
104
104
  if (lightCount == i) break;
105
105
 
106
106
  vec3 lightPos = lightPosition[i].xyz;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: propane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.9.1
5
5
  platform: java
6
6
  authors:
7
7
  - monkstone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-23 00:00:00.000000000 Z
11
+ date: 2018-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,8 +58,7 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: 1.0.0
61
- description: " A batteries included version of processing in ruby, for MacOS and
62
- linux64.\n"
61
+ description: " A batteries included version of processing in ruby.\n"
63
62
  email:
64
63
  - mamba2928@yahoo.co.uk
65
64
  executables:
@@ -79,15 +78,19 @@ files:
79
78
  - README.md
80
79
  - Rakefile
81
80
  - bin/propane
81
+ - lib/.gitignore
82
82
  - lib/PROCESSING_LICENSE.txt
83
+ - lib/apple.jar
83
84
  - lib/export.txt
84
- - lib/gluegen-rt-2.3.2-natives-linux-amd64.jar
85
- - lib/gluegen-rt-2.3.2-natives-macosx-universal.jar
86
- - lib/gluegen-rt-2.3.2.jar
87
- - lib/jogl-all-2.3.2-natives-linux-amd64.jar
88
- - lib/jogl-all-2.3.2-natives-macosx-universal.jar
89
- - lib/jogl-all-2.3.2.jar
90
- - lib/propane-2.9.0.jar
85
+ - lib/gluegen-rt-natives-linux-amd64.jar
86
+ - lib/gluegen-rt-natives-macosx-universal.jar
87
+ - lib/gluegen-rt-natives-windows-amd64.jar
88
+ - lib/gluegen-rt.jar
89
+ - lib/jogl-all-natives-linux-amd64.jar
90
+ - lib/jogl-all-natives-macosx-universal.jar
91
+ - lib/jogl-all-natives-windows-amd64.jar
92
+ - lib/jogl-all.jar
93
+ - lib/propane-2.9.1.jar
91
94
  - lib/propane.rb
92
95
  - lib/propane/app.rb
93
96
  - lib/propane/creators/sketch_class.rb
@@ -163,6 +166,8 @@ files:
163
166
  - src/main/java/processing/core/PSurfaceNone.java
164
167
  - src/main/java/processing/core/PVector.java
165
168
  - src/main/java/processing/core/ThinkDifferent.java
169
+ - src/main/java/processing/data/DoubleDict.java
170
+ - src/main/java/processing/data/DoubleList.java
166
171
  - src/main/java/processing/data/FloatDict.java
167
172
  - src/main/java/processing/data/FloatList.java
168
173
  - src/main/java/processing/data/IntDict.java
@@ -170,6 +175,8 @@ files:
170
175
  - src/main/java/processing/data/JSONArray.java
171
176
  - src/main/java/processing/data/JSONObject.java
172
177
  - src/main/java/processing/data/JSONTokener.java
178
+ - src/main/java/processing/data/LongDict.java
179
+ - src/main/java/processing/data/LongList.java
173
180
  - src/main/java/processing/data/Sort.java
174
181
  - src/main/java/processing/data/StringDict.java
175
182
  - src/main/java/processing/data/StringList.java
@@ -206,6 +213,7 @@ files:
206
213
  - src/main/java/processing/opengl/shaders/ColorFrag.glsl
207
214
  - src/main/java/processing/opengl/shaders/ColorVert.glsl
208
215
  - src/main/java/processing/opengl/shaders/LightFrag.glsl
216
+ - src/main/java/processing/opengl/shaders/LightVert-brcm.glsl
209
217
  - src/main/java/processing/opengl/shaders/LightVert-vc4.glsl
210
218
  - src/main/java/processing/opengl/shaders/LightVert.glsl
211
219
  - src/main/java/processing/opengl/shaders/LineFrag.glsl
@@ -215,6 +223,7 @@ files:
215
223
  - src/main/java/processing/opengl/shaders/PointVert.glsl
216
224
  - src/main/java/processing/opengl/shaders/TexFrag.glsl
217
225
  - src/main/java/processing/opengl/shaders/TexLightFrag.glsl
226
+ - src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl
218
227
  - src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl
219
228
  - src/main/java/processing/opengl/shaders/TexLightVert.glsl
220
229
  - src/main/java/processing/opengl/shaders/TexVert.glsl
@@ -257,12 +266,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
266
  - !ruby/object:Gem::Version
258
267
  version: '0'
259
268
  requirements:
260
- - java runtime >= 1.8.0_171+
269
+ - java runtime >= 1.8.0_181+
261
270
  rubyforge_project:
262
271
  rubygems_version: 2.7.7
263
272
  signing_key:
264
273
  specification_version: 4
265
- summary: ruby wrapper for processing-3.4 on MacOS and linux64 bit only for opengl
274
+ summary: ruby wrapper for processing-3.4 on MacOS, linux and windows (64bit only)
266
275
  test_files:
267
276
  - test/create_test.rb
268
277
  - test/deglut_spec_test.rb