galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
GammaCorrection.cpp File Reference
#include <glad/glad.h>
#include "galaxy/core/Config.hpp"
#include "galaxy/core/ServiceLocator.hpp"
#include "GammaCorrection.hpp"
+ Include dependency graph for GammaCorrection.cpp:

Go to the source code of this file.

Namespaces

namespace  galaxy
 Animated.cpp galaxy.
 
namespace  galaxy::graphics
 

Variables

constexpr const char *const gammacorrection_vert
 GammaCorrection.cpp galaxy.
 
constexpr const char *const gammacorrection_frag
 Gamma Correction fragment shader.
 

Variable Documentation

◆ gammacorrection_vert

const char* const gammacorrection_vert
constexpr
Initial value:
= R"(
#version 460 core
layout (location = 0) in vec2 l_pos;
layout (location = 1) in vec2 l_texels;
void main()
{
gl_Position = vec4(l_pos, 0.0, 1.0);
}
)"

GammaCorrection.cpp galaxy.

Refer to LICENSE.txt for more details. Basic vertex shader.

Definition at line 18 of file GammaCorrection.cpp.

◆ gammacorrection_frag

const char* const gammacorrection_frag
constexpr
Initial value:
= R"(
#version 460 core
out vec4 io_frag_colour;
uniform float u_gamma;
uniform sampler2D u_texture;
void main()
{
vec2 uv = gl_FragCoord.xy / textureSize(u_texture, 0).xy;
io_frag_colour = texture(u_texture, uv);
io_frag_colour.rgb = pow(io_frag_colour.rgb, vec3(1.0 / u_gamma));
}
)"

Gamma Correction fragment shader.

BSD 3-Clause License

Copyright (c) 2019, David Lettier All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition at line 62 of file GammaCorrection.cpp.