JavaFX 용 범프 맵은 높이 맵이 아닌 일반 맵으로 자세한 내용은 normal map and height map info을 참조하십시오.
다음은 시도 할 수있는 샘플입니다. 이 장면이 보여 전에 다운로드 약간의 시간이 걸릴 수 있도록

지도에 대한 이미지는 매우 크다. 나는 이미지에 사용
소스 =>Bored? Then Create a Planet
import javafx.animation.*;
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.image.Image;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.*;
import javafx.scene.shape.Sphere;
import javafx.scene.transform.Rotate;
import javafx.stage.Stage;
import javafx.util.Duration;
public class EarthViewer extends Application {
private static final double EARTH_RADIUS = 400;
private static final double VIEWPORT_SIZE = 800;
private static final double ROTATE_SECS = 30;
private static final double MAP_WIDTH = 8192/2d;
private static final double MAP_HEIGHT = 4092/2d;
private static final String DIFFUSE_MAP =
"http://planetmaker.wthr.us/img/earth_gebco8_texture_8192x4096.jpg";
private static final String NORMAL_MAP =
"http://planetmaker.wthr.us/img/earth_normalmap_flat_8192x4096.jpg";
private static final String SPECULAR_MAP =
"http://planetmaker.wthr.us/img/earth_specularmap_flat_8192x4096.jpg";
private Group buildScene() {
Sphere earth = new Sphere(EARTH_RADIUS);
earth.setTranslateX(VIEWPORT_SIZE/2d);
earth.setTranslateY(VIEWPORT_SIZE/2d);
PhongMaterial earthMaterial = new PhongMaterial();
earthMaterial.setDiffuseMap(
new Image(
DIFFUSE_MAP,
MAP_WIDTH,
MAP_HEIGHT,
true,
true
)
);
earthMaterial.setBumpMap(
new Image(
NORMAL_MAP,
MAP_WIDTH,
MAP_HEIGHT,
true,
true
)
);
earthMaterial.setSpecularMap(
new Image(
SPECULAR_MAP,
MAP_WIDTH,
MAP_HEIGHT,
true,
true
)
);
earth.setMaterial(
earthMaterial
);
return new Group(earth);
}
@Override
public void start(Stage stage) {
Group group = buildScene();
Scene scene = new Scene(
new StackPane(group),
VIEWPORT_SIZE, VIEWPORT_SIZE,
true,
SceneAntialiasing.BALANCED
);
scene.setFill(Color.rgb(10, 10, 40));
scene.setCamera(new PerspectiveCamera());
stage.setScene(scene);
stage.show();
stage.setFullScreen(true);
rotateAroundYAxis(group).play();
}
private RotateTransition rotateAroundYAxis(Node node) {
RotateTransition rotate = new RotateTransition(
Duration.seconds(ROTATE_SECS),
node
);
rotate.setAxis(Rotate.Y_AXIS);
rotate.setFromAngle(360);
rotate.setToAngle(0);
rotate.setInterpolator(Interpolator.LINEAR);
rotate.setCycleCount(RotateTransition.INDEFINITE);
return rotate;
}
public static void main(String[] args) {
launch(args);
}
}
정상입니까? 왜???? PhongMaterial bumpMapProperty 상태의
Javadoc의 상태 :
RGB 이미지로 저장 노멀 맵이다 PhongMaterial이, 상기 범프 맵.
노멀 맵이 아니라 높이 맵
because보다 사용
:
[노멀 맵]가 더 정확뿐만 아니라 전용 라인을 따라면에서 멀어지게되는 화소 시뮬레이션보다 픽셀 이 임의의 방향으로 어떤 방향 으로든 움직이는 것을 시뮬레이션 할 수 있습니다.
일반 매핑과 높이 매핑에 대한 간략한 설명은 wikipedia bump mapping 문서에서 제공됩니다.
정상? 왜???? – ajeh
범프 맵핑에 법선 맵이 사용되는 이유를 설명하는 답변이 업데이트되었습니다. – jewelsea
당신은 아이러니를 놓쳤습니다! 노멀 맵을 사용하지만 매개 변수 '범프 맵'을 호출하는 것은 혼란 스럽습니다. 나는 범프 맵이 작동하지 않는 이유를 알아 내려고 애 쓰고 있었지만 매개 변수 '노멀 맵'을 호출하면 요구 사항이 무엇인지 알 수 있었을 것입니다. – ajeh