1
//============================================================================
5
// SS tttttt eeee ll ll aaaa
6
// SSSS tt ee ee ll ll aa
7
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
8
// SS SS tt ee ll ll aa aa
9
// SSSS ttt eeeee llll llll aaaaa
11
// Copyright (c) 1995-2010 by Bradford W. Mott, Stephen Anthony
12
// and the Stella Team
14
// See the file "License.txt" for information on usage and redistribution of
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
17
// $Id: GLShaderProgs.hxx 2001 2010-04-10 21:37:23Z stephena $
18
//============================================================================
20
#ifndef GL_SHADER_PROGS_HXX
21
#define GL_SHADER_PROGS_HXX
24
This code is generated using the 'create_shaders.pl' script,
25
located in the src/tools directory.
30
static const char* bleed_frag[] = {
31
"uniform sampler2D tex;\n"
34
"uniform float pWx2;\n"
38
" // Save current color\n"
39
" vec4 current = texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t));\n"
42
" // Comments for position are given in (x,y) coordinates with the current pixel as the origin\n"
45
" texture2D(tex, vec2(gl_TexCoord[0].s-pW, gl_TexCoord[0].t+pH))\n"
47
" + texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t+pH))\n"
49
" + texture2D(tex, vec2(gl_TexCoord[0].s+pW, gl_TexCoord[0].t+pH))\n"
51
" + texture2D(tex, vec2(gl_TexCoord[0].s-pW, gl_TexCoord[0].t))\n"
55
" + texture2D(tex, vec2(gl_TexCoord[0].s+pW, gl_TexCoord[0].t))\n"
57
" + texture2D(tex, vec2(gl_TexCoord[0].s-pW, gl_TexCoord[0].t-pH))\n"
59
" + texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t-pH))\n"
61
" + texture2D(tex, vec2(gl_TexCoord[0].s+pW, gl_TexCoord[0].t-pH))\n"
65
" + texture2D(tex, vec2(gl_TexCoord[0].s-pWx2, gl_TexCoord[0].t+pH))\n"
67
" + texture2D(tex, vec2(gl_TexCoord[0].s-pWx2, gl_TexCoord[0].t))\n"
69
" + texture2D(tex, vec2(gl_TexCoord[0].s-pWx2, gl_TexCoord[0].t-pH))\n"
71
" + texture2D(tex, vec2(gl_TexCoord[0].s+pWx2, gl_TexCoord[0].t+pH))\n"
73
" + texture2D(tex, vec2(gl_TexCoord[0].s+pWx2, gl_TexCoord[0].t))\n"
75
" + texture2D(tex, vec2(gl_TexCoord[0].s+pWx2, gl_TexCoord[0].t-pH))\n"
78
" // Make darker colors not bleed over lighter colors (act like light)\n"
79
" color = vec4(max(current.x, color.x), max(current.y, color.y), max(current.z, color.z), 1.0);\n"
81
" gl_FragColor = color;\n"
86
static const char* noise_frag[] = {
87
"uniform sampler2D tex;\n"
88
"uniform sampler2D mask;\n"
93
" texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
94
" + texture2D(mask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
100
static const char* phosphor_frag[] = {
101
"uniform sampler2D tex;\n"
102
"uniform sampler2D mask;\n"
107
" 0.65 * texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
108
" + 0.35 * texture2D(mask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
114
static const char* texture_frag[] = {
115
"uniform sampler2D tex;\n"
116
"uniform sampler2D mask;\n"
121
" texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
122
" * texture2D(mask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
130
static const char* texture_noise_frag[] = {
131
"uniform sampler2D tex;\n"
132
"uniform sampler2D texMask;\n"
133
"uniform sampler2D noiseMask;\n"
139
" texture2D(tex, vec2(gl_TexCoord[0].s, gl_TexCoord[0].t))\n"
140
" * texture2D(texMask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
144
" + texture2D(noiseMask, vec2(gl_TexCoord[1].s, gl_TexCoord[1].t))\n"
150
} // namespace GLShader