joonsrenderer 1.1.3-java → 1.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/.mvn/extensions.xml +1 -1
  3. data/.mvn/wrapper/maven-wrapper.properties +1 -0
  4. data/CHANGELOG.md +3 -1
  5. data/Rakefile +1 -1
  6. data/docs/Gemfile +2 -0
  7. data/docs/_config.yml +3 -0
  8. data/docs/_includes/header.html +1 -1
  9. data/docs/_includes/top.html +11 -0
  10. data/docs/_layouts/default.html +6 -15
  11. data/docs/about.md +2 -2
  12. data/joonsrenderer.gemspec +2 -2
  13. data/lib/joonsrenderer/version.rb +1 -1
  14. data/pom.rb +4 -4
  15. data/pom.xml +7 -7
  16. data/src/{test/java/a_maintest.java → a_maintest.java} +1 -1
  17. data/src/main/java/SunflowGUI.java +294 -352
  18. data/src/main/java/org/sunflow/AsciiFileSunflowAPI.java +1 -1
  19. data/src/main/java/org/sunflow/BinaryFileSunflowAPI.java +1 -1
  20. data/src/main/java/org/sunflow/SunflowAPI.java +2 -2
  21. data/src/main/java/org/sunflow/core/GIEngine.java +3 -1
  22. data/src/main/java/org/sunflow/core/ImageSampler.java +3 -0
  23. data/src/main/java/org/sunflow/core/InstanceList.java +1 -1
  24. data/src/main/java/org/sunflow/core/IntersectionState.java +7 -6
  25. data/src/main/java/org/sunflow/core/ParameterList.java +3 -2
  26. data/src/main/java/org/sunflow/core/PhotonStore.java +1 -0
  27. data/src/main/java/org/sunflow/core/Ray.java +4 -3
  28. data/src/main/java/org/sunflow/core/TextureCache.java +1 -1
  29. data/src/main/java/org/sunflow/core/accel/BoundingIntervalHierarchy.java +1 -1
  30. data/src/main/java/org/sunflow/core/photonmap/CausticPhotonMap.java +1 -1
  31. data/src/main/java/org/sunflow/core/renderer/BucketRenderer.java +3 -1
  32. data/src/main/java/org/sunflow/image/writers/EXRBitmapWriter.java +28 -19
  33. data/src/main/java/org/sunflow/image/writers/PNGBitmapWriter.java +5 -0
  34. data/src/main/java/org/sunflow/image/writers/TGABitmapWriter.java +20 -14
  35. data/src/main/java/org/sunflow/system/BenchmarkFramework.java +2 -2
  36. data/src/main/java/org/sunflow/system/RenderGlobalsPanel.java +5 -4
  37. metadata +9 -8
  38. data/docs/_includes/head.html +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 207d1626e7a46aca05cdbdb6415cd39bd8854bfe
4
- data.tar.gz: d841a52a78f552a0dab34978de74a73a56ddd666
2
+ SHA256:
3
+ metadata.gz: 1fa93288f40b9e667b896153787865cb7c0a0ab0356faa569e908be45da6b9a3
4
+ data.tar.gz: c73a86087de0ff6aa767225ef9298add60cd978e4a41316ba71716decd9569c2
5
5
  SHA512:
6
- metadata.gz: e7754ba84626828ee1cf49eea093ead428735e9cc5dfa45ff2320ee8991ccb9e3c417d9c54923799bbae4d72f14079075ff7c07cc6fad4367cb208be8a4201dd
7
- data.tar.gz: e6391ee2430f234c6247cda03dca2990e629e32ccd08dfd6e6cd06b4528600c129a56829c801efac7ae17dfbf56401ae46eb069e00298571f1a696b1ad2bd9c2
6
+ metadata.gz: 7c9bf9c4250a95ccc8c1b98a6705040c09e4c7978195b28c5e0f8693cd0f75784c2f48b28eacbf18c33bb05488c59aba0ddfeb81e89304545c4ef4313ec7abb1
7
+ data.tar.gz: 41d514fd0c33a784b04001240a93726b4503b595774141bf8822c54889a95f0514de594509b81142263c3bac974523a766f554a1911a76daab11110f6b99dd07
@@ -3,6 +3,6 @@
3
3
  <extension>
4
4
  <groupId>io.takari.polyglot</groupId>
5
5
  <artifactId>polyglot-ruby</artifactId>
6
- <version>0.1.19</version>
6
+ <version>0.4.0</version>
7
7
  </extension>
8
8
  </extensions>
@@ -0,0 +1 @@
1
+ distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
@@ -1,4 +1,6 @@
1
- **v1.1.3** Bump for processing-3.3.4
1
+ **v1.2.0** Bump for janino-3.0.12, plus some refactoring
2
+
3
+ **v1.1.3** Bump for processing-3.3.4
2
4
 
3
5
  **v1.1.2** Use sunflow.util.FloatList and IntList, netbeans profiling suggest it is worth doing (there is a vanilla processing alternative, with a different interface)
4
6
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ def create_manifest
6
6
  file = File.open('MANIFEST.MF', 'w') do |f|
7
7
  f.puts(title)
8
8
  f.puts(version)
9
- f.puts('Class-Path: janino-3.0.6.jar commons-compiler-3.0.6.jar')
9
+ f.puts('Class-Path: janino-3.0.12.jar commons-compiler-3.0.12.jar')
10
10
  end
11
11
  end
12
12
 
@@ -0,0 +1,2 @@
1
+ gem 'jekyll-feed'
2
+ gem 'jekyll-seo-tag'
@@ -18,3 +18,6 @@ syntax-highlighting:
18
18
  enabled: true
19
19
  # Build settings
20
20
  markdown: kramdown
21
+ gems:
22
+ - jekyll-feed
23
+ - jekyll-seo-tag
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div class="wrapper">
4
4
 
