aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/GraphicsContext3D.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/classes/share/javax/media/j3d/GraphicsContext3D.java b/src/classes/share/javax/media/j3d/GraphicsContext3D.java
index 34fbd8c..18e2ba8 100644
--- a/src/classes/share/javax/media/j3d/GraphicsContext3D.java
+++ b/src/classes/share/javax/media/j3d/GraphicsContext3D.java
@@ -2543,22 +2543,24 @@ public class GraphicsContext3D extends Object {
ShaderProgramRetained spR = ((ShaderAppearanceRetained)app).shaderProgram;
if ( spR != null) {
spR.updateNative(canvas3d, true);
-
- ShaderAttributeSetRetained sasR =
- ((ShaderAppearanceRetained)app).shaderAttributeSet;
+
+ ShaderAttributeSetRetained sasR =
+ ((ShaderAppearanceRetained)app).shaderAttributeSet;
if (sasR != null) {
sasR.updateNative(canvas3d, spR);
}
+ canvas3d.shaderProgram = spR;
useShaders = true;
}
- else {
- canvas3d.shaderProgram.updateNative(canvas3d, false);
- useShaders = false;
- }
}
-
+ else if (canvas3d.shaderProgram != null) {
+ canvas3d.shaderProgram.updateNative(canvas3d, false);
+ canvas3d.shaderProgram = null;
+ useShaders = false;
+ }
+
// Set the number of available texture units; this depends on
// whether or not shaders are being used.
int availableTextureUnits =