diff options
author | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2006-03-03 18:07:20 +0000 |
---|---|---|
committer | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2006-03-03 18:07:20 +0000 |
commit | eeafadd7b12c337319aa85730c2acf0758e14e18 (patch) | |
tree | 4d8fac09c039c87a3dd160a5a75f3d9c5389406a | |
parent | 748ecffc275b9b5b7b1b66db81b97dbc95f1b308 (diff) |
1. Recompressed some images for greater compression
2. Added ShaderErrorListener to phong shading test program
-rw-r--r-- | src/classes/org/jdesktop/j3d/examples/glsl_shader/PhongShadingGLSL.java | 21 | ||||
-rw-r--r-- | src/resources/images/Java3Ddot3.jpg | bin | 0 -> 16302 bytes | |||
-rw-r--r-- | src/resources/images/bg.jpg | bin | 327485 -> 58084 bytes | |||
-rw-r--r-- | src/resources/images/gold.jpg | bin | 42643 -> 18253 bytes | |||
-rw-r--r-- | src/resources/images/mask.jpg | bin | 0 -> 2655 bytes | |||
-rw-r--r-- | src/resources/images/stone.jpg | bin | 79522 -> 20446 bytes | |||
-rw-r--r-- | src/resources/images/wood.jpg | bin | 56795 -> 12807 bytes |
7 files changed, 17 insertions, 4 deletions
diff --git a/src/classes/org/jdesktop/j3d/examples/glsl_shader/PhongShadingGLSL.java b/src/classes/org/jdesktop/j3d/examples/glsl_shader/PhongShadingGLSL.java index 50b68fc..3129954 100644 --- a/src/classes/org/jdesktop/j3d/examples/glsl_shader/PhongShadingGLSL.java +++ b/src/classes/org/jdesktop/j3d/examples/glsl_shader/PhongShadingGLSL.java @@ -48,6 +48,7 @@ import com.sun.j3d.utils.geometry.Sphere; import com.sun.j3d.utils.shader.StringIO; import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; +import javax.swing.JOptionPane; import javax.vecmath.*; import java.awt.GraphicsConfiguration; import java.io.IOException; @@ -67,7 +68,7 @@ public class PhongShadingGLSL extends javax.swing.JFrame { // Flag indicates type of lights: directional, point, or spot lights. private static int lightType = DIRECTIONAL_LIGHT; - private SimpleUniverse u = null; + private SimpleUniverse univ = null; private ShaderAppearance sApp = null; private ShaderProgram gouraudSP = null; @@ -290,6 +291,17 @@ public class PhongShadingGLSL extends javax.swing.JFrame { rotator2.setSchedulingBounds(bounds); l2RotTrans.addChild(rotator2); + // Setup ShaderErrorListener + univ.addShaderErrorListener(new ShaderErrorListener() { + public void errorOccurred(ShaderError error) { + error.printVerbose(); + JOptionPane.showMessageDialog(PhongShadingGLSL.this, + error.toString(), + "ShaderError", + JOptionPane.ERROR_MESSAGE); + } + }); + return objRoot; } @@ -299,14 +311,14 @@ public class PhongShadingGLSL extends javax.swing.JFrame { Canvas3D c = new Canvas3D(config); - u = new SimpleUniverse(c); + univ = new SimpleUniverse(c); // This will move the ViewPlatform back a bit so the // objects in the scene can be viewed. - u.getViewingPlatform().setNominalViewingTransform(); + univ.getViewingPlatform().setNominalViewingTransform(); BranchGroup scene = createSceneGraph(); - u.addBranchGraph(scene); + univ.addBranchGraph(scene); return c; } @@ -323,6 +335,7 @@ public class PhongShadingGLSL extends javax.swing.JFrame { drawingPanel.add(c, java.awt.BorderLayout.CENTER); } + // ---------------------------------------------------------------- /** This method is called from within the constructor to diff --git a/src/resources/images/Java3Ddot3.jpg b/src/resources/images/Java3Ddot3.jpg Binary files differnew file mode 100644 index 0000000..011e574 --- /dev/null +++ b/src/resources/images/Java3Ddot3.jpg diff --git a/src/resources/images/bg.jpg b/src/resources/images/bg.jpg Binary files differindex 556babe..9790379 100644 --- a/src/resources/images/bg.jpg +++ b/src/resources/images/bg.jpg diff --git a/src/resources/images/gold.jpg b/src/resources/images/gold.jpg Binary files differindex 40e8786..aec73c5 100644 --- a/src/resources/images/gold.jpg +++ b/src/resources/images/gold.jpg diff --git a/src/resources/images/mask.jpg b/src/resources/images/mask.jpg Binary files differnew file mode 100644 index 0000000..35a6c8d --- /dev/null +++ b/src/resources/images/mask.jpg diff --git a/src/resources/images/stone.jpg b/src/resources/images/stone.jpg Binary files differindex ab80a4a..6aa8914 100644 --- a/src/resources/images/stone.jpg +++ b/src/resources/images/stone.jpg diff --git a/src/resources/images/wood.jpg b/src/resources/images/wood.jpg Binary files differindex 195b903..99370c5 100644 --- a/src/resources/images/wood.jpg +++ b/src/resources/images/wood.jpg |