5
- <a class="site-title" href="{{ site.baseurl }}/">{{ site.title }}</a>
5
+ <a class="site-title" href="{{ site.github.url }}/{{ site.title }}"</a>
6
6
 
7
7
  <nav class="site-nav">
8
8
  <a href="#" class="menu-icon">
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE HTML>
2
+ <html lang="en-US">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta name="generator" content="Jekyll v{{ jekyll.version }}">
7
+ {% feed_meta %}
8
+ <link rel="stylesheet" href="/css/main.css">
9
+ <link rel="icon" type="image/x-icon" href="/favicon.ico">
10
+ {% seo %}
11
+ </head>
@@ -1,20 +1,11 @@
1
- <!DOCTYPE html>
2
- <html>
1
+ {% include top.html %}
3
2
 
4
- {% include head.html %}
3
+ <body class="wrap">
4
+ {% include header.html %}
5
5
 
6
- <body>
6
+ {{ content }}
7
7
 
8
- {% include header.html %}
9
-
10
- <div class="page-content">
11
- <div class="wrapper">
12
- {{ content }}
13
- </div>
14
- </div>
15
-
16
- {% include footer.html %}
17
-
18
- </body>
8
+ {% include footer.html %}
19
9
 
10
+ </body>
20
11
  </html>
@@ -3,9 +3,9 @@ layout: page
3
3
  title: About
4
4
  permalink: /about/
5
5
  ---
6
- JoonsRenderer is a library for Processing by [Joon Hyub Lee][joonhyublee]. It includes the sunflow java raytracer by [Christopher Kulla][fpsunflower], and the necessary janino compiler by [Arno Unkrig][Arno]. In this gem the JoonsLibrary and sunflower libraries are re-compiled (by Martin Prout) for java-8 and to use janino-3.0.6. The gem is designed to be used with [JRubyArt][jruby_art] or [propane][propane], all you need to do is `require 'joonsrenderer'` and `include_package 'joons'` to use the library.
6
+ JoonsRenderer is a library for Processing by [Joon Hyub Lee][joonhyublee]. It includes the sunflow java raytracer by [Christopher Kulla][fpsunflower], and the necessary janino compiler by [Arno Unkrig][Arno]. In this gem the JoonsLibrary and sunflower libraries are re-compiled (by Martin Prout) for java-8 and to use janino-3.0.12 The gem is designed to be used with [JRubyArt][jruby_art] or [propane][propane], all you need to do is `require 'joonsrenderer'` and `include_package 'joons'` to use the library.
7
7
 
8
- [joonhyublee]:https://joonhyublee/joons-renderer/wiki/
8
+ [joonhyublee]:https://github.com/joonhyublee/joons-renderer/wiki
9
9
  [fpsunflower]:https://github.com/fpsunflower/sunflow
10
10
  [Arno]:http://janino-compiler.github.io/janino/
11
11
  [propane]:https://ruby-processing.github.io/propane/
@@ -14,8 +14,8 @@ Gem::Specification.new do |gem|
14
14
  gem.homepage = 'https://ruby-processing.github.io/joonsrenderer/'
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.files << 'lib/joonsrenderer.jar'
17
- gem.files << 'lib/janino-3.0.6.jar'
18
- gem.files << 'lib/commons-compiler-3.0.6.jar'
17
+ gem.files << 'lib/janino-3.0.12.jar'
18
+ gem.files << 'lib/commons-compiler-3.0.12.jar'
19
19
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
20
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
21
  gem.require_paths = ['lib']
@@ -1,3 +1,3 @@
1
1
  module JoonsRenderer
2
- VERSION = '1.1.3'
2
+ VERSION = '1.2.0'
3
3
  end
data/pom.rb CHANGED
@@ -2,7 +2,7 @@ require 'fileutils'
2
2
  project 'joonsrenderer' do
3
3
 
4
4
  model_version '4.0.0'
5
- id 'joons:joonsrenderer:1.1.3'
5
+ id 'joons:joonsrenderer:1.2.0'
6
6
  packaging 'jar'
7
7
  description 'joonsrenderer for propane and JRubyArt'
8
8
  organization 'ruby-processing', 'https://ruby-processing.github.io'
@@ -21,9 +21,9 @@ project 'joonsrenderer' do
21
21
  'maven.compiler.source' => '1.8',
22
22
  'project.build.sourceEncoding' => 'utf-8',
23
23
  'maven.compiler.target' => '1.8',
24
- 'janino.version' => '3.0.6',
24
+ 'janino.version' => '3.0.12',
25
25
  'jogl.version' => '2.3.2',
26
- 'processing.version' => '3.3.4'
26
+ 'processing.version' => '3.3.7'
27
27
  )
28
28
 
29
29
  jar 'org.processing:core:${processing.version}'
@@ -53,7 +53,7 @@ project 'joonsrenderer' do
53
53
  )
54
54
  end
55
55
 
