diff --git a/src/main/java/io/github/hydos/ginger/Example.java b/src/main/java/io/github/hydos/ginger/Example.java index 2a601b9..3e2b725 100644 --- a/src/main/java/io/github/hydos/ginger/Example.java +++ b/src/main/java/io/github/hydos/ginger/Example.java @@ -56,7 +56,7 @@ public class Example { TexturedModel tModel = ModelLoader.loadModel("stall.obj", "stallTexture.png"); tModel.getTexture().setReflectivity(1f); tModel.getTexture().setShineDamper(7f); - Player entity = new Player(tModel, new Vector3f(0,0,-3),0,180f,0, new Vector3f(0.2f, 0.2f, 0.2f)); + Player entity = new Player(tModel, new Vector3f(0,0,-3),0,180f,0, new Vector3f(0.2f, 0.2f, 0.2f), 5000); ThirdPersonCamera camera = new ThirdPersonCamera(new Vector3f(0,0.1f,0), entity); masterRenderer = new MasterRenderer(camera); diff --git a/src/main/java/io/github/hydos/ginger/engine/elements/Player.java b/src/main/java/io/github/hydos/ginger/engine/elements/Player.java index d6eaf2d..85b10a8 100644 --- a/src/main/java/io/github/hydos/ginger/engine/elements/Player.java +++ b/src/main/java/io/github/hydos/ginger/engine/elements/Player.java @@ -16,6 +16,7 @@ public class Player extends Entity{ private static float terrainHeight = 0; + private double timeModifier = 1; private float currentSpeed = 0; private float currentTurn = 0; @@ -23,21 +24,21 @@ public class Player extends Entity{ private boolean isInAir = false; - public Player(TexturedModel model, Vector3f position, float rotX, float rotY, float rotZ, Vector3f scale) { + public Player(TexturedModel model, Vector3f position, float rotX, float rotY, float rotZ, Vector3f scale, double timeScale) { super(model, position, rotX, rotY, rotZ, scale); + this.timeModifier = timeScale; } public void move(Terrain t) { - checkInputs(); - super.increaseRotation(0, (float) ((currentTurn / 1000000) * Window.getTime()), 0); - float distance = (currentSpeed / 1000000) * Window.getFloatTime(); + super.increaseRotation(0, (float) ((currentTurn) * Window.getTime() / timeModifier), 0); + float distance = (float) ((currentSpeed) * (Window.getTime() / (timeModifier * 2.5))); float dx = (float) (distance * Math.sin(Math.toRadians(super.getRotY()))); float dz = (float) (distance * Math.cos(Math.toRadians(super.getRotY()))); super.increasePosition(dx, 0, dz); - super.increasePosition(0, (float) (upwardsSpeed * (Window.getTime() / 1000000)), 0); + super.increasePosition(0, (float) (upwardsSpeed * (Window.getTime() / (timeModifier * 2))), 0); terrainHeight = t.getHeightOfTerrain(super.getPosition().x, super.getPosition().z); - upwardsSpeed += GRAVITY * Window.getTime() / 1000000; + upwardsSpeed += GRAVITY * Window.getTime() / (timeModifier * 2); if(super.getPosition().y < terrainHeight) { isInAir = false; upwardsSpeed = 0; diff --git a/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.java b/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.java index 00a101a..e548b11 100644 --- a/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.java +++ b/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL13; import org.lwjgl.opengl.GL20; import org.lwjgl.opengl.GL30; @@ -42,6 +43,8 @@ public class ShadowMapEntityRenderer { for (TexturedModel model : entities.keySet()) { RawModel rawModel = model.getRawModel(); bindModel(rawModel); + GL13.glActiveTexture(GL13.GL_TEXTURE0); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getTextureID()); for (Entity entity : entities.get(model)) { prepareInstance(entity); GL11.glDrawElements(GL11.GL_TRIANGLES, rawModel.getVertexCount(), @@ -49,6 +52,7 @@ public class ShadowMapEntityRenderer { } } GL20.glDisableVertexAttribArray(0); + GL20.glDisableVertexAttribArray(1); GL30.glBindVertexArray(0); } @@ -63,6 +67,7 @@ public class ShadowMapEntityRenderer { private void bindModel(RawModel rawModel) { GL30.glBindVertexArray(rawModel.getVaoID()); GL20.glEnableVertexAttribArray(0); + GL20.glEnableVertexAttribArray(1); } /** diff --git a/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowShader.java b/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowShader.java index 0222127..554d9a4 100644 --- a/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowShader.java +++ b/src/main/java/io/github/hydos/ginger/engine/shadow/ShadowShader.java @@ -27,6 +27,7 @@ public class ShadowShader extends ShaderProgram { @Override protected void bindAttributes() { super.bindAttribute(0, "in_position"); + super.bindAttribute(1, "in_textureCoords"); } } diff --git a/src/main/resources/shaders/shadowFragmentShader.glsl b/src/main/resources/shaders/shadowFragmentShader.glsl index 940bf31..f73b535 100644 --- a/src/main/resources/shaders/shadowFragmentShader.glsl +++ b/src/main/resources/shaders/shadowFragmentShader.glsl @@ -1,11 +1,16 @@ -#version 330 +#version 400 -out vec4 out_colour; +in vec2 textureCoords; -uniform sampler2D modelTexture;//will use this next week +out vec4 out_Colour; + +uniform sampler2D modelTexture; void main(void){ + float alpha = texture(modelTexture, textureCoords).a; + if(alpha < 0.5){ + discard; + } - out_colour = vec4(1.0); - -} \ No newline at end of file + out_Colour = vec4(1.0); +} diff --git a/src/main/resources/shaders/shadowVertexShader.glsl b/src/main/resources/shaders/shadowVertexShader.glsl index 99bf5f2..8977022 100644 --- a/src/main/resources/shaders/shadowVertexShader.glsl +++ b/src/main/resources/shaders/shadowVertexShader.glsl @@ -1,11 +1,16 @@ #version 150 in vec3 in_position; +in vec2 in_textureCoords; + +out vec2 textureCoords; uniform mat4 mvpMatrix; void main(void){ + textureCoords = in_textureCoords; + gl_Position = mvpMatrix * vec4(in_position, 1.0); -} \ No newline at end of file +} diff --git a/src/main/resources/shaders/terrainFragmentShader.glsl b/src/main/resources/shaders/terrainFragmentShader.glsl index 14df34f..e1de4f5 100644 --- a/src/main/resources/shaders/terrainFragmentShader.glsl +++ b/src/main/resources/shaders/terrainFragmentShader.glsl @@ -27,7 +27,7 @@ void main(void){ float objectNearestLight = texture(shadowMap, shadowCoords.xy).r; float lightFactor = 1.0; if(shadowCoords.z > objectNearestLight){ - lightFactor = 1.0 - 0.4; + lightFactor = 1.0 - (shadowCoords.w * 0.4); } vec4 blendMapColour = texture(blendMap, pass_textureCoords); diff --git a/src/main/resources/shaders/terrainVertexShader.glsl b/src/main/resources/shaders/terrainVertexShader.glsl index cd72a79..a18fa09 100644 --- a/src/main/resources/shaders/terrainVertexShader.glsl +++ b/src/main/resources/shaders/terrainVertexShader.glsl @@ -18,7 +18,9 @@ uniform vec3 lightPosition[5]; uniform mat4 toShadowMapSpace; const float density = 0.01; -const float gradient = 1; +const float gradient = 5; +const float shadowDistance = 150.0; +const float transitionDistance = 10.0; void main(void){ @@ -39,4 +41,9 @@ void main(void){ float distance = length(positionRelativeToCam.xyz); visibility = exp(-pow((distance * density), gradient)); visibility = clamp(visibility, 0.0, 1.0); + + distance = distance - (shadowDistance - transitionDistance); + distance = distance / transitionDistance; + shadowCoords.w = clamp(1.0-distance, 0.0, 1.0); + } diff --git a/target/classes/io/github/hydos/ginger/Example.class b/target/classes/io/github/hydos/ginger/Example.class index 8ebe5f7..e78697d 100644 Binary files a/target/classes/io/github/hydos/ginger/Example.class and b/target/classes/io/github/hydos/ginger/Example.class differ diff --git a/target/classes/io/github/hydos/ginger/Starter.class b/target/classes/io/github/hydos/ginger/Starter.class index b60c210..970edd9 100644 Binary files a/target/classes/io/github/hydos/ginger/Starter.class and b/target/classes/io/github/hydos/ginger/Starter.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/Entity.class b/target/classes/io/github/hydos/ginger/engine/elements/Entity.class index 6a4f409..7f53469 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/Entity.class and b/target/classes/io/github/hydos/ginger/engine/elements/Entity.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/FirstPersonCamera.class b/target/classes/io/github/hydos/ginger/engine/elements/FirstPersonCamera.class index a7cbff8..e9b3293 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/FirstPersonCamera.class and b/target/classes/io/github/hydos/ginger/engine/elements/FirstPersonCamera.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/Light.class b/target/classes/io/github/hydos/ginger/engine/elements/Light.class index 3f1cd71..380a56c 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/Light.class and b/target/classes/io/github/hydos/ginger/engine/elements/Light.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/Player.class b/target/classes/io/github/hydos/ginger/engine/elements/Player.class index ff47562..43cf12f 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/Player.class and b/target/classes/io/github/hydos/ginger/engine/elements/Player.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class index 73fd314..0d703f6 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class and b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera$1.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class index ca79158..54536e7 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class and b/target/classes/io/github/hydos/ginger/engine/elements/ThirdPersonCamera.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/Character.class b/target/classes/io/github/hydos/ginger/engine/font/Character.class index 447259f..780c253 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/Character.class and b/target/classes/io/github/hydos/ginger/engine/font/Character.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/FontType.class b/target/classes/io/github/hydos/ginger/engine/font/FontType.class index 7e0faa6..b19b527 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/FontType.class and b/target/classes/io/github/hydos/ginger/engine/font/FontType.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/GUIText.class b/target/classes/io/github/hydos/ginger/engine/font/GUIText.class index 3164476..bb50b84 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/GUIText.class and b/target/classes/io/github/hydos/ginger/engine/font/GUIText.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/Line.class b/target/classes/io/github/hydos/ginger/engine/font/Line.class index a8835fc..b8b7336 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/Line.class and b/target/classes/io/github/hydos/ginger/engine/font/Line.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/MetaFile.class b/target/classes/io/github/hydos/ginger/engine/font/MetaFile.class index b50a612..d9589c8 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/MetaFile.class and b/target/classes/io/github/hydos/ginger/engine/font/MetaFile.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/TextMaster.class b/target/classes/io/github/hydos/ginger/engine/font/TextMaster.class index f825fb0..f0d9044 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/TextMaster.class and b/target/classes/io/github/hydos/ginger/engine/font/TextMaster.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/TextMeshCreator.class b/target/classes/io/github/hydos/ginger/engine/font/TextMeshCreator.class index 750f6ea..842bc66 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/TextMeshCreator.class and b/target/classes/io/github/hydos/ginger/engine/font/TextMeshCreator.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/TextMeshData.class b/target/classes/io/github/hydos/ginger/engine/font/TextMeshData.class index 6bc906a..3ce44df 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/TextMeshData.class and b/target/classes/io/github/hydos/ginger/engine/font/TextMeshData.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/font/Word.class b/target/classes/io/github/hydos/ginger/engine/font/Word.class index 8b7fd14..d12e10d 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/font/Word.class and b/target/classes/io/github/hydos/ginger/engine/font/Word.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/guis/GuiTexture.class b/target/classes/io/github/hydos/ginger/engine/guis/GuiTexture.class index 45893a6..3f25279 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/guis/GuiTexture.class and b/target/classes/io/github/hydos/ginger/engine/guis/GuiTexture.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/io/Window.class b/target/classes/io/github/hydos/ginger/engine/io/Window.class index 4158dfb..ef068fc 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/io/Window.class and b/target/classes/io/github/hydos/ginger/engine/io/Window.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/Maths.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/Maths.class index 7eae7c1..d28f254 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/Maths.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/Maths.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/Quaternion.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/Quaternion.class index 07f445b..538dfd3 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/Quaternion.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/Quaternion.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix.class index 20d0847..a2def8f 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix2f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix2f.class index dffe93b..fc3f6ca 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix2f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix2f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix3f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix3f.class index df64082..2275260 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix3f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix3f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix4f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix4f.class index 4bd934a..87f2624 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix4f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/matrixes/Matrix4f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector.class index 2263590..aad9f5c 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector2f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector2f.class index aa55db3..177829f 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector2f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector2f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector3f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector3f.class index 444dbd4..5d313a8 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector3f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector3f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector4f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector4f.class index 3150c3e..3031d75 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector4f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/ReadableVector4f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector.class index 2b6dbd0..358d0b5 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector2f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector2f.class index e2692d4..87dd583 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector2f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector2f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector3f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector3f.class index b83e8cd..9aaa293 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector3f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector3f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector4f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector4f.class index 9994d90..4ba13ab 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector4f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/Vector4f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector2f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector2f.class index 4bf23a7..d726633 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector2f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector2f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector3f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector3f.class index 96c389f..bd21e8c 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector3f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector3f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector4f.class b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector4f.class index c0f4a78..f5d0dd0 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector4f.class and b/target/classes/io/github/hydos/ginger/engine/mathEngine/vectors/WritableVector4f.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/obj/ModelData.class b/target/classes/io/github/hydos/ginger/engine/obj/ModelData.class index b1cd759..94e30e1 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/obj/ModelData.class and b/target/classes/io/github/hydos/ginger/engine/obj/ModelData.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/obj/ModelLoader.class b/target/classes/io/github/hydos/ginger/engine/obj/ModelLoader.class index 6dbdbcc..99d6422 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/obj/ModelLoader.class and b/target/classes/io/github/hydos/ginger/engine/obj/ModelLoader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/obj/OBJFileLoader.class b/target/classes/io/github/hydos/ginger/engine/obj/OBJFileLoader.class index 639af62..918565d 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/obj/OBJFileLoader.class and b/target/classes/io/github/hydos/ginger/engine/obj/OBJFileLoader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/obj/Vertex.class b/target/classes/io/github/hydos/ginger/engine/obj/Vertex.class index b724afb..5427475 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/obj/Vertex.class and b/target/classes/io/github/hydos/ginger/engine/obj/Vertex.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/obj/normals/ModelDataNM.class b/target/classes/io/github/hydos/ginger/engine/obj/normals/ModelDataNM.class index aee1fcf..b1a0614 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/obj/normals/ModelDataNM.class and b/target/classes/io/github/hydos/ginger/engine/obj/normals/ModelDataNM.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/obj/normals/NormalMappedObjLoader.class b/target/classes/io/github/hydos/ginger/engine/obj/normals/NormalMappedObjLoader.class index 006228b..027e061 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/obj/normals/NormalMappedObjLoader.class and b/target/classes/io/github/hydos/ginger/engine/obj/normals/NormalMappedObjLoader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/obj/normals/VertexNM.class b/target/classes/io/github/hydos/ginger/engine/obj/normals/VertexNM.class index 81ca120..b7d8612 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/obj/normals/VertexNM.class and b/target/classes/io/github/hydos/ginger/engine/obj/normals/VertexNM.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/particle/InsertionSort.class b/target/classes/io/github/hydos/ginger/engine/particle/InsertionSort.class index 3a684ad..13d138c 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/particle/InsertionSort.class and b/target/classes/io/github/hydos/ginger/engine/particle/InsertionSort.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/particle/Particle.class b/target/classes/io/github/hydos/ginger/engine/particle/Particle.class index ce46877..efcc3ca 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/particle/Particle.class and b/target/classes/io/github/hydos/ginger/engine/particle/Particle.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/particle/ParticleMaster.class b/target/classes/io/github/hydos/ginger/engine/particle/ParticleMaster.class index 6f69fd2..12be487 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/particle/ParticleMaster.class and b/target/classes/io/github/hydos/ginger/engine/particle/ParticleMaster.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class b/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class index 4b8d5af..71cf27c 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class and b/target/classes/io/github/hydos/ginger/engine/particle/ParticleSystem.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/particle/ParticleTexture.class b/target/classes/io/github/hydos/ginger/engine/particle/ParticleTexture.class index 36e4970..597db99 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/particle/ParticleTexture.class and b/target/classes/io/github/hydos/ginger/engine/particle/ParticleTexture.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/MasterRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/MasterRenderer.class index fb2c2fc..a36c123 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/MasterRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/MasterRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/models/RawModel.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/models/RawModel.class index f57d586..1d4d018 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/models/RawModel.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/models/RawModel.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/models/TexturedModel.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/models/TexturedModel.class index 3375f05..a321529 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/models/TexturedModel.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/models/TexturedModel.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/EntityRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/EntityRenderer.class index dbbd301..610e647 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/EntityRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/EntityRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/FontRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/FontRenderer.class index 624d0c1..bf02534 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/FontRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/FontRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/GuiRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/GuiRenderer.class index ffdd324..ffc1293 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/GuiRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/GuiRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/NormalMappingRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/NormalMappingRenderer.class index e61df5f..bc24591 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/NormalMappingRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/NormalMappingRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/ParticleRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/ParticleRenderer.class index 304b3fc..adf2288 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/ParticleRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/ParticleRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/SkyboxRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/SkyboxRenderer.class index d63b2f4..0abde9d 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/SkyboxRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/SkyboxRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/TerrainRenderer.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/TerrainRenderer.class index 4472ab9..1736b6b 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/TerrainRenderer.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/renderers/TerrainRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/FontShader.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/FontShader.class index 578a549..e8b1a57 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/FontShader.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/FontShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/GuiShader.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/GuiShader.class index ce543c3..669cf8d 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/GuiShader.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/GuiShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/NormalMappingShader.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/NormalMappingShader.class index e23dbf9..89d7071 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/NormalMappingShader.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/NormalMappingShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ParticleShader.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ParticleShader.class index 94743b5..8ed3c38 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ParticleShader.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ParticleShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ShaderProgram.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ShaderProgram.class index 71e2e37..3bf1050 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ShaderProgram.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/ShaderProgram.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/SkyboxShader.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/SkyboxShader.class index 9e221d6..fce69b8 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/SkyboxShader.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/SkyboxShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/StaticShader.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/StaticShader.class index d86266e..2831f0b 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/StaticShader.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/StaticShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/TerrainShader.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/TerrainShader.class index 5f2a7b7..67b9af9 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/TerrainShader.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/shaders/TerrainShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/Image.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/Image.class index 69a5faf..ba5a820 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/Image.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/Image.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/ModelTexture.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/ModelTexture.class index b417ebc..754f1a6 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/ModelTexture.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/texture/ModelTexture.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/IOUtil.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/IOUtil.class index dcae783..4fb6d2d 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/IOUtil.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/IOUtil.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/MousePicker.class b/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/MousePicker.class index 45182d3..5a06df1 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/MousePicker.class and b/target/classes/io/github/hydos/ginger/engine/renderEngine/tools/MousePicker.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowBox.class b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowBox.class index e7b3af5..8aa78e9 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowBox.class and b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowBox.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowFrameBuffer.class b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowFrameBuffer.class index 1762709..38ade51 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowFrameBuffer.class and b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowFrameBuffer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.class b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.class index 21e8e9f..70e008d 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.class and b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapEntityRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapMasterRenderer.class b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapMasterRenderer.class index 789724e..1f93530 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapMasterRenderer.class and b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowMapMasterRenderer.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowShader.class b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowShader.class index dc0b068..8d969e5 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/shadow/ShadowShader.class and b/target/classes/io/github/hydos/ginger/engine/shadow/ShadowShader.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/terrain/Terrain.class b/target/classes/io/github/hydos/ginger/engine/terrain/Terrain.class index be87644..58bfa48 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/terrain/Terrain.class and b/target/classes/io/github/hydos/ginger/engine/terrain/Terrain.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexture.class b/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexture.class index a0cd12a..85829f0 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexture.class and b/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexture.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexturePack.class b/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexturePack.class index d1f05d1..42eff06 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexturePack.class and b/target/classes/io/github/hydos/ginger/engine/terrain/TerrainTexturePack.class differ diff --git a/target/classes/io/github/hydos/ginger/engine/utils/Loader.class b/target/classes/io/github/hydos/ginger/engine/utils/Loader.class index f5eb30b..e9b9adb 100644 Binary files a/target/classes/io/github/hydos/ginger/engine/utils/Loader.class and b/target/classes/io/github/hydos/ginger/engine/utils/Loader.class differ diff --git a/target/classes/shaders/shadowFragmentShader.glsl b/target/classes/shaders/shadowFragmentShader.glsl index 940bf31..f73b535 100644 --- a/target/classes/shaders/shadowFragmentShader.glsl +++ b/target/classes/shaders/shadowFragmentShader.glsl @@ -1,11 +1,16 @@ -#version 330 +#version 400 -out vec4 out_colour; +in vec2 textureCoords; -uniform sampler2D modelTexture;//will use this next week +out vec4 out_Colour; + +uniform sampler2D modelTexture; void main(void){ + float alpha = texture(modelTexture, textureCoords).a; + if(alpha < 0.5){ + discard; + } - out_colour = vec4(1.0); - -} \ No newline at end of file + out_Colour = vec4(1.0); +} diff --git a/target/classes/shaders/shadowVertexShader.glsl b/target/classes/shaders/shadowVertexShader.glsl index 99bf5f2..8977022 100644 --- a/target/classes/shaders/shadowVertexShader.glsl +++ b/target/classes/shaders/shadowVertexShader.glsl @@ -1,11 +1,16 @@ #version 150 in vec3 in_position; +in vec2 in_textureCoords; + +out vec2 textureCoords; uniform mat4 mvpMatrix; void main(void){ + textureCoords = in_textureCoords; + gl_Position = mvpMatrix * vec4(in_position, 1.0); -} \ No newline at end of file +} diff --git a/target/classes/shaders/terrainFragmentShader.glsl b/target/classes/shaders/terrainFragmentShader.glsl index 14df34f..e1de4f5 100644 --- a/target/classes/shaders/terrainFragmentShader.glsl +++ b/target/classes/shaders/terrainFragmentShader.glsl @@ -27,7 +27,7 @@ void main(void){ float objectNearestLight = texture(shadowMap, shadowCoords.xy).r; float lightFactor = 1.0; if(shadowCoords.z > objectNearestLight){ - lightFactor = 1.0 - 0.4; + lightFactor = 1.0 - (shadowCoords.w * 0.4); } vec4 blendMapColour = texture(blendMap, pass_textureCoords); diff --git a/target/classes/shaders/terrainVertexShader.glsl b/target/classes/shaders/terrainVertexShader.glsl index cd72a79..a18fa09 100644 --- a/target/classes/shaders/terrainVertexShader.glsl +++ b/target/classes/shaders/terrainVertexShader.glsl @@ -18,7 +18,9 @@ uniform vec3 lightPosition[5]; uniform mat4 toShadowMapSpace; const float density = 0.01; -const float gradient = 1; +const float gradient = 5; +const float shadowDistance = 150.0; +const float transitionDistance = 10.0; void main(void){ @@ -39,4 +41,9 @@ void main(void){ float distance = length(positionRelativeToCam.xyz); visibility = exp(-pow((distance * density), gradient)); visibility = clamp(visibility, 0.0, 1.0); + + distance = distance - (shadowDistance - transitionDistance); + distance = distance / transitionDistance; + shadowCoords.w = clamp(1.0-distance, 0.0, 1.0); + } diff --git a/target/ginger-NIGHTLY.jar b/target/ginger-NIGHTLY.jar index 83e860d..5766e09 100644 Binary files a/target/ginger-NIGHTLY.jar and b/target/ginger-NIGHTLY.jar differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties index 2f25a6d..2c5d033 100644 --- a/target/maven-archiver/pom.properties +++ b/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Tue May 28 12:07:06 AEST 2019 +#Tue May 28 17:00:00 AEST 2019 version=NIGHTLY groupId=me.hydos artifactId=ginger diff --git a/target/original-ginger-NIGHTLY.jar b/target/original-ginger-NIGHTLY.jar index 4187ae2..394a6ac 100644 Binary files a/target/original-ginger-NIGHTLY.jar and b/target/original-ginger-NIGHTLY.jar differ