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
SMAA.cpp File Reference
#include <format>
#include "galaxy/core/Config.hpp"
#include "galaxy/core/ServiceLocator.hpp"
#include "SMAA.hpp"
+ Include dependency graph for SMAA.cpp:

Go to the source code of this file.

Namespaces

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

Macros

#define AREATEX_WIDTH   160
 SMAA.cpp galaxy.
 
#define AREATEX_HEIGHT   560
 
#define AREATEX_PITCH   (AREATEX_WIDTH * 2)
 
#define AREATEX_SIZE   (AREATEX_HEIGHT * AREATEX_PITCH)
 
#define SEARCHTEX_WIDTH   64
 
#define SEARCHTEX_HEIGHT   16
 
#define SEARCHTEX_PITCH   SEARCHTEX_WIDTH
 
#define SEARCHTEX_SIZE   (SEARCHTEX_HEIGHT * SEARCHTEX_PITCH)
 

Variables

constexpr unsigned char smaa_search_tex []
 
constexpr unsigned char smaa_area_tex []
 
constexpr const char *const smaa_header_vert
 SMAA core vertex shader.
 
constexpr const char *const smaa_header_frag
 SMAA core fragment shader.
 
constexpr const char *const smaa_edge_vert
 SMAA edge vertex shader.
 
constexpr const char *const smaa_edge_frag
 SMAA edge frag shader.
 
constexpr const char *const smaa_blend_vert
 
constexpr const char *const smaa_blend_frag
 
constexpr const char *const smaa_neighbour_vert
 
constexpr const char *const smaa_neighbour_frag
 
constexpr const char *const smaa_core_part1
 
constexpr const char *const smaa_core_part2
 
constexpr const char *const smaa_core_part3
 
constexpr const char *const smaa_core_part4
 

Macro Definition Documentation

◆ AREATEX_WIDTH

#define AREATEX_WIDTH   160

SMAA.cpp galaxy.

Refer to LICENSE.txt for more details.

Definition at line 60 of file SMAA.cpp.

◆ AREATEX_HEIGHT

#define AREATEX_HEIGHT   560

Definition at line 61 of file SMAA.cpp.

◆ AREATEX_PITCH

#define AREATEX_PITCH   (AREATEX_WIDTH * 2)

Definition at line 62 of file SMAA.cpp.

◆ AREATEX_SIZE

#define AREATEX_SIZE   (AREATEX_HEIGHT * AREATEX_PITCH)

Definition at line 63 of file SMAA.cpp.

◆ SEARCHTEX_WIDTH

#define SEARCHTEX_WIDTH   64

Definition at line 65 of file SMAA.cpp.

◆ SEARCHTEX_HEIGHT

#define SEARCHTEX_HEIGHT   16

Definition at line 66 of file SMAA.cpp.

◆ SEARCHTEX_PITCH

#define SEARCHTEX_PITCH   SEARCHTEX_WIDTH

Definition at line 67 of file SMAA.cpp.

◆ SEARCHTEX_SIZE

#define SEARCHTEX_SIZE   (SEARCHTEX_HEIGHT * SEARCHTEX_PITCH)

Definition at line 68 of file SMAA.cpp.

Variable Documentation

◆ smaa_search_tex

unsigned char smaa_search_tex[]
constexpr

Definition at line 71 of file SMAA.cpp.

◆ smaa_area_tex

unsigned char smaa_area_tex[]
constexpr

Definition at line 160 of file SMAA.cpp.

◆ smaa_header_vert

const char* const smaa_header_vert
constexpr
Initial value:
= R"(
#version 460 core
#ifndef SMAA_PIXEL_SIZE
#define SMAA_PIXEL_SIZE vec2(1.0 / 800.0, 1.0 / 600.0)
#endif
#define SMAA_PRESET_ULTRA 1
#define SMAA_GLSL_4 1
#define SMAA_ONLY_COMPILE_VS 1
)"

SMAA core vertex shader.

Definition at line 15101 of file SMAA.cpp.

◆ smaa_header_frag

const char* const smaa_header_frag
constexpr
Initial value:
= R"(
#version 460 core
#ifndef SMAA_PIXEL_SIZE
#define SMAA_PIXEL_SIZE vec2(1.0 / 800.0, 1.0 / 600.0)
#endif
#define SMAA_PRESET_ULTRA 1
#define SMAA_GLSL_4 1
#define SMAA_ONLY_COMPILE_PS 1
)"

