mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e3532f9a3d | ||
![]() |
213e323d3b | ||
![]() |
ba5566f070 | ||
![]() |
ed3cd34832 | ||
![]() |
4cc8256037 | ||
![]() |
aef74ba19e |
@@ -109,6 +109,40 @@ namespace gdjs {
|
||||
if (!scene) {
|
||||
return false;
|
||||
}
|
||||
const skyboxGeo = new THREE.BoxGeometry(10000, 10000, 10000);
|
||||
|
||||
const ft = new THREE.TextureLoader().load(
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_north.png'
|
||||
);
|
||||
const bk = new THREE.TextureLoader().load(
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_south.png'
|
||||
);
|
||||
const up = new THREE.TextureLoader().load(
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_up.png'
|
||||
);
|
||||
const dn = new THREE.TextureLoader().load(
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_down.png'
|
||||
);
|
||||
const rt = new THREE.TextureLoader().load(
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_east.png'
|
||||
);
|
||||
const lf = new THREE.TextureLoader().load(
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_west.png'
|
||||
);
|
||||
|
||||
const materialArray = [
|
||||
new THREE.MeshBasicMaterial({ map: rt, side: THREE.BackSide }), // Right
|
||||
new THREE.MeshBasicMaterial({ map: up, side: THREE.BackSide }), // Left
|
||||
new THREE.MeshBasicMaterial({ map: lf, side: THREE.BackSide }), // Top
|
||||
new THREE.MeshBasicMaterial({ map: dn, side: THREE.BackSide }), // Bottom
|
||||
new THREE.MeshBasicMaterial({ map: bk, side: THREE.BackSide }), // Front
|
||||
new THREE.MeshBasicMaterial({ map: ft, side: THREE.BackSide }), // Back
|
||||
];
|
||||
const skybox = new THREE.Mesh(skyboxGeo, materialArray);
|
||||
skybox.position.set(0, 0, 0);
|
||||
skybox.frustumCulled = false;
|
||||
|
||||
scene.add(skybox);
|
||||
scene.add(this._light);
|
||||
scene.add(this._light.target);
|
||||
if (this._shadowCameraHelper) {
|
||||
|
BIN
Extensions/3D/clouds1_down.png
Normal file
BIN
Extensions/3D/clouds1_down.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
BIN
Extensions/3D/clouds1_east.png
Normal file
BIN
Extensions/3D/clouds1_east.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
BIN
Extensions/3D/clouds1_north.png
Normal file
BIN
Extensions/3D/clouds1_north.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
BIN
Extensions/3D/clouds1_south.png
Normal file
BIN
Extensions/3D/clouds1_south.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
BIN
Extensions/3D/clouds1_up.png
Normal file
BIN
Extensions/3D/clouds1_up.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
BIN
Extensions/3D/clouds1_west.png
Normal file
BIN
Extensions/3D/clouds1_west.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
@@ -11,6 +11,8 @@ namespace gdjs {
|
||||
private _profilerText: PIXI.Text | null = null;
|
||||
private _showCursorAtNextRender: boolean = false;
|
||||
private _threeRenderer: THREE.WebGLRenderer | null = null;
|
||||
private loader: THREE.CubeTextureLoader;
|
||||
private texture: THREE.CubeTexture;
|
||||
private _layerRenderingMetrics: {
|
||||
rendered2DLayersCount: number;
|
||||
rendered3DLayersCount: number;
|
||||
@@ -33,6 +35,17 @@ namespace gdjs {
|
||||
this._threeRenderer = this._runtimeGameRenderer
|
||||
? this._runtimeGameRenderer.getThreeRenderer()
|
||||
: null;
|
||||
|
||||
this.loader = new THREE.CubeTextureLoader();
|
||||
|
||||
this.texture = this.loader.load([
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_east.png', // px
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_west.png', // nx
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_up.png', // py
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_down.png', // ny
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_north.png', // pz
|
||||
'C:/Users/Utilisateur/Desktop/Gdevelop/GDevelop/Extensions/3D/clouds1_south.png', // nz
|
||||
]);
|
||||
}
|
||||
|
||||
onGameResolutionResized() {
|
||||
@@ -209,9 +222,11 @@ namespace gdjs {
|
||||
);
|
||||
threeRenderer.resetState();
|
||||
if (this._runtimeScene.getClearCanvas()) threeRenderer.clear();
|
||||
threeScene.background = new THREE.Color(
|
||||
this._runtimeScene.getBackgroundColor()
|
||||
);
|
||||
|
||||
threeScene.background = this.texture;
|
||||
// threeScene.background = new THREE.Color(
|
||||
// this._runtimeScene.getBackgroundColor()
|
||||
// );
|
||||
|
||||
isFirstRender = false;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user