Search in sources :

Example 1 with NormalMap

use of org.fxyz.utils.NormalMap in project FXyzLib by Birdasaur.

the class TriangleMeshHelper method getMaterialWithColor.

public Material getMaterialWithColor(Color color, String image) {
    PhongMaterial mat = new PhongMaterial(color);
    if (image != null && !image.isEmpty()) {
        Image img = new Image(image);
        mat.setDiffuseMap(img);
        NormalMap normal = new NormalMap(img);
        // normal.setIntensity(10);
        // normal.setIntensityScale(2);
        mat.setBumpMap(normal);
    }
    mat.setSpecularPower(32);
    mat.setSpecularColor(Color.WHITE);
    return mat;
}
Also used : NormalMap(org.fxyz.utils.NormalMap) PhongMaterial(javafx.scene.paint.PhongMaterial) Image(javafx.scene.image.Image)

Aggregations

Image (javafx.scene.image.Image)1 PhongMaterial (javafx.scene.paint.PhongMaterial)1 NormalMap (org.fxyz.utils.NormalMap)1