JavaFX:如何制作透明发光材质?

JavaFX:如何制作透明发光材质?,javafx,lighting,phong,Javafx,Lighting,Phong,我想创建一个具有均匀辉光的PhongMaterial。效果是,我有一个小地球模型,我想用一个廉价的极光模拟物来环绕它。耀斑不是必需的,也不是我想要的,我只想要它周围的淡绿色球体 我本以为用白色做这个的方法就是 public static Sphere buildGlowingSphere(double radius) { String glowingFilename = "white_square_400x400.jpg"; Image glowingMap = new Ima

我想创建一个具有均匀辉光的PhongMaterial。效果是,我有一个小地球模型,我想用一个廉价的极光模拟物来环绕它。耀斑不是必需的,也不是我想要的,我只想要它周围的淡绿色球体

我本以为用白色做这个的方法就是

public static Sphere buildGlowingSphere(double radius) {

    String glowingFilename = "white_square_400x400.jpg";
    Image glowingMap = new Image(new File(glowingFilename).toURI().toString());

    PhongMaterial material = new PhongMaterial();
    material.setDiffuseColor(Color.rgb(255, 255, 255, 0.01));
    material.setSpecularColor(Color.rgb(255, 255, 255, 0.01));
    material.setSelfIlluminationMap(glowingMap);

    Sphere sphere = new Sphere(radius);
    sphere.setMaterial(material);

    return sphere;
}
但是,这只会生成一个不透明的白色球体。我需要什么使它透明和非常微妙

当我们在它,我不想有一个新的来源,为每一种颜色的图像,我想做。我想做点像

public static Sphere buildGlowingSphere2(double radius, Color color) {

    Image glowingMap = generateBlankImage(color);

    PhongMaterial material = new PhongMaterial();
    material.setDiffuseColor(Color.rgb(255, 255, 255, 0.01));
    material.setSpecularColor(Color.rgb(255, 255, 255, 0.01));
    material.setSelfIlluminationMap(glowingMap);

    Sphere sphere = new Sphere(radius);
    sphere.setMaterial(material);

    return sphere;
}
我该怎么做?或者制作一种自发光均匀的材料


我也试着用一个不发光的透明球体来做这件事,看起来不错,但它没有你在图像中看到的明亮的肢体;它看起来就像一个覆盖着地球的平面圆圈。我认为这是因为在现实生活中,这种材料是发光的。但是,如果有不同或更好的方法来达到相同的效果,我会洗耳恭听。

我分别发布了第二个问题,并在这里得到了答案:我分别发布了第二个问题,并在这里得到了答案: