47 lines
983 B
Java
47 lines
983 B
Java
package io.github.hydos.ginger.engine.postprocessing;
|
|
|
|
import org.lwjgl.opengl.*;
|
|
|
|
import io.github.hydos.ginger.engine.render.models.RawModel;
|
|
import io.github.hydos.ginger.engine.utils.Loader;
|
|
|
|
public class PostProcessing
|
|
{
|
|
private static final float[] POSITIONS =
|
|
{
|
|
-1, 1, -1, -1, 1, 1, 1, -1
|
|
};
|
|
private static RawModel quad;
|
|
private static ContrastChanger contrastChanger;
|
|
|
|
public static void init()
|
|
{
|
|
quad = Loader.loadToVAO(POSITIONS, 2);
|
|
contrastChanger = new ContrastChanger();
|
|
}
|
|
|
|
public static void doPostProcessing(int colourTexture)
|
|
{
|
|
start();
|
|
contrastChanger.render(colourTexture);
|
|
end();
|
|
}
|
|
|
|
public static void cleanUp()
|
|
{ contrastChanger.cleanUp(); }
|
|
|
|
private static void start()
|
|
{
|
|
GL30.glBindVertexArray(quad.getVaoID());
|
|
GL20.glEnableVertexAttribArray(0);
|
|
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
|
}
|
|
|
|
private static void end()
|
|
{
|
|
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
|
GL20.glDisableVertexAttribArray(0);
|
|
GL30.glBindVertexArray(0);
|
|
}
|
|
}
|