forked from jaildesigner-jailgames/jaildoctors_dilemma
postfx subpixel
This commit is contained in:
@@ -338,9 +338,10 @@ auto OpenGLShader::init(SDL_Window* window,
|
||||
}
|
||||
|
||||
// Uniforms PostFX
|
||||
vignette_location_ = glGetUniformLocation(program_id_, "uVignette");
|
||||
scanlines_location_ = glGetUniformLocation(program_id_, "uScanlines");
|
||||
chroma_location_ = glGetUniformLocation(program_id_, "uChroma");
|
||||
vignette_location_ = glGetUniformLocation(program_id_, "uVignette");
|
||||
scanlines_location_ = glGetUniformLocation(program_id_, "uScanlines");
|
||||
chroma_location_ = glGetUniformLocation(program_id_, "uChroma");
|
||||
output_height_location_ = glGetUniformLocation(program_id_, "uOutputHeight");
|
||||
if (vignette_location_ != -1) { glUniform1f(vignette_location_, postfx_vignette_); }
|
||||
if (scanlines_location_ != -1) { glUniform1f(scanlines_location_, postfx_scanlines_); }
|
||||
if (chroma_location_ != -1) { glUniform1f(chroma_location_, postfx_chroma_); }
|
||||
@@ -446,6 +447,10 @@ void OpenGLShader::render() {
|
||||
glViewport(viewport_x, viewport_y, viewport_w, viewport_h);
|
||||
checkGLError("glViewport");
|
||||
|
||||
if (output_height_location_ != -1) {
|
||||
glUniform1f(output_height_location_, static_cast<float>(viewport_h));
|
||||
}
|
||||
|
||||
// Dibujar quad usando VAO
|
||||
glBindVertexArray(vao_);
|
||||
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, nullptr);
|
||||
|
||||
@@ -59,6 +59,7 @@ class OpenGLShader : public ShaderBackend {
|
||||
GLint vignette_location_ = -1;
|
||||
GLint scanlines_location_ = -1;
|
||||
GLint chroma_location_ = -1;
|
||||
GLint output_height_location_ = -1;
|
||||
|
||||
// Valores cacheados de PostFX
|
||||
float postfx_vignette_ = 0.6F;
|
||||
|
||||
Reference in New Issue
Block a user