summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300>2006-03-03 18:07:20 +0000
committerkcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300>2006-03-03 18:07:20 +0000
commiteeafadd7b12c337319aa85730c2acf0758e14e18 (patch)
tree4d8fac09c039c87a3dd160a5a75f3d9c5389406a
parent748ecffc275b9b5b7b1b66db81b97dbc95f1b308 (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.java21
-rw-r--r--src/resources/images/Java3Ddot3.jpgbin0 -> 16302 bytes
-rw-r--r--src/resources/images/bg.jpgbin327485 -> 58084 bytes
-rw-r--r--src/resources/images/gold.jpgbin42643 -> 18253 bytes
-rw-r--r--src/resources/images/mask.jpgbin0 -> 2655 bytes
-rw-r--r--src/resources/images/stone.jpgbin79522 -> 20446 bytes
-rw-r--r--src/resources/images/wood.jpgbin56795 -> 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
new file mode 100644
index 0000000..011e574
--- /dev/null
+++ b/src/resources/images/Java3Ddot3.jpg
Binary files differ
diff --git a/src/resources/images/bg.jpg b/src/resources/images/bg.jpg
index 556babe..9790379 100644
--- a/src/resources/images/bg.jpg
+++ b/src/resources/images/bg.jpg
Binary files differ
diff --git a/src/resources/images/gold.jpg b/src/resources/images/gold.jpg
index 40e8786..aec73c5 100644
--- a/src/resources/images/gold.jpg
+++ b/src/resources/images/gold.jpg
Binary files differ
diff --git a/src/resources/images/mask.jpg b/src/resources/images/mask.jpg
new file mode 100644
index 0000000..35a6c8d
--- /dev/null
+++ b/src/resources/images/mask.jpg
Binary files differ
diff --git a/src/resources/images/stone.jpg b/src/resources/images/stone.jpg
index ab80a4a..6aa8914 100644
--- a/src/resources/images/stone.jpg
+++ b/src/resources/images/stone.jpg
Binary files differ
diff --git a/src/resources/images/wood.jpg b/src/resources/images/wood.jpg
index 195b903..99370c5 100644
--- a/src/resources/images/wood.jpg
+++ b/src/resources/images/wood.jpg
Binary files differ