summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/skyboxes/game/negx.pngbin0 -> 809490 bytes
-rw-r--r--assets/skyboxes/game/negy.pngbin0 -> 770367 bytes
-rw-r--r--assets/skyboxes/game/negz.pngbin0 -> 775692 bytes
-rw-r--r--assets/skyboxes/game/posx.pngbin0 -> 780541 bytes
-rw-r--r--assets/skyboxes/game/posy.pngbin0 -> 811449 bytes
-rw-r--r--assets/skyboxes/game/posz.pngbin0 -> 886160 bytes
-rw-r--r--core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java29
7 files changed, 22 insertions, 7 deletions
diff --git a/assets/skyboxes/game/negx.png b/assets/skyboxes/game/negx.png
new file mode 100644
index 0000000..09d10a3
--- /dev/null
+++ b/assets/skyboxes/game/negx.png
Binary files differ
diff --git a/assets/skyboxes/game/negy.png b/assets/skyboxes/game/negy.png
new file mode 100644
index 0000000..8ed06f7
--- /dev/null
+++ b/assets/skyboxes/game/negy.png
Binary files differ
diff --git a/assets/skyboxes/game/negz.png b/assets/skyboxes/game/negz.png
new file mode 100644
index 0000000..eabe9e8
--- /dev/null
+++ b/assets/skyboxes/game/negz.png
Binary files differ
diff --git a/assets/skyboxes/game/posx.png b/assets/skyboxes/game/posx.png
new file mode 100644
index 0000000..7ef6663
--- /dev/null
+++ b/assets/skyboxes/game/posx.png
Binary files differ
diff --git a/assets/skyboxes/game/posy.png b/assets/skyboxes/game/posy.png
new file mode 100644
index 0000000..92ecf02
--- /dev/null
+++ b/assets/skyboxes/game/posy.png
Binary files differ
diff --git a/assets/skyboxes/game/posz.png b/assets/skyboxes/game/posz.png
new file mode 100644
index 0000000..5920ec8
--- /dev/null
+++ b/assets/skyboxes/game/posz.png
Binary files differ
diff --git a/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java b/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java
index 224c236..624ee44 100644
--- a/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java
+++ b/core/src/kz/ilotterytea/maxon/screens/game/GameScreen.java
@@ -1,6 +1,7 @@
package kz.ilotterytea.maxon.screens.game;
import com.badlogic.gdx.*;
+import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
@@ -45,6 +46,7 @@ import net.mgsx.gltf.scene3d.scene.Scene;
import net.mgsx.gltf.scene3d.scene.SceneAsset;
import net.mgsx.gltf.scene3d.scene.SceneManager;
import net.mgsx.gltf.scene3d.scene.SceneSkybox;
+import net.mgsx.gltf.scene3d.utils.EnvironmentUtil;
import net.mgsx.gltf.scene3d.utils.IBLBuilder;
import java.util.ArrayList;
@@ -373,11 +375,13 @@ public class GameScreen implements Screen, InputProcessor {
}
private void create3D() {
- SceneAsset sceneAsset = game.assetManager.get("models/scenes/living_room.glb", SceneAsset.class);
- Scene scene = new Scene(sceneAsset.scene);
-
sceneManager = new SceneManager();
- sceneManager.addScene(scene);
+
+ if (!OsUtils.isMobile) {
+ SceneAsset sceneAsset = game.assetManager.get("models/scenes/living_room.glb", SceneAsset.class);
+ Scene scene = new Scene(sceneAsset.scene);
+ sceneManager.addScene(scene);
+ }
camera = new PerspectiveCamera(60f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.near = 1f;
@@ -412,7 +416,6 @@ public class GameScreen implements Screen, InputProcessor {
// setup quick IBL (image based lighting)
IBLBuilder iblBuilder = IBLBuilder.createOutdoor(light);
- Cubemap environmentCubemap = iblBuilder.buildEnvMap(1024);
Cubemap diffuseCubemap = iblBuilder.buildIrradianceMap(256);
Cubemap specularCubemap = iblBuilder.buildRadianceMap(10);
iblBuilder.dispose();
@@ -424,8 +427,20 @@ public class GameScreen implements Screen, InputProcessor {
sceneManager.environment.set(PBRCubemapAttribute.createSpecularEnv(specularCubemap));
sceneManager.environment.set(PBRCubemapAttribute.createDiffuseEnv(diffuseCubemap));
- SceneSkybox skybox = new SceneSkybox(environmentCubemap);
- sceneManager.setSkyBox(skybox);
+ Cubemap environmentCubemap;
+
+ if (OsUtils.isMobile) {
+ environmentCubemap = EnvironmentUtil.createCubemap(
+ new InternalFileHandleResolver(),
+ "skyboxes/game/",
+ ".png",
+ EnvironmentUtil.FACE_NAMES_NEG_POS
+ );
+ } else {
+ environmentCubemap = iblBuilder.buildEnvMap(1024);
+ }
+
+ sceneManager.setSkyBox(new SceneSkybox(environmentCubemap));
}
private void createStageUI() {