SMAA core fragment shader.

Definition at line 15116 of file SMAA.cpp.

◆ smaa_edge_vert

const char* const smaa_edge_vert
constexpr
Initial value:
= R"(
layout (location = 0) in vec2 l_pos;
layout (location = 1) in vec2 l_texels;
out vec2 texcoord;
out vec4 offset[3];
out vec4 dummy2;
void main()
{
texcoord = l_texels;
gl_Position = vec4(l_pos, 0.0, 1.0);
vec4 dummy1 = vec4(0);
SMAAEdgeDetectionVS(dummy1, dummy2, texcoord, offset);
}
)"

SMAA edge vertex shader.

Definition at line 15131 of file SMAA.cpp.

◆ smaa_edge_frag

const char* const smaa_edge_frag
constexpr
Initial value:
= R"(
in vec2 texcoord;
in vec4 offset[3];
in vec4 dummy2;
out vec4 frag_colour;
uniform sampler2D neighbour_tex;
void main()
{
#if SMAA_PREDICATION == 1
frag_colour = SMAAColorEdgeDetectionPS(texcoord, offset, neighbour_tex, depthTex);
#else
frag_colour = SMAAColorEdgeDetectionPS(texcoord, offset, neighbour_tex);
#endif
}
)"

SMAA edge frag shader.

Definition at line 15152 of file SMAA.cpp.

◆ smaa_blend_vert

const char* const smaa_blend_vert
constexpr
Initial value:
= R"(
layout (location = 0) in vec2 l_pos;
layout (location = 1) in vec2 l_texels;
out vec2 texcoord;
out vec2 pixcoord;
out vec4 offset[3];
out vec4 dummy2;
void main()
{
texcoord = l_texels;
gl_Position = vec4(l_pos, 0.0, 1.0);
vec4 dummy1 = vec4(0);
SMAABlendingWeightCalculationVS(dummy1, dummy2, texcoord, pixcoord, offset);
}
)"

Definition at line 15171 of file SMAA.cpp.

◆ smaa_blend_frag

const char* const smaa_blend_frag
constexpr
Initial value:
= R"(
in vec2 texcoord;
in vec2 pixcoord;
in vec4 offset[3];
in vec4 dummy2;
out vec4 frag_colour;
uniform sampler2D edge_tex;
uniform sampler2D area_tex;
uniform sampler2D search_tex;
void main()
{
frag_colour = SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edge_tex, area_tex, search_tex, ivec4(0));
}
)"

Definition at line 15190 of file SMAA.cpp.

◆ smaa_neighbour_vert

const char* const smaa_neighbour_vert
constexpr
Initial value:
= R"(
layout (location = 0) in vec2 l_pos;
layout (location = 1) in vec2 l_texels;
out vec2 texcoord;
out vec4 offset[2];
out vec4 dummy2;
void main()
{
texcoord = l_texels;
gl_Position = vec4(l_pos, 0.0, 1.0);
vec4 dummy1 = vec4(0);
SMAANeighborhoodBlendingVS(dummy1, dummy2, texcoord, offset);
}
)"

Definition at line 15208 of file SMAA.cpp.

◆ smaa_neighbour_frag

const char* const smaa_neighbour_frag
constexpr
Initial value:
= R"(
in vec2 texcoord;
in vec4 offset[2];
in vec4 dummy2;
out vec4 frag_colour;
uniform sampler2D neighbour_tex;
uniform sampler2D blend_tex;
void main()
{
frag_colour = SMAANeighborhoodBlendingPS(texcoord, offset, neighbour_tex, blend_tex);
}
)"

Definition at line 15226 of file SMAA.cpp.

◆ smaa_core_part1

const char* const smaa_core_part1
constexpr

Definition at line 15242 of file SMAA.cpp.

◆ smaa_core_part2

const char* const smaa_core_part2
constexpr

Definition at line 15392 of file SMAA.cpp.

◆ smaa_core_part3

const char* const smaa_core_part3
constexpr

Definition at line 15583 of file SMAA.cpp.

◆ smaa_core_part4

const char* const smaa_core_part4
constexpr

Definition at line 15793 of file SMAA.cpp.