"great" engine example lol

pull/1/head
BuildTools 2019-05-28 07:51:31 +10:00
parent 99bdba59ca
commit fcd7c069b0
95 changed files with 954 additions and 166 deletions

View File

@ -53,22 +53,26 @@ public class Example {
TextMaster.init();
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));
ThirdPersonCamera camera = new ThirdPersonCamera(new Vector3f(0,0.1f,0), entity);
masterRenderer = new MasterRenderer(camera);
FontType font = new FontType(Loader.loadFontAtlas("candara.png"), "candara.fnt");
GUIText text = new GUIText("hi, this is some sample text", 3, font, new Vector2f(0,0), 1f, true);
text.setColour(0, 1, 0);
text.setBorderWidth(0.7f);
text.setBorderEdge(0.4f);
text.setOffset(new Vector2f(0.006f, 0.006f));
masterRenderer = new MasterRenderer();
text.setOffset(new Vector2f(0.003f, 0.003f));
ParticleMaster.init(masterRenderer.getProjectionMatrix());
TexturedModel tModel = ModelLoader.loadModel("stall.obj", "stallTexture.png");
tModel.getTexture().setReflectivity(1f);
tModel.getTexture().setShineDamper(7f);
TexturedModel dragonMdl = ModelLoader.loadModel("dragon.obj", "stallTexture.png");
dragonMdl.getTexture().setReflectivity(4f);
@ -76,8 +80,7 @@ public class Example {
Player entity = new Player(tModel, new Vector3f(0,0,-3),0,180f,0, new Vector3f(0.2f, 0.2f, 0.2f));
Light sun = new Light(new Vector3f(0,-0.5f,0), new Vector3f(1, 1, 1), new Vector3f(0.1f, 0.1f, 0.1f));
Light sun = new Light(new Vector3f(1000000,1500000,-1000000), new Vector3f(1.3f, 1.3f, 1.3f), new Vector3f(0f, 0f, 0f));
lights.add(sun);
TexturedModel tgrass = ModelLoader.loadModel("grass.obj", "grass.png");
@ -99,7 +102,7 @@ public class Example {
Entity grassEntity = new Entity(tgrass, new Vector3f(-3,terrain.getHeightOfTerrain(-3, -3),-3),0,180f,0, new Vector3f(0.2f, 0.2f, 0.2f));
entities.add(grassEntity);
ThirdPersonCamera camera = new ThirdPersonCamera(new Vector3f(0,0.1f,0), entity);
GuiTexture guiTexture = new GuiTexture(new ModelTexture("guis/ginger.png").getTextureID(), new Vector2f(0.5f,0.5f), new Vector2f(0.25f,0.25f));
guis.add(guiTexture);
@ -120,11 +123,14 @@ public class Example {
float colour = 0;
terrains.add(terrain);
GuiTexture shadowMap = new GuiTexture(masterRenderer.getShadowMapTexture(), new Vector2f(0.5f,0.5f), new Vector2f(0.5f,0.5f));
guis.add(shadowMap);
ParticleTexture particleTexture = new ParticleTexture(Loader.loadTexture("particles/smoke.png"), 8);
ParticleSystem system = new ParticleSystem(particleTexture, 50, 25, 0.3f, 4, 4f);
ParticleSystem system = new ParticleSystem(particleTexture, 100, 5f, 0.3f, 4, 4f);
system.randomizeRotation();
system.setDirection(new Vector3f(0,-0.001f,0), 0.01f);
system.setDirection(new Vector3f(0,0.001f,0), 0.00001f);
system.setLifeError(0);
system.setSpeedError(0);
system.setScaleError(1f);
@ -136,6 +142,10 @@ public class Example {
colour = colour + 0.001f;
picker.update();
ParticleMaster.update(camera);
sun.setPosition(new Vector3f(entity.getPosition().x, entity.getPosition().y + 4, entity.getPosition().z));
masterRenderer.renderShadowMap(entities, sun);
camera.move();
entity.move(terrain);
text.setOutlineColour(new Vector3f(colour, colour /2, colour / 3));
@ -144,7 +154,7 @@ public class Example {
if(terrainPoint!=null) {
barrel.setPosition(terrainPoint);
}
system.generateParticles(new Vector3f(0,0,0));
system.generateParticles(new Vector3f(0,-2,0));
dragon.increaseRotation(0,1,0);
barrel.increaseRotation(0, 1, 0);

View File

@ -23,6 +23,7 @@ import io.github.hydos.ginger.engine.renderEngine.renderers.TerrainRenderer;
import io.github.hydos.ginger.engine.renderEngine.shaders.GuiShader;
import io.github.hydos.ginger.engine.renderEngine.shaders.StaticShader;
import io.github.hydos.ginger.engine.renderEngine.shaders.TerrainShader;
import io.github.hydos.ginger.engine.shadow.ShadowMapMasterRenderer;
import io.github.hydos.ginger.engine.terrain.Terrain;
public class MasterRenderer {
@ -42,14 +43,16 @@ public class MasterRenderer {
private Matrix4f projectionMatrix;
private ShadowMapMasterRenderer shadowMapRenderer;
private Map<TexturedModel, List<Entity>> entities = new HashMap<TexturedModel, List<Entity>>();
private Map<TexturedModel, List<Entity>> normalMapEntities = new HashMap<TexturedModel, List<Entity>>();
private static final float FOV = 70f;
private static final float NEAR_PLANE = 0.1f;
public static final float FOV = 70f;
public static final float NEAR_PLANE = 0.1f;
private static final float FAR_PLANE = 1000f;
public MasterRenderer() {
public MasterRenderer(ThirdPersonCamera camera) {
createProjectionMatrix();
entityShader = new StaticShader();
entityRenderer = new EntityRenderer(entityShader, projectionMatrix);
@ -63,6 +66,8 @@ public class MasterRenderer {
terrainShader = new TerrainShader();
terrainRenderer = new TerrainRenderer(terrainShader, projectionMatrix);
shadowMapRenderer = new ShadowMapMasterRenderer(camera);
}
@ -142,10 +147,23 @@ public class MasterRenderer {
}
}
public void renderShadowMap(List<Entity> entityList, Light sun) {
for(Entity entity : entityList) {
processEntity(entity);
}
shadowMapRenderer.render(entities, sun);
entities.clear();
}
public int getShadowMapTexture() {
return shadowMapRenderer.getShadowMap();
}
public void cleanUp() {
entityShader.cleanUp();
terrainShader.cleanUp();
guiRenderer.cleanUp();
shadowMapRenderer.cleanUp();
normalRenderer.cleanUp();
}
@ -154,20 +172,19 @@ public class MasterRenderer {
return this.projectionMatrix;
}
private void createProjectionMatrix() {
float aspectRatio = (float) Window.width / Window.height;
float y_scale = (float) ((1f / Math.tan(Math.toRadians(FOV / 2f))) * aspectRatio);
float x_Scale = y_scale / aspectRatio;
private void createProjectionMatrix(){
projectionMatrix = new Matrix4f();
float aspectRatio = (float) Window.width / (float) Window.height;
float y_scale = (float) ((1f / Math.tan(Math.toRadians(FOV / 2f))));
float x_scale = y_scale / aspectRatio;
float frustum_length = FAR_PLANE - NEAR_PLANE;
projectionMatrix = new Matrix4f();
projectionMatrix.m00 = x_Scale;
projectionMatrix.m00 = x_scale;
projectionMatrix.m11 = y_scale;
projectionMatrix.m22 = -((FAR_PLANE + NEAR_PLANE) / frustum_length);
projectionMatrix.m23 = -1;
projectionMatrix.m32 = -((2* NEAR_PLANE * FAR_PLANE) / frustum_length);
projectionMatrix.m32 = -((2 * NEAR_PLANE * FAR_PLANE) / frustum_length);
projectionMatrix.m33 = 0;
}
}
}

View File

@ -0,0 +1,240 @@
package io.github.hydos.ginger.engine.shadow;
import io.github.hydos.ginger.engine.elements.ThirdPersonCamera;
import io.github.hydos.ginger.engine.io.Window;
import io.github.hydos.ginger.engine.mathEngine.matrixes.Matrix4f;
import io.github.hydos.ginger.engine.mathEngine.vectors.Vector3f;
import io.github.hydos.ginger.engine.mathEngine.vectors.Vector4f;
import io.github.hydos.ginger.engine.renderEngine.MasterRenderer;
/**
* Represents the 3D cuboidal area of the world in which objects will cast
* shadows (basically represents the orthographic projection area for the shadow
* render pass). It is updated each frame to optimise the area, making it as
* small as possible (to allow for optimal shadow map resolution) while not
* being too small to avoid objects not having shadows when they should.
* Everything inside the cuboidal area represented by this object will be
* rendered to the shadow map in the shadow render pass. Everything outside the
* area won't be.
*
*
*/
public class ShadowBox {
private static final float OFFSET = 10;
private static final Vector4f UP = new Vector4f(0, 1, 0, 0);
private static final Vector4f FORWARD = new Vector4f(0, 0, -1, 0);
private static final float SHADOW_DISTANCE = 100;
private float minX, maxX;
private float minY, maxY;
private float minZ, maxZ;
private Matrix4f lightViewMatrix;
private ThirdPersonCamera cam;
private float farHeight, farWidth, nearHeight, nearWidth;
/**
* Creates a new shadow box and calculates some initial values relating to
* the camera's view frustum, namely the width and height of the near plane
* and (possibly adjusted) far plane.
*
* @param lightViewMatrix
* - basically the "view matrix" of the light. Can be used to
* transform a point from world space into "light" space (i.e.
* changes a point's coordinates from being in relation to the
* world's axis to being in terms of the light's local axis).
* @param camera
* - the in-game camera.
*/
protected ShadowBox(Matrix4f lightViewMatrix, ThirdPersonCamera camera) {
this.lightViewMatrix = lightViewMatrix;
this.cam = camera;
calculateWidthsAndHeights();
}
/**
* Updates the bounds of the shadow box based on the light direction and the
* camera's view frustum, to make sure that the box covers the smallest area
* possible while still ensuring that everything inside the camera's view
* (within a certain range) will cast shadows.
*/
protected void update() {
Matrix4f rotation = calculateCameraRotationMatrix();
Vector3f forwardVector = new Vector3f(Matrix4f.transform(rotation, FORWARD, null));
Vector3f toFar = new Vector3f(forwardVector);
toFar.scale(SHADOW_DISTANCE);
Vector3f toNear = new Vector3f(forwardVector);
toNear.scale(MasterRenderer.NEAR_PLANE);
Vector3f centerNear = Vector3f.add(toNear, cam.getPosition(), null);
Vector3f centerFar = Vector3f.add(toFar, cam.getPosition(), null);
Vector4f[] points = calculateFrustumVertices(rotation, forwardVector, centerNear,
centerFar);
boolean first = true;
for (Vector4f point : points) {
if (first) {
minX = point.x;
maxX = point.x;
minY = point.y;
maxY = point.y;
minZ = point.z;
maxZ = point.z;
first = false;
continue;
}
if (point.x > maxX) {
maxX = point.x;
} else if (point.x < minX) {
minX = point.x;
}
if (point.y > maxY) {
maxY = point.y;
} else if (point.y < minY) {
minY = point.y;
}
if (point.z > maxZ) {
maxZ = point.z;
} else if (point.z < minZ) {
minZ = point.z;
}
}
maxZ += OFFSET;
}
/**
* Calculates the center of the "view cuboid" in light space first, and then
* converts this to world space using the inverse light's view matrix.
*
* @return The center of the "view cuboid" in world space.
*/
protected Vector3f getCenter() {
float x = (minX + maxX) / 2f;
float y = (minY + maxY) / 2f;
float z = (minZ + maxZ) / 2f;
Vector4f cen = new Vector4f(x, y, z, 1);
Matrix4f invertedLight = new Matrix4f();
Matrix4f.invert(lightViewMatrix, invertedLight);
return new Vector3f(Matrix4f.transform(invertedLight, cen, null));
}
/**
* @return The width of the "view cuboid" (orthographic projection area).
*/
protected float getWidth() {
return maxX - minX;
}
/**
* @return The height of the "view cuboid" (orthographic projection area).
*/
protected float getHeight() {
return maxY - minY;
}
/**
* @return The length of the "view cuboid" (orthographic projection area).
*/
protected float getLength() {
return maxZ - minZ;
}
/**
* Calculates the position of the vertex at each corner of the view frustum
* in light space (8 vertices in total, so this returns 8 positions).
*
* @param rotation
* - camera's rotation.
* @param forwardVector
* - the direction that the camera is aiming, and thus the
* direction of the frustum.
* @param centerNear
* - the center point of the frustum's near plane.
* @param centerFar
* - the center point of the frustum's (possibly adjusted) far
* plane.
* @return The positions of the vertices of the frustum in light space.
*/
private Vector4f[] calculateFrustumVertices(Matrix4f rotation, Vector3f forwardVector,
Vector3f centerNear, Vector3f centerFar) {
Vector3f upVector = new Vector3f(Matrix4f.transform(rotation, UP, null));
Vector3f rightVector = Vector3f.cross(forwardVector, upVector, null);
Vector3f downVector = new Vector3f(-upVector.x, -upVector.y, -upVector.z);
Vector3f leftVector = new Vector3f(-rightVector.x, -rightVector.y, -rightVector.z);
Vector3f farTop = Vector3f.add(centerFar, new Vector3f(upVector.x * farHeight,
upVector.y * farHeight, upVector.z * farHeight), null);
Vector3f farBottom = Vector3f.add(centerFar, new Vector3f(downVector.x * farHeight,
downVector.y * farHeight, downVector.z * farHeight), null);
Vector3f nearTop = Vector3f.add(centerNear, new Vector3f(upVector.x * nearHeight,
upVector.y * nearHeight, upVector.z * nearHeight), null);
Vector3f nearBottom = Vector3f.add(centerNear, new Vector3f(downVector.x * nearHeight,
downVector.y * nearHeight, downVector.z * nearHeight), null);
Vector4f[] points = new Vector4f[8];
points[0] = calculateLightSpaceFrustumCorner(farTop, rightVector, farWidth);
points[1] = calculateLightSpaceFrustumCorner(farTop, leftVector, farWidth);
points[2] = calculateLightSpaceFrustumCorner(farBottom, rightVector, farWidth);
points[3] = calculateLightSpaceFrustumCorner(farBottom, leftVector, farWidth);
points[4] = calculateLightSpaceFrustumCorner(nearTop, rightVector, nearWidth);
points[5] = calculateLightSpaceFrustumCorner(nearTop, leftVector, nearWidth);
points[6] = calculateLightSpaceFrustumCorner(nearBottom, rightVector, nearWidth);
points[7] = calculateLightSpaceFrustumCorner(nearBottom, leftVector, nearWidth);
return points;
}
/**
* Calculates one of the corner vertices of the view frustum in world space
* and converts it to light space.
*
* @param startPoint
* - the starting center point on the view frustum.
* @param direction
* - the direction of the corner from the start point.
* @param width
* - the distance of the corner from the start point.
* @return - The relevant corner vertex of the view frustum in light space.
*/
private Vector4f calculateLightSpaceFrustumCorner(Vector3f startPoint, Vector3f direction,
float width) {
Vector3f point = Vector3f.add(startPoint,
new Vector3f(direction.x * width, direction.y * width, direction.z * width), null);
Vector4f point4f = new Vector4f(point.x, point.y, point.z, 1f);
Matrix4f.transform(lightViewMatrix, point4f, point4f);
return point4f;
}
/**
* @return The rotation of the camera represented as a matrix.
*/
private Matrix4f calculateCameraRotationMatrix() {
Matrix4f rotation = new Matrix4f();
rotation.rotate((float) Math.toRadians(-cam.getYaw()), new Vector3f(0, 1, 0));
rotation.rotate((float) Math.toRadians(-cam.getPitch()), new Vector3f(1, 0, 0));
return rotation;
}
/**
* Calculates the width and height of the near and far planes of the
* camera's view frustum. However, this doesn't have to use the "actual" far
* plane of the view frustum. It can use a shortened view frustum if desired
* by bringing the far-plane closer, which would increase shadow resolution
* but means that distant objects wouldn't cast shadows.
*/
private void calculateWidthsAndHeights() {
farWidth = (float) (SHADOW_DISTANCE * Math.tan(Math.toRadians(MasterRenderer.FOV)));
nearWidth = (float) (MasterRenderer.NEAR_PLANE
* Math.tan(Math.toRadians(MasterRenderer.FOV)));
farHeight = farWidth / getAspectRatio();
nearHeight = nearWidth / getAspectRatio();
}
/**
* @return The aspect ratio of the display (width:height ratio).
*/
private float getAspectRatio() {
return (float) Window.width / (float) Window.height;
}
}

View File

@ -0,0 +1,133 @@
package io.github.hydos.ginger.engine.shadow;
import java.nio.ByteBuffer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import org.lwjgl.opengl.GL14;
import org.lwjgl.opengl.GL30;
import org.lwjgl.opengl.GL32;
import io.github.hydos.ginger.engine.io.Window;
/**
* The frame buffer for the shadow pass. This class sets up the depth texture
* which can be rendered to during the shadow render pass, producing a shadow
* map.
*
*
*/
public class ShadowFrameBuffer {
private final int WIDTH;
private final int HEIGHT;
private int fbo;
private int shadowMap;
/**
* Initialises the frame buffer and shadow map of a certain size.
*
* @param width
* - the width of the shadow map in pixels.
* @param height
* - the height of the shadow map in pixels.
*/
protected ShadowFrameBuffer(int width, int height) {
this.WIDTH = width;
this.HEIGHT = height;
initialiseFrameBuffer();
}
/**
* Deletes the frame buffer and shadow map texture when the game closes.
*/
protected void cleanUp() {
GL30.glDeleteFramebuffers(fbo);
GL11.glDeleteTextures(shadowMap);
}
/**
* Binds the frame buffer, setting it as the current render target.
*/
protected void bindFrameBuffer() {
bindFrameBuffer(fbo, WIDTH, HEIGHT);
}
/**
* Unbinds the frame buffer, setting the default frame buffer as the current
* render target.
*/
protected void unbindFrameBuffer() {
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
GL11.glViewport(0, 0, Window.width, Window.height);
}
/**
* @return The ID of the shadow map texture.
*/
protected int getShadowMap() {
return shadowMap;
}
/**
* Creates the frame buffer and adds its depth attachment texture.
*/
private void initialiseFrameBuffer() {
fbo = createFrameBuffer();
shadowMap = createDepthBufferAttachment(WIDTH, HEIGHT);
unbindFrameBuffer();
}
/**
* Binds the frame buffer as the current render target.
*
* @param frameBuffer
* - the frame buffer.
* @param width
* - the width of the frame buffer.
* @param height
* - the height of the frame buffer.
*/
private static void bindFrameBuffer(int frameBuffer, int width, int height) {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, frameBuffer);
GL11.glViewport(0, 0, width, height);
}
/**
* Creates a frame buffer and binds it so that attachments can be added to
* it. The draw buffer is set to none, indicating that there's no colour
* buffer to be rendered to.
*
* @return The newly created frame buffer's ID.
*/
private static int createFrameBuffer() {
int frameBuffer = GL30.glGenFramebuffers();
GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, frameBuffer);
GL11.glDrawBuffer(GL11.GL_NONE);
GL11.glReadBuffer(GL11.GL_NONE);
return frameBuffer;
}
/**
* Creates a depth buffer texture attachment.
*
* @param width
* - the width of the texture.
* @param height
* - the height of the texture.
* @return The ID of the depth texture.
*/
private static int createDepthBufferAttachment(int width, int height) {
int texture = GL11.glGenTextures();
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL14.GL_DEPTH_COMPONENT16, width, height, 0,
GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (ByteBuffer) null);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);
GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, texture, 0);
return texture;
}
}

View File

@ -0,0 +1,84 @@
package io.github.hydos.ginger.engine.shadow;
import java.util.List;
import java.util.Map;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL20;
import org.lwjgl.opengl.GL30;
import io.github.hydos.ginger.engine.elements.Entity;
import io.github.hydos.ginger.engine.mathEngine.Maths;
import io.github.hydos.ginger.engine.mathEngine.matrixes.Matrix4f;
import io.github.hydos.ginger.engine.renderEngine.models.RawModel;
import io.github.hydos.ginger.engine.renderEngine.models.TexturedModel;
public class ShadowMapEntityRenderer {
private Matrix4f projectionViewMatrix;
private ShadowShader shader;
/**
* @param shader
* - the simple shader program being used for the shadow render
* pass.
* @param projectionViewMatrix
* - the orthographic projection matrix multiplied by the light's
* "view" matrix.
*/
protected ShadowMapEntityRenderer(ShadowShader shader, Matrix4f projectionViewMatrix) {
this.shader = shader;
this.projectionViewMatrix = projectionViewMatrix;
}
/**
* Renders entieis to the shadow map. Each model is first bound and then all
* of the entities using that model are rendered to the shadow map.
*
* @param entities
* - the entities to be rendered to the shadow map.
*/
protected void render(Map<TexturedModel, List<Entity>> entities) {
for (TexturedModel model : entities.keySet()) {
RawModel rawModel = model.getRawModel();
bindModel(rawModel);
for (Entity entity : entities.get(model)) {
prepareInstance(entity);
GL11.glDrawElements(GL11.GL_TRIANGLES, rawModel.getVertexCount(),
GL11.GL_UNSIGNED_INT, 0);
}
}
GL20.glDisableVertexAttribArray(0);
GL30.glBindVertexArray(0);
}
/**
* Binds a raw model before rendering. Only the attribute 0 is enabled here
* because that is where the positions are stored in the VAO, and only the
* positions are required in the vertex shader.
*
* @param rawModel
* - the model to be bound.
*/
private void bindModel(RawModel rawModel) {
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
}
/**
* Prepares an entity to be rendered. The model matrix is created in the
* usual way and then multiplied with the projection and view matrix (often
* in the past we've done this in the vertex shader) to create the
* mvp-matrix. This is then loaded to the vertex shader as a uniform.
*
* @param entity
* - the entity to be prepared for rendering.
*/
private void prepareInstance(Entity entity) {
Matrix4f modelMatrix = Maths.createTransformationMatrix(entity.getPosition(),
entity.getRotX(), entity.getRotY(), entity.getRotZ(), entity.getScale());
Matrix4f mvpMatrix = Matrix4f.mul(projectionViewMatrix, modelMatrix, null);
shader.loadMvpMatrix(mvpMatrix);
}
}

View File

@ -0,0 +1,214 @@
package io.github.hydos.ginger.engine.shadow;
import java.util.List;
import java.util.Map;
import org.lwjgl.opengl.GL11;
import io.github.hydos.ginger.engine.elements.Entity;
import io.github.hydos.ginger.engine.elements.Light;
import io.github.hydos.ginger.engine.elements.ThirdPersonCamera;
import io.github.hydos.ginger.engine.mathEngine.matrixes.Matrix4f;
import io.github.hydos.ginger.engine.mathEngine.vectors.Vector2f;
import io.github.hydos.ginger.engine.mathEngine.vectors.Vector3f;
import io.github.hydos.ginger.engine.renderEngine.models.TexturedModel;
/**
* This class is in charge of using all of the classes in the shadows package to
* carry out the shadow render pass, i.e. rendering the scene to the shadow map
* texture. This is the only class in the shadows package which needs to be
* referenced from outside the shadows package.
*/
public class ShadowMapMasterRenderer {
private static final int SHADOW_MAP_SIZE = 2048;
private ShadowFrameBuffer shadowFbo;
private ShadowShader shader;
private ShadowBox shadowBox;
private Matrix4f projectionMatrix = new Matrix4f();
private Matrix4f lightViewMatrix = new Matrix4f();
private Matrix4f projectionViewMatrix = new Matrix4f();
private Matrix4f offset = createOffset();
private ShadowMapEntityRenderer entityRenderer;
/**
* Creates instances of the important objects needed for rendering the scene
* to the shadow map. This includes the {@link ShadowBox} which calculates
* the position and size of the "view cuboid", the simple renderer and
* shader program that are used to render objects to the shadow map, and the
* {@link ShadowFrameBuffer} to which the scene is rendered. The size of the
* shadow map is determined here.
*
* @param camera
* - the camera being used in the scene.
*/
public ShadowMapMasterRenderer(ThirdPersonCamera camera) {
shader = new ShadowShader();
shadowBox = new ShadowBox(lightViewMatrix, camera);
shadowFbo = new ShadowFrameBuffer(SHADOW_MAP_SIZE, SHADOW_MAP_SIZE);
entityRenderer = new ShadowMapEntityRenderer(shader, projectionViewMatrix);
}
/**
* Carries out the shadow render pass. This renders the entities to the
* shadow map. First the shadow box is updated to calculate the size and
* position of the "view cuboid". The light direction is assumed to be
* "-lightPosition" which will be fairly accurate assuming that the light is
* very far from the scene. It then prepares to render, renders the entities
* to the shadow map, and finishes rendering.
*
* @param entities
* - the lists of entities to be rendered. Each list is
* associated with the {@link TexturedModel} that all of the
* entities in that list use.
* @param sun
* - the light acting as the sun in the scene.
*/
public void render(Map<TexturedModel, List<Entity>> entities, Light sun) {
shadowBox.update();
Vector3f sunPosition = sun.getPosition();
Vector3f lightDirection = new Vector3f(-sunPosition.x, -sunPosition.y, -sunPosition.z);
prepare(lightDirection, shadowBox);
entityRenderer.render(entities);
finish();
}
/**
* This biased projection-view matrix is used to convert fragments into
* "shadow map space" when rendering the main render pass. It converts a
* world space position into a 2D coordinate on the shadow map. This is
* needed for the second part of shadow mapping.
*
* @return The to-shadow-map-space matrix.
*/
public Matrix4f getToShadowMapSpaceMatrix() {
return Matrix4f.mul(offset, projectionViewMatrix, null);
}
/**
* Clean up the shader and FBO on closing.
*/
public void cleanUp() {
shader.cleanUp();
shadowFbo.cleanUp();
}
/**
* @return The ID of the shadow map texture. The ID will always stay the
* same, even when the contents of the shadow map texture change
* each frame.
*/
public int getShadowMap() {
return shadowFbo.getShadowMap();
}
/**
* @return The light's "view" matrix.
*/
protected Matrix4f getLightSpaceTransform() {
return lightViewMatrix;
}
/**
* Prepare for the shadow render pass. This first updates the dimensions of
* the orthographic "view cuboid" based on the information that was
* calculated in the {@link SHadowBox} class. The light's "view" matrix is
* also calculated based on the light's direction and the center position of
* the "view cuboid" which was also calculated in the {@link ShadowBox}
* class. These two matrices are multiplied together to create the
* projection-view matrix. This matrix determines the size, position, and
* orientation of the "view cuboid" in the world. This method also binds the
* shadows FBO so that everything rendered after this gets rendered to the
* FBO. It also enables depth testing, and clears any data that is in the
* FBOs depth attachment from last frame. The simple shader program is also
* started.
*
* @param lightDirection
* - the direction of the light rays coming from the sun.
* @param box
* - the shadow box, which contains all the info about the
* "view cuboid".
*/
private void prepare(Vector3f lightDirection, ShadowBox box) {
updateOrthoProjectionMatrix(box.getWidth(), box.getHeight(), box.getLength());
updateLightViewMatrix(lightDirection, box.getCenter());
Matrix4f.mul(projectionMatrix, lightViewMatrix, projectionViewMatrix);
shadowFbo.bindFrameBuffer();
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
shader.start();
}
/**
* Finish the shadow render pass. Stops the shader and unbinds the shadow
* FBO, so everything rendered after this point is rendered to the screen,
* rather than to the shadow FBO.
*/
private void finish() {
shader.stop();
shadowFbo.unbindFrameBuffer();
}
/**
* Updates the "view" matrix of the light. This creates a view matrix which
* will line up the direction of the "view cuboid" with the direction of the
* light. The light itself has no position, so the "view" matrix is centered
* at the center of the "view cuboid". The created view matrix determines
* where and how the "view cuboid" is positioned in the world. The size of
* the view cuboid, however, is determined by the projection matrix.
*
* @param direction
* - the light direction, and therefore the direction that the
* "view cuboid" should be pointing.
* @param center
* - the center of the "view cuboid" in world space.
*/
private void updateLightViewMatrix(Vector3f direction, Vector3f center) {
direction.normalise();
center.negate();
lightViewMatrix.setIdentity();
float pitch = (float) Math.acos(new Vector2f(direction.x, direction.z).length());
Matrix4f.rotate(pitch, new Vector3f(1, 0, 0), lightViewMatrix, lightViewMatrix);
float yaw = (float) Math.toDegrees(((float) Math.atan(direction.x / direction.z)));
yaw = direction.z > 0 ? yaw - 180 : yaw;
Matrix4f.rotate((float) -Math.toRadians(yaw), new Vector3f(0, 1, 0), lightViewMatrix,
lightViewMatrix);
Matrix4f.translate(center, lightViewMatrix, lightViewMatrix);
}
/**
* Creates the orthographic projection matrix. This projection matrix
* basically sets the width, length and height of the "view cuboid", based
* on the values that were calculated in the {@link ShadowBox} class.
*
* @param width
* - shadow box width.
* @param height
* - shadow box height.
* @param length
* - shadow box length.
*/
private void updateOrthoProjectionMatrix(float width, float height, float length) {
projectionMatrix.setIdentity();
projectionMatrix.m00 = 2f / width;
projectionMatrix.m11 = 2f / height;
projectionMatrix.m22 = -2f / length;
projectionMatrix.m33 = 1;
}
/**
* Create the offset for part of the conversion to shadow map space. This
* conversion is necessary to convert from one coordinate system to the
* coordinate system that we can use to sample to shadow map.
*
* @return The offset as a matrix (so that it's easy to apply to other matrices).
*/
private static Matrix4f createOffset() {
Matrix4f offset = new Matrix4f();
offset.translate(new Vector3f(0.5f, 0.5f, 0.5f));
offset.scale(new Vector3f(0.5f, 0.5f, 0.5f));
return offset;
}
}

View File

@ -0,0 +1,32 @@
package io.github.hydos.ginger.engine.shadow;
import io.github.hydos.ginger.engine.mathEngine.matrixes.Matrix4f;
import io.github.hydos.ginger.engine.renderEngine.shaders.ShaderProgram;
public class ShadowShader extends ShaderProgram {
private static final String VERTEX_FILE = "shadowVertexShader.glsl";
private static final String FRAGMENT_FILE = "shadowFragmentShader.glsl";
private int location_mvpMatrix;
protected ShadowShader() {
super(VERTEX_FILE, FRAGMENT_FILE);
}
@Override
protected void getAllUniformLocations() {
location_mvpMatrix = super.getUniformLocation("mvpMatrix");
}
protected void loadMvpMatrix(Matrix4f mvpMatrix){
super.loadMatrix(location_mvpMatrix, mvpMatrix);
}
@Override
protected void bindAttributes() {
super.bindAttribute(0, "in_position");
}
}

View File

@ -0,0 +1,11 @@
#version 330
out vec4 out_colour;
uniform sampler2D modelTexture;//will use this next week
void main(void){
out_colour = vec4(1.0);
}

View File

@ -0,0 +1,11 @@
#version 150
in vec3 in_position;
uniform mat4 mvpMatrix;
void main(void){
gl_Position = mvpMatrix * vec4(in_position, 1.0);
}

View File

@ -0,0 +1,11 @@
#version 330
out vec4 out_colour;
uniform sampler2D modelTexture;//will use this next week
void main(void){
out_colour = vec4(1.0);
}

View File

@ -0,0 +1,11 @@
#version 150
in vec3 in_position;
uniform mat4 mvpMatrix;
void main(void){
gl_Position = mvpMatrix * vec4(in_position, 1.0);
}

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Mon May 27 11:04:14 AEST 2019
#Tue May 28 07:50:45 AEST 2019
version=NIGHTLY
groupId=me.hydos
artifactId=ginger

View File

@ -1,72 +1,79 @@
io\github\hydos\ginger\particle\Particle.class
io\github\hydos\ginger\terrain\TerrainTexture.class
io\github\hydos\ginger\renderEngine\shaders\SkyboxShader.class
io\github\hydos\ginger\mathEngine\matrixes\Matrix.class
io\github\hydos\ginger\mathEngine\vectors\Vector.class
io\github\hydos\ginger\elements\Entity.class
io\github\hydos\ginger\renderEngine\renderers\ParticleRenderer.class
io\github\hydos\ginger\obj\normals\VertexNM.class
io\github\hydos\ginger\mathEngine\vectors\Vector3f.class
io\github\hydos\ginger\font\GUIText.class
io\github\hydos\ginger\obj\normals\NormalMappedObjLoader.class
io\github\hydos\ginger\font\TextMeshData.class
io\github\hydos\ginger\io\Window.class
io\github\hydos\ginger\renderEngine\MasterRenderer.class
io\github\hydos\ginger\utils\Loader.class
io\github\hydos\ginger\mathEngine\matrixes\Matrix4f.class
io\github\hydos\ginger\obj\Vertex.class
io\github\hydos\ginger\elements\Player.class
io\github\hydos\ginger\mathEngine\vectors\ReadableVector2f.class
io\github\hydos\ginger\renderEngine\renderers\EntityRenderer.class
io\github\hydos\ginger\font\Line.class
io\github\hydos\ginger\renderEngine\renderers\SkyboxRenderer.class
io\github\hydos\ginger\mathEngine\vectors\ReadableVector3f.class
io\github\hydos\ginger\mathEngine\vectors\WritableVector2f.class
io\github\hydos\ginger\renderEngine\renderers\GuiRenderer.class
io\github\hydos\ginger\elements\FirstPersonCamera.class
io\github\hydos\ginger\particle\ParticleSystem.class
io\github\hydos\ginger\font\TextMeshCreator.class
io\github\hydos\ginger\mathEngine\vectors\Vector4f.class
io\github\hydos\ginger\engine\font\TextMeshCreator.class
io\github\hydos\ginger\engine\renderEngine\texture\Image.class
io\github\hydos\ginger\engine\terrain\TerrainTexture.class
io\github\hydos\ginger\engine\mathEngine\Maths.class
io\github\hydos\ginger\engine\utils\Loader.class
io\github\hydos\ginger\engine\mathEngine\Quaternion.class
io\github\hydos\ginger\engine\shadow\ShadowShader.class
io\github\hydos\ginger\engine\shadow\ShadowMapMasterRenderer.class
io\github\hydos\ginger\engine\renderEngine\renderers\EntityRenderer.class
io\github\hydos\ginger\engine\renderEngine\shaders\ParticleShader.class
io\github\hydos\ginger\engine\renderEngine\renderers\GuiRenderer.class
io\github\hydos\ginger\engine\renderEngine\models\TexturedModel.class
io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix2f.class
io\github\hydos\ginger\engine\mathEngine\vectors\WritableVector4f.class
io\github\hydos\ginger\engine\font\Word.class
io\github\hydos\ginger\engine\obj\ModelLoader.class
io\github\hydos\ginger\engine\elements\Light.class
io\github\hydos\ginger\engine\particle\Particle.class
io\github\hydos\ginger\engine\terrain\Terrain.class
io\github\hydos\ginger\engine\renderEngine\shaders\GuiShader.class
io\github\hydos\ginger\engine\elements\Entity.class
io\github\hydos\ginger\engine\font\Character.class
io\github\hydos\ginger\engine\mathEngine\vectors\WritableVector3f.class
io\github\hydos\ginger\engine\mathEngine\vectors\Vector.class
io\github\hydos\ginger\engine\renderEngine\texture\ModelTexture.class
io\github\hydos\ginger\engine\obj\OBJFileLoader.class
io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector4f.class
io\github\hydos\ginger\engine\renderEngine\tools\MousePicker.class
io\github\hydos\ginger\engine\particle\ParticleTexture.class
io\github\hydos\ginger\engine\renderEngine\shaders\ShaderProgram.class
io\github\hydos\ginger\engine\renderEngine\renderers\FontRenderer.class
io\github\hydos\ginger\Example.class
io\github\hydos\ginger\renderEngine\shaders\ShaderProgram.class
io\github\hydos\ginger\mathEngine\matrixes\Matrix3f.class
io\github\hydos\ginger\renderEngine\shaders\GuiShader.class
io\github\hydos\ginger\mathEngine\Quaternion.class
io\github\hydos\ginger\renderEngine\renderers\TerrainRenderer.class
io\github\hydos\ginger\font\Word.class
io\github\hydos\ginger\renderEngine\renderers\FontRenderer.class
io\github\hydos\ginger\terrain\TerrainTexturePack.class
io\github\hydos\ginger\font\MetaFile.class
io\github\hydos\ginger\renderEngine\tools\MousePicker.class
io\github\hydos\ginger\font\TextMaster.class
io\github\hydos\ginger\terrain\Terrain.class
io\github\hydos\ginger\renderEngine\texture\Image.class
io\github\hydos\ginger\renderEngine\shaders\FontShader.class
io\github\hydos\ginger\renderEngine\texture\ModelTexture.class
io\github\hydos\ginger\obj\OBJFileLoader.class
io\github\hydos\ginger\renderEngine\models\RawModel.class
io\github\hydos\ginger\renderEngine\shaders\ParticleShader.class
io\github\hydos\ginger\particle\ParticleMaster.class
io\github\hydos\ginger\renderEngine\shaders\NormalMappingShader.class
io\github\hydos\ginger\obj\ModelData.class
io\github\hydos\ginger\obj\ModelLoader.class
io\github\hydos\ginger\obj\normals\ModelDataNM.class
io\github\hydos\ginger\mathEngine\matrixes\Matrix2f.class
io\github\hydos\ginger\engine\mathEngine\vectors\Vector3f.class
io\github\hydos\ginger\engine\elements\FirstPersonCamera.class
io\github\hydos\ginger\engine\renderEngine\shaders\StaticShader.class
io\github\hydos\ginger\engine\renderEngine\shaders\FontShader.class
io\github\hydos\ginger\engine\particle\ParticleMaster.class
io\github\hydos\ginger\engine\io\Window.class
io\github\hydos\ginger\engine\elements\Player.class
io\github\hydos\ginger\engine\font\Line.class
io\github\hydos\ginger\engine\obj\normals\ModelDataNM.class
io\github\hydos\ginger\engine\guis\GuiTexture.class
io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector.class
io\github\hydos\ginger\engine\shadow\ShadowFrameBuffer.class
io\github\hydos\ginger\engine\font\MetaFile.class
io\github\hydos\ginger\engine\obj\normals\NormalMappedObjLoader.class
io\github\hydos\ginger\engine\obj\normals\VertexNM.class
io\github\hydos\ginger\engine\particle\ParticleSystem.class
io\github\hydos\ginger\engine\obj\ModelData.class
io\github\hydos\ginger\engine\obj\Vertex.class
io\github\hydos\ginger\engine\renderEngine\shaders\NormalMappingShader.class
io\github\hydos\ginger\engine\mathEngine\vectors\Vector4f.class
io\github\hydos\ginger\engine\particle\InsertionSort.class
io\github\hydos\ginger\engine\renderEngine\shaders\SkyboxShader.class
io\github\hydos\ginger\engine\elements\ThirdPersonCamera$1.class
io\github\hydos\ginger\engine\renderEngine\models\RawModel.class
io\github\hydos\ginger\engine\renderEngine\renderers\ParticleRenderer.class
io\github\hydos\ginger\engine\mathEngine\vectors\Vector2f.class
io\github\hydos\ginger\Starter.class
io\github\hydos\ginger\mathEngine\vectors\ReadableVector4f.class
io\github\hydos\ginger\renderEngine\models\TexturedModel.class
io\github\hydos\ginger\renderEngine\shaders\TerrainShader.class
io\github\hydos\ginger\mathEngine\vectors\WritableVector3f.class
io\github\hydos\ginger\elements\ThirdPersonCamera$1.class
io\github\hydos\ginger\mathEngine\vectors\WritableVector4f.class
io\github\hydos\ginger\renderEngine\shaders\StaticShader.class
io\github\hydos\ginger\guis\GuiTexture.class
io\github\hydos\ginger\elements\Light.class
io\github\hydos\ginger\elements\ThirdPersonCamera.class
io\github\hydos\ginger\renderEngine\tools\IOUtil.class
io\github\hydos\ginger\font\FontType.class
io\github\hydos\ginger\mathEngine\vectors\Vector2f.class
io\github\hydos\ginger\font\Character.class
io\github\hydos\ginger\mathEngine\Maths.class
io\github\hydos\ginger\mathEngine\vectors\ReadableVector.class
io\github\hydos\ginger\renderEngine\renderers\NormalMappingRenderer.class
io\github\hydos\ginger\engine\renderEngine\renderers\TerrainRenderer.class
io\github\hydos\ginger\engine\renderEngine\renderers\NormalMappingRenderer.class
io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix4f.class
io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix3f.class
io\github\hydos\ginger\engine\renderEngine\tools\IOUtil.class
io\github\hydos\ginger\engine\shadow\ShadowBox.class
io\github\hydos\ginger\engine\font\FontType.class
io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector2f.class
io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector3f.class
io\github\hydos\ginger\engine\mathEngine\vectors\WritableVector2f.class
io\github\hydos\ginger\engine\font\TextMaster.class
io\github\hydos\ginger\engine\terrain\TerrainTexturePack.class
io\github\hydos\ginger\engine\shadow\ShadowMapEntityRenderer.class
io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix.class
io\github\hydos\ginger\engine\renderEngine\shaders\TerrainShader.class
io\github\hydos\ginger\engine\renderEngine\renderers\SkyboxRenderer.class
io\github\hydos\ginger\engine\font\TextMeshData.class
io\github\hydos\ginger\engine\font\GUIText.class
io\github\hydos\ginger\engine\elements\ThirdPersonCamera.class
io\github\hydos\ginger\engine\renderEngine\MasterRenderer.class

View File

@ -1,71 +1,78 @@
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\WritableVector2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\GUIText.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\matrixes\Matrix.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\texture\Image.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\matrixes\Matrix2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\renderers\ParticleRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\terrain\TerrainTexture.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\io\Window.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\FontShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\Vector2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\TerrainShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\renderers\NormalMappingRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\elements\Entity.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\Quaternion.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\models\TexturedModel.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\renderers\SkyboxRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\models\RawModel.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\GuiShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\Line.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\renderers\TerrainRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\terrain\Terrain.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\obj\normals\NormalMappedObjLoader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\WritableVector3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\utils\Loader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\elements\Player.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\renderers\GuiRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\NormalMappingShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\terrain\TerrainTexture.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\FontType.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\renderers\SkyboxRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\terrain\Terrain.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\elements\Entity.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\tools\IOUtil.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\SkyboxShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\shadow\ShadowBox.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\obj\Vertex.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\GuiShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\ShaderProgram.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\tools\MousePicker.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\obj\OBJFileLoader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\renderers\EntityRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\elements\Player.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\obj\normals\VertexNM.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\renderers\ParticleRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\models\RawModel.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\MetaFile.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\particle\ParticleMaster.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\obj\ModelData.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\Vector3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\terrain\TerrainTexturePack.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\Example.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\particle\Particle.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\ReadableVector.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\StaticShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\texture\ModelTexture.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\renderers\EntityRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\ReadableVector2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\terrain\TerrainTexturePack.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\tools\MousePicker.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\MetaFile.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\obj\normals\VertexNM.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\obj\OBJFileLoader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\obj\ModelData.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\guis\GuiTexture.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\NormalMappingShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\Vector4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\obj\ModelLoader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\obj\normals\ModelDataNM.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\TextMaster.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\Vector.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\Character.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\Word.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\WritableVector2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\obj\normals\ModelDataNM.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\MasterRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\TerrainShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\Vector2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector2f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\Starter.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\renderers\FontRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\matrixes\Matrix4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\ReadableVector3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\TextMeshData.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\Maths.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\SkyboxShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\tools\IOUtil.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\elements\ThirdPersonCamera.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\elements\Light.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\particle\ParticleMaster.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\TextMeshCreator.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\MasterRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\renderers\GuiRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\Character.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\obj\Vertex.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\ParticleShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\FontType.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\WritableVector4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\ReadableVector4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\elements\FirstPersonCamera.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\font\Word.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\vectors\Vector3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\particle\ParticleSystem.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\renderEngine\shaders\ShaderProgram.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\mathEngine\matrixes\Matrix3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\elements\Light.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\WritableVector3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\obj\ModelLoader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\TextMeshCreator.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\Quaternion.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\elements\ThirdPersonCamera.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\utils\Loader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\particle\Particle.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\io\Window.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\particle\InsertionSort.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\TextMaster.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\GUIText.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\matrixes\Matrix3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\particle\ParticleSystem.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\ParticleShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\models\TexturedModel.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\renderers\TerrainRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\ReadableVector3f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\shadow\ShadowMapMasterRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\WritableVector4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\renderers\FontRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\shadow\ShadowFrameBuffer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\Maths.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\elements\FirstPersonCamera.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\texture\ModelTexture.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\renderers\NormalMappingRenderer.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\particle\ParticleTexture.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\StaticShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\shadow\ShadowShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\guis\GuiTexture.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\obj\normals\NormalMappedObjLoader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\TextMeshData.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\texture\Image.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\renderEngine\shaders\FontShader.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\font\Line.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\Vector.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\mathEngine\vectors\Vector4f.java
C:\Users\hayde\Desktop\dev\eclipse\ginger\src\main\java\io\github\hydos\ginger\engine\shadow\ShadowMapEntityRenderer.java

Binary file not shown.