final String effectInstanceAnchor = effectInstanceUrl.substring(1);
this.materialEffects.put(this.materialId, effectInstanceAnchor);
}
} else if ("effect".equals(name)) {
this.effectId = attributes.getValue("id");
this.effectAppearances.put(this.effectId, new Appearance());
} else if (this.effectId != null) {
if ("profile_COMMON".equals(parent) && "newparam".equals(name)) {
this.newParamSid = attributes.getValue("sid");
} else if ("newparam".equals(parent) && "surface".equals(name)
&& "2D".equals(attributes.getValue("type"))) {
this.inSurface2D = true;
} else if ("extra".equals(parent) && "technique".equals(name)) {
this.techniqueProfile = attributes.getValue("profile");
} else if ("phong".equals(name) || "blinn".equals(name)) {
this.inPhongBlinnOrLambert = true;
} else if ("lambert".equals(name)) {
this.inPhongBlinnOrLambert = true;
getAppearanceMaterial(this.effectId).setSpecularColor(0, 0, 0);
getAppearanceMaterial(this.effectId).setShininess(1);
} else if ("constant".equals(name)) {
this.inConstant = true;
} else if (this.inConstant || this.inPhongBlinnOrLambert
&& ("transparent".equals(name))) {
this.opaque = attributes.getValue("opaque");
if (this.opaque == null) {
this.opaque = "A_ONE";
}
} else if ("texture".equals(name) && "diffuse".equals(parent)) {
final String textureId = this.surface2DIds.get(this.sampler2DIds.get(attributes.getValue("texture")));
final Appearance appearance = this.effectAppearances.get(this.effectId);
this.postProcessingBinders.add(new Runnable() {
public void run() {
// Resolve texture at the end of the document
appearance.setTexture(textures.get(textureId));
}
});
}
} else if ("geometry".equals(name)) {
this.geometryId = attributes.getValue("id");