<commit_before>package flounder.post;

import flounder.engine.*;
import flounder.fbos.*;
import flounder.helpers.*;
import flounder.resources.*;
import flounder.shaders.*;

import static org.lwjgl.opengl.GL11.*;

/**
 * Represents a post effect shader and on application saves the result into a FBO.
 */
public abstract class PostFilter {
	public static final MyFile POST_LOC = new MyFile("flounder/post/filters");
	public static final MyFile VERTEX_LOCATION = new MyFile(POST_LOC, "defaultVertex.glsl");

	private static float[] POSITIONS = {0, 0, 0, 1, 1, 0, 1, 1};
	private static int VAO = FlounderEngine.getLoader().createInterleavedVAO(POSITIONS, 2);

	public ShaderProgram shader;
	public FBO fbo;

	public PostFilter(String filterName, MyFile fragmentShader) {
		this(new ShaderProgram(filterName, VERTEX_LOCATION, fragmentShader), FBO.newFBO(1.0f).create());
	}

	public PostFilter(ShaderProgram shader, FBO fbo) {
		this.shader = shader;
		this.fbo = fbo;
	}

	/**
	 * Renders the filter to its FBO.
	 *<commit_msg>Close to calculating shadows in deferred renderer, texture do not load right...<commit_after>package flounder.post;

import flounder.engine.*;
import flounder.fbos.*;
import flounder.helpers.*;
import flounder.resources.*;
import flounder.shaders.*;

import static org.lwjgl.opengl.GL11.*;

/**
 * Represents a post effect shader and on application saves the result into a FBO.
 */
public abstract class PostFilter {
	public static final MyFile POST_LOC = new MyFile("flounder/post/filters");
	public static final MyFile VERTEX_LOCATION = new MyFile(POST_LOC, "defaultVertex.glsl");

	private static float[] POSITIONS = {0, 0, 0, 1, 1, 0, 1, 1};
	private static int VAO = FlounderEngine.getLoader().createInterleavedVAO(POSITIONS, 2);

	public ShaderProgram shader;
	public FBO fbo;

	public PostFilter(String filterName, MyFile fragmentShader) {
		this(new ShaderProgram(filterName, VERTEX_LOCATION, fragmentShader), FBO.newFBO(1.0f).create());
	}

	public PostFilter(ShaderProgram shader) {
		this(shader, FBO.newFBO(1.0f).create());
	}

	public PostFilter(ShaderProgram shader, FBO fbo) {
		this.shader = shader;
		this.fbo = fbo;
	}

	/**
	 * Renders the filter to its FBO.
	 *
{'fraction_non_alphanumeric': 0.11378059836808703, 'fraction_numerical': 0.012692656391659111, 'mean_word_length': 4.838624338624339, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '344513', 'n_tokens_mistral': 782, 'n_tokens_neox': 715, 'n_words': 210}