diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-31 23:42:08 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-31 23:42:08 +0500 |
| commit | c254eb2625642e4e8991777eb0b32c3cd4b90660 (patch) | |
| tree | fe91dea5790ecdaa8344e79afbed0d847f7ccf40 /core/src | |
| parent | cc40d196da82d113dc8d039198ca70562533ced1 (diff) | |
upd: new room model + lights + positions
Diffstat (limited to 'core/src')
3 files changed, 29 insertions, 7 deletions
diff --git a/core/src/com/ilotterytea/maxoning/player/DecalPlayer.java b/core/src/com/ilotterytea/maxoning/player/DecalPlayer.java index d7baf79..0cf0405 100644 --- a/core/src/com/ilotterytea/maxoning/player/DecalPlayer.java +++ b/core/src/com/ilotterytea/maxoning/player/DecalPlayer.java @@ -24,7 +24,7 @@ public class DecalPlayer { this.decal = Decal.newDecal(this.regions[this.regionIndex]); this.decal.setScale(0.025f); - this.decal.setPosition(-4.0f, 1.75f, -4.0f); + this.decal.setPosition(2.0f, 1.75f, 2.0f); float width = this.decal.getWidth() / (this.decal.getScaleX() * 1000f); float height = this.decal.getHeight() / (this.decal.getScaleY() * 1000f); diff --git a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java index f50e006..13046e5 100644 --- a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java +++ b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java @@ -9,6 +9,7 @@ import com.badlogic.gdx.graphics.g3d.decals.CameraGroupStrategy; import com.badlogic.gdx.graphics.g3d.decals.Decal; import com.badlogic.gdx.graphics.g3d.decals.DecalBatch; import com.badlogic.gdx.math.Interpolation; +import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.actions.Actions; @@ -34,6 +35,7 @@ import com.rafaskoberg.gdx.typinglabel.TypingLabel; import net.mgsx.gltf.scene3d.attributes.PBRCubemapAttribute; import net.mgsx.gltf.scene3d.attributes.PBRTextureAttribute; import net.mgsx.gltf.scene3d.lights.DirectionalShadowLight; +import net.mgsx.gltf.scene3d.lights.PointLightEx; import net.mgsx.gltf.scene3d.scene.Scene; import net.mgsx.gltf.scene3d.scene.SceneAsset; import net.mgsx.gltf.scene3d.scene.SceneManager; @@ -508,18 +510,27 @@ public class GameScreen implements Screen, InputProcessor { camera = new PerspectiveCamera(60f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); camera.near = 1f; camera.far = 300f; - camera.position.set(-5f, 2.0f, 1.5f); + camera.position.set(-3f, 2f, -0.3f); + camera.rotate(256f, 0f, 1f, 0f); camera.update(); sceneManager.setCamera(camera); - DirectionalShadowLight light = new DirectionalShadowLight(); + DirectionalShadowLight light = new DirectionalShadowLight(1024, 1024, 60f, 60f, 1f, 300f); light.set(new Color(0xdcccffff), -1f, -0.8f, -0.2f); light.intensity = 5f; sceneManager.environment.add(light); sceneManager.environment.shadowMap = light; + PointLightEx signLight = new PointLightEx(); + signLight.set(Color.PINK, new Vector3(2f, 6f, 2f), 80f, 100f); + + PointLightEx windowLight = new PointLightEx(); + windowLight.set(Color.BLUE, new Vector3(-1.1f, 7.3f, 0.5f), 80f, 100f); + + sceneManager.environment.add(windowLight, signLight); + // setup quick IBL (image based lighting) IBLBuilder iblBuilder = IBLBuilder.createOutdoor(light); Cubemap environmentCubemap = iblBuilder.buildEnvMap(1024); diff --git a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java index 84e6374..ca8fb4e 100644 --- a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java +++ b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java @@ -6,6 +6,7 @@ import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.*; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.math.Interpolation; +import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.scenes.scene2d.Action; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.Stage; @@ -27,6 +28,7 @@ import com.ilotterytea.maxoning.utils.serialization.GameDataSystem; import net.mgsx.gltf.scene3d.attributes.PBRCubemapAttribute; import net.mgsx.gltf.scene3d.attributes.PBRTextureAttribute; import net.mgsx.gltf.scene3d.lights.DirectionalShadowLight; +import net.mgsx.gltf.scene3d.lights.PointLightEx; import net.mgsx.gltf.scene3d.scene.Scene; import net.mgsx.gltf.scene3d.scene.SceneAsset; import net.mgsx.gltf.scene3d.scene.SceneManager; @@ -302,11 +304,10 @@ public class MenuScreen implements Screen { public void render(float delta) { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); - float deltaTime = Gdx.graphics.getDeltaTime(); - sceneManager.update(deltaTime); + sceneManager.update(delta); sceneManager.render(); - camera.rotate(2 * deltaTime, 0, 1, 0); + camera.rotate(2 * delta, 0, 1, 0); camera.update(); stage.act(delta); @@ -340,7 +341,6 @@ public class MenuScreen implements Screen { camera.near = 1f; camera.far = 300f; camera.position.set(0f, 5f, 0f); - camera.rotate(45f, 0f, 1f, 0f); camera.update(); @@ -352,6 +352,17 @@ public class MenuScreen implements Screen { sceneManager.environment.add(light); sceneManager.environment.shadowMap = light; + PointLightEx signLight = new PointLightEx(); + + if (sav != null) { + signLight.set(Color.PINK, new Vector3(2f, 6f, 2f), 80f, 100f); + } + + PointLightEx windowLight = new PointLightEx(); + windowLight.set(Color.BLUE, new Vector3(-1.1f, 7.3f, 0.5f), 80f, 100f); + + sceneManager.environment.add(windowLight, signLight); + // setup quick IBL (image based lighting) IBLBuilder iblBuilder = IBLBuilder.createOutdoor(light); Cubemap environmentCubemap = iblBuilder.buildEnvMap(1024); |
