Search in sources :

Example 1 with ShaderAppearance

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;
}
Also used : ShaderAppearance(javax.media.j3d.ShaderAppearance) Material(javax.media.j3d.Material) ShaderAppearance(javax.media.j3d.ShaderAppearance) Appearance(javax.media.j3d.Appearance)

Aggregations

Appearance (javax.media.j3d.Appearance)1 Material (javax.media.j3d.Material)1 ShaderAppearance (javax.media.j3d.ShaderAppearance)1