use of javax.media.j3d.ShaderAppearance in project ffx by mjschnie.
the class RendererCache method createAppearance.
private static Appearance createAppearance(Color3f col, ViewModel polygonType) {
Appearance ap = null;
if (shaderProgram != null) {
ShaderAppearance sap = new ShaderAppearance();
sap.setShaderProgram(shaderProgram);
ap = sap;
}
if (ap == null) {
ap = new Appearance();
}
Material mat = materialFactory(col);
ap.setMaterial(mat);
ap.setRenderingAttributes(renderingAttributes);
ap.setColoringAttributes(coloringAttributes);
ap.setLineAttributes(lineAttributes);
ap.setPointAttributes(pointAttributes);
if (polygonType == RendererCache.ViewModel.FILL) {
ap.setPolygonAttributes(fillPolygonAttributes);
fillAppearances.put(col, ap);
} else if (polygonType == RendererCache.ViewModel.POINTS) {
ap.setPolygonAttributes(pointPolygonAttributes);
pointAppearances.put(col, ap);
} else {
ap.setPolygonAttributes(linePolygonAttributes);
lineAppearances.put(col, ap);
}
return ap;
}
Aggregations