56
- plugin( :compiler, '3.6.0',
56
+ plugin( :compiler, '3.8.0',
57
57
  source: '${maven.compiler.source}',
58
58
  target: '${maven.compiler.target}'
59
59
  )
data/pom.xml CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
11
11
  <modelVersion>4.0.0</modelVersion>
12
12
  <groupId>joons</groupId>
13
13
  <artifactId>joonsrenderer</artifactId>
14
- <version>1.1.3</version>
14
+ <version>1.2.0</version>
15
15
  <name>joonsrenderer</name>
16
16
  <description>joonsrenderer for propane and JRubyArt</description>
17
17
  <organization>
@@ -59,15 +59,15 @@ DO NOT MODIFIY - GENERATED CODE
59
59
  <url>https://github.com/monkstone/joonsrenderer/issues</url>
60
60
  </issueManagement>
61
61
  <properties>
62
+ <janino.version>3.0.12</janino.version>
62
63
  <jogl.version>2.3.2</jogl.version>
63
- <source.directory>src</source.directory>
64
64
  <joonsrenderer.basedir>${project.basedir}</joonsrenderer.basedir>
65
+ <maven.compiler.source>1.8</maven.compiler.source>
65
66
  <maven.compiler.target>1.8</maven.compiler.target>
66
- <processing.version>3.3.4</processing.version>
67
- <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
68
- <janino.version>3.0.6</janino.version>
69
67
  <polyglot.dump.pom>pom.xml</polyglot.dump.pom>
70
- <maven.compiler.source>1.8</maven.compiler.source>
68
+ <processing.version>3.3.7</processing.version>
69
+ <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
70
+ <source.directory>src</source.directory>
71
71
  </properties>
72
72
  <dependencies>
73
73
  <dependency>
@@ -135,7 +135,7 @@ DO NOT MODIFIY - GENERATED CODE
135
135
  </plugin>
136
136
  <plugin>
137
137
  <artifactId>maven-compiler-plugin</artifactId>
138
- <version>3.6.0</version>
138
+ <version>3.8.0</version>
139
139
  <configuration>
140
140
  <source>${maven.compiler.source}</source>
141
141
  <target>${maven.compiler.target}</target>
@@ -1,7 +1,7 @@
1
1
  import processing.core.PApplet;
2
2
  import joons.JoonsRenderer;
3
3
 
4
- @SuppressWarnings("serial")
4
+
5
5
  public class a_maintest extends PApplet {
6
6
 
7
7
  JoonsRenderer jr;
@@ -1,12 +1,11 @@
1
-
2
1
  import java.awt.BorderLayout;
3
2
  import java.awt.Dimension;
4
3
  import java.awt.FlowLayout;
5
4
  import java.awt.Toolkit;
6
5
  import java.awt.datatransfer.DataFlavor;
7
6
  import java.awt.datatransfer.Transferable;
7
+ import java.awt.datatransfer.UnsupportedFlavorException;
8
8
  import java.awt.event.ActionEvent;
9
- import java.awt.event.ActionListener;
10
9
  import java.beans.PropertyVetoException;
11
10
  import java.io.BufferedReader;
12
11
  import java.io.File;
@@ -40,6 +39,7 @@ import javax.swing.SwingUtilities;
40
39
  import javax.swing.TransferHandler;
41
40
  import javax.swing.UIManager;
42
41
  import javax.swing.UIManager.LookAndFeelInfo;
42
+ import javax.swing.UnsupportedLookAndFeelException;
43
43
  import javax.swing.filechooser.FileFilter;
44
44
  import javax.swing.plaf.metal.DefaultMetalTheme;
45
45
  import javax.swing.plaf.metal.MetalLookAndFeel;
@@ -198,196 +198,216 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
198
198
  String translateFilename = null;
199
199
  int frameStart = 1, frameStop = 1;
200
200
  while (i < args.length) {
201
- if (args[i].equals("-o")) {
202
- if (i > args.length - 2) {
203
- usage(false);
204
- }
205
- filename = args[i + 1];
206
- i += 2;
207
- } else if (args[i].equals("-nogui")) {
208
- showFrame = false;
209
- i++;
210
- } else if (args[i].equals("-ipr")) {
211
- sampler = "ipr";
212
- i++;
213
- } else if (args[i].equals("-threads")) {
214
- if (i > args.length - 2) {
215
- usage(false);
216
- }
217
- threads = Integer.parseInt(args[i + 1]);
218
- i += 2;
219
- } else if (args[i].equals("-lopri")) {
220
- lowPriority = true;
221
- i++;
222
- } else if (args[i].equals("-hipri")) {
223
- lowPriority = false;
224
- i++;
225
- } else if (args[i].equals("-sampler")) {
226
- if (i > args.length - 2) {
227
- usage(false);
228
- }
229
- sampler = args[i + 1];
230
- i += 2;
231
- } else if (args[i].equals("-smallmesh")) {
232
- TriangleMesh.setSmallTriangles(true);
233
- i++;
234
- } else if (args[i].equals("-dumpkd")) {
235
- KDTree.setDumpMode(true, "kdtree");
236
- i++;
237
- } else if (args[i].equals("-buildonly")) {
238
- noRender = true;
239
- i++;
240
- } else if (args[i].equals("-showaa")) {
241
- showAA = true;
242
- i++;
243
- } else if (args[i].equals("-nogi")) {
244
- noGI = true;
245
- i++;
246
- } else if (args[i].equals("-nocaustics")) {
247
- noCaustics = true;
248
- i++;
249
- } else if (args[i].equals("-pathgi")) {
250
- if (i > args.length - 2) {
251
- usage(false);
252
- }
253
- pathGI = Integer.parseInt(args[i + 1]);
254
- i += 2;
255
- } else if (args[i].equals("-quick_ambocc")) {
256
- if (i > args.length - 2) {
257
- usage(false);
258
- }
259
- maxDist = Float.parseFloat(args[i + 1]);
260
- shaderOverride = "ambient_occlusion"; // new
261
- // AmbientOcclusionShader(Color.WHITE,
262
- // d);
263
- i += 2;
264
- } else if (args[i].equals("-quick_uvs")) {
265
- if (i > args.length - 1) {
266
- usage(false);
267
- }
268
- shaderOverride = "show_uvs";
269
- i++;
270
- } else if (args[i].equals("-quick_normals")) {
271
- if (i > args.length - 1) {
272
- usage(false);
273
- }
274
- shaderOverride = "show_normals";
275
- i++;
276
- } else if (args[i].equals("-quick_id")) {
277
- if (i > args.length - 1) {
278
- usage(false);
279
- }
280
- shaderOverride = "show_instance_id";
281
- i++;
282
- } else if (args[i].equals("-quick_prims")) {
283
- if (i > args.length - 1) {
284
- usage(false);
285
- }
286
- shaderOverride = "show_primitive_id";
287
- i++;
288
- } else if (args[i].equals("-quick_gray")) {
289
- if (i > args.length - 1) {
290
- usage(false);
291
- }
292
- shaderOverride = "quick_gray";
293
- i++;
294
- } else if (args[i].equals("-quick_wire")) {
295
- if (i > args.length - 1) {
296
- usage(false);
297
- }
298
- shaderOverride = "wireframe";
299
- i++;
300
- } else if (args[i].equals("-resolution")) {
301
- if (i > args.length - 3) {
302
- usage(false);
303
- }
304
- resolutionW = Integer.parseInt(args[i + 1]);
305
- resolutionH = Integer.parseInt(args[i + 2]);
306
- i += 3;
307
- } else if (args[i].equals("-aa")) {
308
- if (i > args.length - 3) {
309
- usage(false);
310
- }
311
- aaMin = Integer.parseInt(args[i + 1]);
312
- aaMax = Integer.parseInt(args[i + 2]);
313
- i += 3;
314
- } else if (args[i].equals("-samples")) {
315
- if (i > args.length - 2) {
316
- usage(false);
317
- }
318
- samples = Integer.parseInt(args[i + 1]);
319
- i += 2;
320
- } else if (args[i].equals("-bucket")) {
321
- if (i > args.length - 3) {
322
- usage(false);
323
- }
324
- bucketSize = Integer.parseInt(args[i + 1]);
325
- bucketOrder = args[i + 2];
326
- i += 3;
327
- } else if (args[i].equals("-bake")) {
328
- if (i > args.length - 2) {
329
- usage(false);
330
- }
331
- bakingName = args[i + 1];
332
- i += 2;
333
- } else if (args[i].equals("-bakedir")) {
334
- if (i > args.length - 2) {
335
- usage(false);
336
- }
337
- String baketype = args[i + 1];
338
- if (baketype.equals("view")) {
339
- bakeViewdep = true;
340
- } else if (baketype.equals("ortho")) {
341
- bakeViewdep = false;
342
- } else {
343
- usage(false);
344
- }
345
- i += 2;
346
- } else if (args[i].equals("-filter")) {
347
- if (i > args.length - 2) {
348
- usage(false);
349
- }
350
- filterType = args[i + 1];
351
- i += 2;
352
- } else if (args[i].equals("-bench")) {
353
- runBenchmark = true;
354
- i++;
355
- } else if (args[i].equals("-rtbench")) {
356
- runRTBenchmark = true;
357
- i++;
358
- } else if (args[i].equals("-frame")) {
359
- if (i > args.length - 2) {
360
- usage(false);
361
- }
362
- frameStart = frameStop = Integer.parseInt(args[i + 1]);
363
- i += 2;
364
- } else if (args[i].equals("-anim")) {
365
- if (i > args.length - 3) {
366
- usage(false);
367
- }
368
- frameStart = Integer.parseInt(args[i + 1]);
369
- frameStop = Integer.parseInt(args[i + 2]);
370
- i += 3;
371
- } else if (args[i].equals("-v")) {
372
- if (i > args.length - 2) {
373
- usage(false);
374
- }
375
- UI.verbosity(Integer.parseInt(args[i + 1]));
376
- i += 2;
377
- } else if (args[i].equals("-translate")) {
378
- if (i > args.length - 2) {
379
- usage(false);
380
- }
381
- translateFilename = args[i + 1];
382
- i += 2;
383
- } else if (args[i].equals("-h") || args[i].equals("-help")) {
384
- usage(true);
385
- } else {
386
- if (input != null) {
387
- usage(false);
201
+ switch (args[i]) {
202
+ case "-o":
203
+ if (i > args.length - 2) {
204
+ usage(false);
205
+ } filename = args[i + 1];
206
+ i += 2;
207
+ break;
208
+ case "-nogui":
209
+ showFrame = false;
210
+ i++;
211
+ break;
212
+ case "-ipr":
213
+ sampler = "ipr";
214
+ i++;
215
+ break;
216
+ case "-threads":
217
+ if (i > args.length - 2) {
218
+ usage(false);
219
+ } threads = Integer.parseInt(args[i + 1]);
220
+ i += 2;
221
+ break;
222
+ case "-lopri":
223
+ lowPriority = true;
224
+ i++;
225
+ break;
226
+ case "-hipri":
227
+ lowPriority = false;
228
+ i++;
229
+ break;
230
+ case "-sampler":
231
+ if (i > args.length - 2) {
232
+ usage(false);
233
+ } sampler = args[i + 1];
234
+ i += 2;
235
+ break;
236
+ case "-smallmesh":
237
+ TriangleMesh.setSmallTriangles(true);
238
+ i++;
239
+ break;
240
+ case "-dumpkd":
241
+ KDTree.setDumpMode(true, "kdtree");
242
+ i++;
243
+ break;
244
+ case "-buildonly":
245
+ noRender = true;
246
+ i++;
247
+ break;
248
+ case "-showaa":
249
+ showAA = true;
250
+ i++;
251
+ break;
252
+ case "-nogi":
253
+ noGI = true;
254
+ i++;
255
+ break;
256
+ case "-nocaustics":
257
+ noCaustics = true;
258
+ i++;
259
+ break;
260
+ case "-pathgi":
261
+ if (i > args.length - 2) {
262
+ usage(false);
263
+ } pathGI = Integer.parseInt(args[i + 1]);
264
+ i += 2;
265
+ break;
266
+ case "-quick_ambocc":
267
+ if (i > args.length - 2) {
268
+ usage(false);
269
+ } maxDist = Float.parseFloat(args[i + 1]);
270
+ shaderOverride = "ambient_occlusion"; // new
271
+ // AmbientOcclusionShader(Color.WHITE,
272
+ // d);
273
+ i += 2;
274
+ break;
275
+ case "-quick_uvs":
276
+ if (i > args.length - 1) {
277
+ usage(false);
278
+ } shaderOverride = "show_uvs";
279
+ i++;
280
+ break;
281
+ case "-quick_normals":
282
+ if (i > args.length - 1) {
283
+ usage(false);
284
+ } shaderOverride = "show_normals";
285
+ i++;
286
+ break;
287
+ case "-quick_id":
288
+ if (i > args.length - 1) {
289
+ usage(false);
290
+ } shaderOverride = "show_instance_id";
291
+ i++;
292
+ break;
293
+ case "-quick_prims":
294
+ if (i > args.length - 1) {
295
+ usage(false);
296
+ } shaderOverride = "show_primitive_id";
297
+ i++;
298
+ break;
299
+ case "-quick_gray":
300
+ if (i > args.length - 1) {
301
+ usage(false);
302
+ } shaderOverride = "quick_gray";
303
+ i++;
304
+ break;
305
+ case "-quick_wire":
306
+ if (i > args.length - 1) {
307
+ usage(false);
308
+ } shaderOverride = "wireframe";
309
+ i++;
310
+ break;
311
+ case "-resolution":
312
+ if (i > args.length - 3) {
313
+ usage(false);
314
+ } resolutionW = Integer.parseInt(args[i + 1]);
315
+ resolutionH = Integer.parseInt(args[i + 2]);
316
+ i += 3;
317
+ break;
318
+ case "-aa":
319
+ if (i > args.length - 3) {
320
+ usage(false);
321
+ } aaMin = Integer.parseInt(args[i + 1]);
322
+ aaMax = Integer.parseInt(args[i + 2]);
323
+ i += 3;
324
+ break;
325
+ case "-samples":
326
+ if (i > args.length - 2) {
327
+ usage(false);
328
+ } samples = Integer.parseInt(args[i + 1]);
329
+ i += 2;
330
+ break;
331
+ case "-bucket":
332
+ if (i > args.length - 3) {
333
+ usage(false);
334
+ } bucketSize = Integer.parseInt(args[i + 1]);
335
+ bucketOrder = args[i + 2];
336
+ i += 3;
337
+ break;
338
+ case "-bake":
339
+ if (i > args.length - 2) {
340
+ usage(false);
341
+ } bakingName = args[i + 1];
342
+ i += 2;
343
+ break;
344
+ case "-bakedir":
345
+ if (i > args.length - 2) {
346
+ usage(false);
347
+ } String baketype = args[i + 1];
348
+ switch (baketype) {
349
+ case "view":
350
+ bakeViewdep = true;
351
+ break;
352
+ case "ortho":
353
+ bakeViewdep = false;
354
+ break;
355
+ default:
356
+ usage(false);
357
+ break;
388
358
  }
389
- input = args[i];
390
- i++;
359
+ i += 2;
360
+ break;
361
+
362
+ case "-filter":
363
+ if (i > args.length - 2) {
364
+ usage(false);
365
+ } filterType = args[i + 1];
366
+ i += 2;
367
+ break;
368
+ case "-bench":
369
+ runBenchmark = true;
370
+ i++;
371
+ break;
372
+ case "-rtbench":
373
+ runRTBenchmark = true;
374
+ i++;
375
+ break;
376
+ case "-frame":
377
+ if (i > args.length - 2) {
378
+ usage(false);
379
+ } frameStart = frameStop = Integer.parseInt(args[i + 1]);
380
+ i += 2;
381
+ break;
382
+ case "-anim":
383
+ if (i > args.length - 3) {
384
+ usage(false);
385
+ } frameStart = Integer.parseInt(args[i + 1]);
386
+ frameStop = Integer.parseInt(args[i + 2]);
387
+ i += 3;
388
+ break;
389
+ case "-v":
390
+ if (i > args.length - 2) {
391
+ usage(false);
392
+ } UI.verbosity(Integer.parseInt(args[i + 1]));
393
+ i += 2;
394
+ break;
395
+ case "-translate":
396
+ if (i > args.length - 2) {
397
+ usage(false);
398
+ } translateFilename = args[i + 1];
399
+ i += 2;
400
+ break;
401
+ case "-h":
402
+ case "-help":
403
+ usage(true);
404
+ break;
405
+ default:
406
+ if (input != null) {
407
+ usage(false);
408
+ } input = args[i];
409
+ i++;
410
+ break;
391
411
  }
392
412
  }
393
413
  if (runBenchmark) {
@@ -495,7 +515,7 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
495
515
  break;
496
516
  }
497
517
  }
498
- } catch (Exception e) {
518
+ } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException e) {
499
519
  // If Nimbus is not available, you can set the GUI to another look and feel.
500
520
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
501
521
  }
@@ -548,22 +568,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
548
568
  renderButton = new JButton();
549
569
  jPanel1.add(renderButton);
550
570
  renderButton.setText("Render");
551
- renderButton.addActionListener(new ActionListener() {
552
- @Override
553
- public void actionPerformed(ActionEvent evt) {
554
- renderMenuItemActionPerformed(evt);
555
- }
571
+ renderButton.addActionListener((ActionEvent evt) -> {
572
+ renderMenuItemActionPerformed(evt);
556
573
  });
557
574
  }
558
575
  {
559
576
  iprButton = new JButton();
560
577
  jPanel1.add(iprButton);
561
578
  iprButton.setText("IPR");
562
- iprButton.addActionListener(new ActionListener() {
563
- @Override
564
- public void actionPerformed(ActionEvent evt) {
565
- iprMenuItemActionPerformed(evt);
566
- }
579
+ iprButton.addActionListener((ActionEvent evt) -> {
580
+ iprMenuItemActionPerformed(evt);
567
581
  });
568
582
  }
569
583
  }
@@ -608,11 +622,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
608
622
  buildButton = new JButton();
609
623
  jPanel3.add(buildButton);
610
624
  buildButton.setText("Build Scene");
611
- buildButton.addActionListener(new ActionListener() {
612
- @Override
613
- public void actionPerformed(ActionEvent evt) {
614
- buildMenuItemActionPerformed(evt);
615
- }
625
+ buildButton.addActionListener((ActionEvent evt) -> {
626
+ buildMenuItemActionPerformed(evt);
616
627
  });
617
628
  }
618
629
  }
@@ -669,22 +680,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
669
680
  jPanel5.add(taskCancelButton);
670
681
  taskCancelButton.setText("Cancel");
671
682
  taskCancelButton.setEnabled(false);
672
- taskCancelButton.addActionListener(new ActionListener() {
673
- @Override
674
- public void actionPerformed(ActionEvent evt) {
675
- UI.taskCancel();
676
- }
683
+ taskCancelButton.addActionListener((ActionEvent evt) -> {
684
+ UI.taskCancel();
677
685
  });
678
686
  }
679
687
  {
680
688
  clearConsoleButton = new JButton();
681
689
  jPanel5.add(clearConsoleButton);
682
690
  clearConsoleButton.setText("Clear");
683
- clearConsoleButton.addActionListener(new ActionListener() {
684
- @Override
685
- public void actionPerformed(ActionEvent evt) {
686
- clearConsole();
687
- }
691
+ clearConsoleButton.addActionListener((ActionEvent evt) -> {
692
+ clearConsole();
688
693
  });
689
694
  }
690
695
  }
@@ -705,11 +710,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
705
710
  fileMenu.add(newFileMenuItem);
706
711
  newFileMenuItem.setText("New");
707
712
  newFileMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl N"));
708
- newFileMenuItem.addActionListener(new ActionListener() {
709
- @Override
710
- public void actionPerformed(ActionEvent evt) {
711
- newFileMenuItemActionPerformed(evt);
712
- }
713
+ newFileMenuItem.addActionListener((ActionEvent evt) -> {
714
+ newFileMenuItemActionPerformed(evt);
713
715
  });
714
716
  }
715
717
  {
@@ -717,11 +719,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
717
719
  fileMenu.add(openFileMenuItem);
718
720
  openFileMenuItem.setText("Open ...");
719
721
  openFileMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl O"));
720
- openFileMenuItem.addActionListener(new ActionListener() {
721
- @Override
722
- public void actionPerformed(ActionEvent evt) {
723
- openFileMenuItemActionPerformed(evt);
724
- }
722
+ openFileMenuItem.addActionListener((ActionEvent evt) -> {
723
+ openFileMenuItemActionPerformed(evt);
725
724
  });
726
725
  }
727
726
  {
@@ -729,22 +728,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
729
728
  fileMenu.add(saveMenuItem);
730
729
  saveMenuItem.setText("Save");
731
730
  saveMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl S"));
732
- saveMenuItem.addActionListener(new ActionListener() {
733
- @Override
734
- public void actionPerformed(ActionEvent evt) {
735
- saveCurrentFile(currentFile);
736
- }
731
+ saveMenuItem.addActionListener((ActionEvent evt) -> {
732
+ saveCurrentFile(currentFile);
737
733
  });
738
734
  }
739
735
  {
740
736
  saveAsMenuItem = new JMenuItem();
741
737
  fileMenu.add(saveAsMenuItem);
742
738
  saveAsMenuItem.setText("Save As ...");
743
- saveAsMenuItem.addActionListener(new ActionListener() {
744
- @Override
745
- public void actionPerformed(ActionEvent evt) {
746
- saveAsMenuItemActionPerformed(evt);
747
- }
739
+ saveAsMenuItem.addActionListener((ActionEvent evt) -> {
740
+ saveAsMenuItemActionPerformed(evt);
748
741
  });
749
742
  }
750
743
  {
@@ -755,11 +748,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
755
748
  exitMenuItem = new JMenuItem();
756
749
  fileMenu.add(exitMenuItem);
757
750
  exitMenuItem.setText("Exit");
758
- exitMenuItem.addActionListener(new ActionListener() {
759
- @Override
760
- public void actionPerformed(ActionEvent evt) {
761
- System.exit(0);
762
- }
751
+ exitMenuItem.addActionListener((ActionEvent evt) -> {
752
+ System.exit(0);
763
753
  });
764
754
  }
765
755
  }
@@ -772,12 +762,9 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
772
762
  sceneMenu.add(buildMenuItem);
773
763
  buildMenuItem.setText("Build");
774
764
  buildMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl B"));
775
- buildMenuItem.addActionListener(new ActionListener() {
776
- @Override
777
- public void actionPerformed(ActionEvent evt) {
778
- if (sceneMenu.isEnabled()) {
779
- buildMenuItemActionPerformed(evt);
780
- }
765
+ buildMenuItem.addActionListener((ActionEvent evt) -> {
766
+ if (sceneMenu.isEnabled()) {
767
+ buildMenuItemActionPerformed(evt);
781
768
  }
782
769
  });
783
770
  }
@@ -795,22 +782,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
795
782
  renderMenuItem = new JMenuItem();
796
783
  sceneMenu.add(renderMenuItem);
797
784
  renderMenuItem.setText("Render");
798
- renderMenuItem.addActionListener(new ActionListener() {
799
- @Override
800
- public void actionPerformed(ActionEvent evt) {
801
- renderMenuItemActionPerformed(evt);
802
- }
785
+ renderMenuItem.addActionListener((ActionEvent evt) -> {
786
+ renderMenuItemActionPerformed(evt);
803
787
  });
804
788
  }
805
789
  {
806
790
  iprMenuItem = new JMenuItem();
807
791
  sceneMenu.add(iprMenuItem);
808
792
  iprMenuItem.setText("IPR");
809
- iprMenuItem.addActionListener(new ActionListener() {
810
- @Override
811
- public void actionPerformed(ActionEvent evt) {
812
- iprMenuItemActionPerformed(evt);
813
- }
793
+ iprMenuItem.addActionListener((ActionEvent evt) -> {
794
+ iprMenuItemActionPerformed(evt);
814
795
  });
815
796
  }
816
797
  {
@@ -828,11 +809,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
828
809
  textureCacheClearMenuItem = new JMenuItem();
829
810
  sceneMenu.add(textureCacheClearMenuItem);
830
811
  textureCacheClearMenuItem.setText("Clear Texture Cache");
831
- textureCacheClearMenuItem.addActionListener(new ActionListener() {
832
- @Override
833
- public void actionPerformed(ActionEvent evt) {
834
- textureCacheClearMenuItemActionPerformed(evt);
835
- }
812
+ textureCacheClearMenuItem.addActionListener((ActionEvent evt) -> {
813
+ textureCacheClearMenuItemActionPerformed(evt);
836
814
  });
837
815
  }
838
816
  {
@@ -840,11 +818,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
840
818
  sceneMenu.add(smallTrianglesMenuItem);
841
819
  smallTrianglesMenuItem.setText("Low Mem Triangles");
842
820
  smallTrianglesMenuItem.setToolTipText("Load future meshes using a low memory footprint triangle representation");
843
- smallTrianglesMenuItem.addActionListener(new ActionListener() {
844
- @Override
845
- public void actionPerformed(ActionEvent evt) {
846
- smallTrianglesMenuItemActionPerformed(evt);
847
- }
821
+ smallTrianglesMenuItem.addActionListener((ActionEvent evt) -> {
822
+ smallTrianglesMenuItemActionPerformed(evt);
848
823
  });
849
824
  }
850
825
  }
@@ -856,22 +831,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
856
831
  resetZoomMenuItem = new JMenuItem();
857
832
  imageMenu.add(resetZoomMenuItem);
858
833
  resetZoomMenuItem.setText("Reset Zoom");
859
- resetZoomMenuItem.addActionListener(new ActionListener() {
860
- @Override
861
- public void actionPerformed(ActionEvent evt) {
862
- imagePanel.reset();
863
- }
834
+ resetZoomMenuItem.addActionListener((ActionEvent evt) -> {
835
+ imagePanel.reset();
864
836
  });
865
837
  }
866
838
  {
867
839
  fitWindowMenuItem = new JMenuItem();
868
840
  imageMenu.add(fitWindowMenuItem);
869
841
  fitWindowMenuItem.setText("Fit to Window");
870
- fitWindowMenuItem.addActionListener(new ActionListener() {
871
- @Override
872
- public void actionPerformed(ActionEvent evt) {
873
- imagePanel.fit();
874
- }
842
+ fitWindowMenuItem.addActionListener((ActionEvent evt) -> {
843
+ imagePanel.fit();
875
844
  });
876
845
  }
877
846
  {
@@ -882,26 +851,23 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
882
851
  jMenuItem4 = new JMenuItem();
883
852
  imageMenu.add(jMenuItem4);
884
853
  jMenuItem4.setText("Save Image ...");
885
- jMenuItem4.addActionListener(new ActionListener() {
886
- @Override
887
- public void actionPerformed(ActionEvent evt) {
888
- // imagePanel.image;
889
- JFileChooser fc = new JFileChooser(".");
890
- fc.setFileFilter(new FileFilter() {
891
- @Override
892
- public String getDescription() {
893
- return "Image File";
894
- }
895
-
896
- @Override
897
- public boolean accept(File f) {
898
- return (f.isDirectory() || f.getName().endsWith(".png") || f.getName().endsWith(".tga"));
899
- }
900
- });
901
- if (fc.showSaveDialog(SunflowGUI.this) == JFileChooser.APPROVE_OPTION) {
902
- String filename = fc.getSelectedFile().getAbsolutePath();
903
- imagePanel.save(filename);
854
+ jMenuItem4.addActionListener((ActionEvent evt) -> {
855
+ // imagePanel.image;
856
+ JFileChooser fc = new JFileChooser(".");
857
+ fc.setFileFilter(new FileFilter() {
858
+ @Override
859
+ public String getDescription() {
860
+ return "Image File";
904
861
  }
862
+
863
+ @Override
864
+ public boolean accept(File f) {
865
+ return (f.isDirectory() || f.getName().endsWith(".png") || f.getName().endsWith(".tga"));
866
+ }
867
+ });
868
+ if (fc.showSaveDialog(SunflowGUI.this) == JFileChooser.APPROVE_OPTION) {
869
+ String filename = fc.getSelectedFile().getAbsolutePath();
870
+ imagePanel.save(filename);
905
871
  }
906
872
  });
907
873
  }
@@ -916,11 +882,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
916
882
  windowMenu.add(imageWindowMenuItem);
917
883
  imageWindowMenuItem.setText("Image");
918
884
  imageWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl 1"));
919
- imageWindowMenuItem.addActionListener(new ActionListener() {
920
- @Override
921
- public void actionPerformed(ActionEvent evt) {
922
- selectFrame(imagePanelFrame);
923
- }
885
+ imageWindowMenuItem.addActionListener((ActionEvent evt) -> {
886
+ selectFrame(imagePanelFrame);
924
887
  });
925
888
  }
926
889
  {
@@ -928,11 +891,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
928
891
  windowMenu.add(editorWindowMenuItem);
929
892
  editorWindowMenuItem.setText("Script Editor");
930
893
  editorWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl 2"));
931
- editorWindowMenuItem.addActionListener(new ActionListener() {
932
- @Override
933
- public void actionPerformed(ActionEvent evt) {
934
- selectFrame(editorFrame);
935
- }
894
+ editorWindowMenuItem.addActionListener((ActionEvent evt) -> {
895
+ selectFrame(editorFrame);
936
896
  });
937
897
  }
938
898
  {
@@ -940,11 +900,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
940
900
  windowMenu.add(consoleWindowMenuItem);
941
901
  consoleWindowMenuItem.setText("Console");
942
902
  consoleWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl 3"));
943
- consoleWindowMenuItem.addActionListener(new ActionListener() {
944
- @Override
945
- public void actionPerformed(ActionEvent evt) {
946
- selectFrame(consoleFrame);
947
- }
903
+ consoleWindowMenuItem.addActionListener((ActionEvent evt) -> {
904
+ selectFrame(consoleFrame);
948
905
  });
949
906
  }
950
907
  {
@@ -956,11 +913,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
956
913
  windowMenu.add(tileWindowMenuItem);
957
914
  tileWindowMenuItem.setText("Tile");
958
915
  tileWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl T"));
959
- tileWindowMenuItem.addActionListener(new ActionListener() {
960
- @Override
961
- public void actionPerformed(ActionEvent evt) {
962
- tileWindowMenuItemActionPerformed(evt);
963
- }
916
+ tileWindowMenuItem.addActionListener((ActionEvent evt) -> {
917
+ tileWindowMenuItemActionPerformed(evt);
964
918
  });
965
919
  }
966
920
  }
@@ -1045,11 +999,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
1045
999
  }
1046
1000
 
1047
1001
  private void println(final String s) {
1048
- SwingUtilities.invokeLater(new Runnable() {
1049
- @Override
1050
- public void run() {
1051
- consoleTextArea.append(s + "\n");
1052
- }
1002
+ SwingUtilities.invokeLater(() -> {
1003
+ consoleTextArea.append(s + "\n");
1053
1004
  });
1054
1005
  }
1055
1006
 
@@ -1079,16 +1030,13 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
1079
1030
  currentTaskLastP = -1;
1080
1031
  final int taskMin = min;
1081
1032
  final int taskMax = max;
1082
- SwingUtilities.invokeLater(new Runnable() {
1083
- @Override
1084
- public void run() {
1085
- taskProgressBar.setEnabled(true);
1086
- taskCancelButton.setEnabled(true);
1087
- taskProgressBar.setMinimum(taskMin);
1088
- taskProgressBar.setMaximum(taskMax);
1089
- taskProgressBar.setValue(taskMin);
1090
- taskProgressBar.setString(currentTask);
1091
- }
1033
+ SwingUtilities.invokeLater(() -> {
1034
+ taskProgressBar.setEnabled(true);
1035
+ taskCancelButton.setEnabled(true);
1036
+ taskProgressBar.setMinimum(taskMin);
1037
+ taskProgressBar.setMaximum(taskMax);
1038
+ taskProgressBar.setValue(taskMin);
1039
+ taskProgressBar.setString(currentTask);
1092
1040
  });
1093
1041
  }
1094
1042
 
@@ -1096,29 +1044,23 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
1096
1044
  public void taskUpdate(int current) {
1097
1045
  final int taskCurrent = current;
1098
1046
  final String taskString = currentTask;
1099
- SwingUtilities.invokeLater(new Runnable() {
1100
- @Override
1101
- public void run() {
1102
- taskProgressBar.setValue(taskCurrent);
1103
- int p = (int) (100.0 * taskProgressBar.getPercentComplete());
1104
- if (p > currentTaskLastP) {
1105
- taskProgressBar.setString(taskString + " [" + p + "%]");
1106
- currentTaskLastP = p;
1107
- }
1047
+ SwingUtilities.invokeLater(() -> {
1048
+ taskProgressBar.setValue(taskCurrent);
1049
+ int p = (int) (100.0 * taskProgressBar.getPercentComplete());
1050
+ if (p > currentTaskLastP) {
1051
+ taskProgressBar.setString(taskString + " [" + p + "%]");
1052
+ currentTaskLastP = p;
1108
1053
  }
1109
1054
  });
1110
1055
  }
1111
1056
 
1112
1057
  @Override
1113
1058
  public void taskStop() {
1114
- SwingUtilities.invokeLater(new Runnable() {
1115
- @Override
1116
- public void run() {
1117
- taskProgressBar.setValue(taskProgressBar.getMinimum());
1118
- taskProgressBar.setString("");
1119
- taskProgressBar.setEnabled(false);
1120
- taskCancelButton.setEnabled(false);
1121
- }
1059
+ SwingUtilities.invokeLater(() -> {
1060
+ taskProgressBar.setValue(taskProgressBar.getMinimum());
1061
+ taskProgressBar.setString("");
1062
+ taskProgressBar.setEnabled(false);
1063
+ taskCancelButton.setEnabled(false);
1122
1064
  });
1123
1065
  }
1124
1066
 
@@ -1330,7 +1272,7 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
1330
1272
  break;
1331
1273
  }
1332
1274
  }
1333
- } catch (Exception exp) {
1275
+ } catch (UnsupportedFlavorException | IOException exp) {
1334
1276
  Logger.getLogger(SunflowGUI.class.getName()).log(Level.SEVERE, null, exp);
1335
1277
  }
1336
1278
 
@@ -1341,8 +1283,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
1341
1283
  public boolean canImport(JComponent c, DataFlavor[] flavors) {
1342
1284
  // Just a quick check to see if a file can be accepted at this time
1343
1285
  // Are there any files around?
1344
- for (int i = 0; i < flavors.length; i++) {
1345
- if (flavors[i].isFlavorJavaFileListType()) {
1286
+ for (DataFlavor flavor : flavors) {
1287
+ if (flavor.isFlavorJavaFileListType()) {
1346
1288
  return true;
1347
1289
  }
1348
1290
  }