diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/jogamp/java3d/utils/shader/SimpleShaderAppearance.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/org/jogamp/java3d/utils/shader/SimpleShaderAppearance.java b/src/main/java/org/jogamp/java3d/utils/shader/SimpleShaderAppearance.java index 8ef0bd1..a2f7f25 100644 --- a/src/main/java/org/jogamp/java3d/utils/shader/SimpleShaderAppearance.java +++ b/src/main/java/org/jogamp/java3d/utils/shader/SimpleShaderAppearance.java @@ -371,8 +371,18 @@ public class SimpleShaderAppearance extends ShaderAppearance if (buildBasedOnAttributes) { // we only rebuild if we are not yet live or the right capabilities have been set - if ((!this.isLive() && !this.isCompiled()) || (this.getCapability(ALLOW_MATERIAL_READ) - && this.getCapability(ALLOW_TEXTURE_UNIT_STATE_READ) && this.getCapability(ALLOW_TEXTURE_READ))) + if ( + // first check is that the appearance is not live/compiled or if it is the various parts can be got at + ((!this.isLive() && !this.isCompiled()) // appearance is not live/compiled + || (this.getCapability(ALLOW_MATERIAL_READ)// + && this.getCapability(ALLOW_TEXTURE_UNIT_STATE_READ) // + && this.getCapability(ALLOW_TEXTURE_READ)// + && this.getCapability(ALLOW_POLYGON_ATTRIBUTES_READ)))// + // second part of check is that each component can be live/compiled elsewhere so need checking separately + && (this.getPolygonAttributes() == null // no poly attributes + || (!this.getPolygonAttributes().isLive() && !this.getPolygonAttributes().isCompiled()) // poly attributes are not yet live + || this.getPolygonAttributes().getCapability(PolygonAttributes.ALLOW_MODE_READ))//poly attributes are live but can be read + ) { boolean hasTexture = this.getTexture() != null || this.getTextureUnitCount() > 0; if (this.getTextureUnitCount() > 0) |