Commit ec83c6c8 authored by hunterk's avatar hunterk
Browse files

hopefully knock out the recursive macro problem for good

parent df17d344
......@@ -148,7 +148,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// delete all 'params.' or 'registers.' or whatever in the fragment
......
......@@ -109,7 +109,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// delete all 'params.' or 'registers.' or whatever in the fragment
......
......@@ -129,7 +129,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// delete all 'params.' or 'registers.' or whatever in the fragment
......
......@@ -114,7 +114,7 @@ COMPAT_VARYING vec4 TEX0;
// compatibility #defines
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// delete all 'params.' or 'registers.' or whatever in the fragment
......@@ -122,7 +122,7 @@ void main()
{
// Calculating texel coordinates
vec2 size = 4.0 * SourceSize.xy / INTERNAL_RES;
// vec2 size = X * (OutputSize.xy * SourceSize.zw) * SourceSize.xy;
// vec2 size = X * (outsize.xy * SourceSize.zw) * SourceSize.xy;
vec2 inv_size = 1.0 / size;
vec4 yx = vec4(inv_size, -inv_size);
......
......@@ -86,7 +86,7 @@ uniform COMPAT_PRECISION vec2 InputSize;
// compatibility #defines
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
#define vTexCoord TEX0.xy
void main()
......
......@@ -332,7 +332,7 @@ COMPAT_VARYING vec4 TEX0;
#define Source Texture
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......
......@@ -87,7 +87,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// delete all 'params.' or 'registers.' or whatever in the fragment
......
......@@ -87,7 +87,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// delete all 'params.' or 'registers.' or whatever in the fragment
......
shaders = "4"
shader0 = ../stock.glsl
shader1 = shaders/crt-interlaced-halation/crt-interlaced-halation-pass0.glsl
shader0 = shaders/crt-interlaced-halation/crt-interlaced-halation-pass0.glsl
filter_linear0 = "true"
float_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = shaders/crt-interlaced-halation/crt-interlaced-halation-pass1.glsl
filter_linear1 = "true"
float_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "1.000000"
scale_type_y1 = "source"
scale_y1 = "1.000000"
shader2 = shaders/crt-interlaced-halation/crt-interlaced-halation-pass1.glsl
shader2 = shaders/crt-interlaced-halation/crt-interlaced-halation-pass2.glsl
filter_linear2 = "true"
float_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_x2 = "3.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = shaders/crt-interlaced-halation/crt-interlaced-halation-pass2.glsl
scale_y2 = "3.000000"
shader3 = ../stock.glsl
filter_linear3 = "true"
float_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "3.000000"
scale_type_y3 = "source"
scale_y3 = "3.000000"
shader4 = ../stock.glsl
filter_linear4 = "true"
float_framebuffer4 = "false"
......@@ -81,7 +81,7 @@ uniform COMPAT_PRECISION vec2 InputSize;
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......@@ -100,7 +100,7 @@ void main()
c12 = vTexCoord + vec2(0.0, dy);
c22 = vTexCoord + vec2(dx, dy);
c32 = vTexCoord + vec2(2.0 * dx, dy);
mod_factor = vTexCoord.x * OutputSize.x;
mod_factor = vTexCoord.x * outsize.x;
ratio_scale = vTexCoord * SourceSize.xy;
}
......
......@@ -80,7 +80,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// delete all 'params.' or 'registers.' or whatever in the fragment
......
......@@ -79,7 +79,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......
......@@ -216,7 +216,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......@@ -277,7 +277,7 @@ void main()
diff = texture(Source, xy).rgb;
float rgb_max = max(col.r, max(col.g, col.b));
float sample_offset = (InputSize.y * OutputSize.w) * 0.5;
float sample_offset = (InputSize.y * outsize.w) * 0.5;
float scan_pos = xy.y * tex_size.y + scan_offset;
float scan_strength = mix(SCANLINE_STRENGTH_MAX, SCANLINE_STRENGTH_MIN, rgb_max);
float scan_beam = clamp(rgb_max * SCANLINE_BEAM_MAX, SCANLINE_BEAM_MIN, SCANLINE_BEAM_MAX);
......@@ -304,7 +304,7 @@ void main()
mask_stagger = mask_config.w;
mask_dither = fract(mask_config.x) * 10.0;
vec2 mod_fac = floor(vTexCoord * OutputSize.xy * SourceSize.xy / (InputSize.xy * vec2(MASK_SIZE, mask_dot_height * MASK_SIZE))) * 1.0001;
vec2 mod_fac = floor(vTexCoord * outsize.xy * SourceSize.xy / (InputSize.xy * vec2(MASK_SIZE, mask_dot_height * MASK_SIZE))) * 1.0001;
int dot_no = int(mod((mod_fac.x + mod(mod_fac.y, 2.0) * mask_stagger) / mask_dot_width, mask_colors));
float dither = mod(mod_fac.y + mod(floor(mod_fac.x / mask_colors), 2.0), 2.0);
......
......@@ -88,7 +88,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......
......@@ -94,7 +94,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......
......@@ -175,7 +175,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
// Set to 0 to use linear filter and gain speed
#define ENABLE_LANCZOS 1
......@@ -256,7 +256,7 @@ void main()
float scan_weight = 1.0 - pow(cos(vTexCoord.y * 2.0 * PI * SourceSize.y) * 0.5 + 0.5, scan_beam) * SCANLINE_STRENGTH;
float mask = 1.0 - MASK_STRENGTH;
vec2 mod_fac = floor(vTexCoord * OutputSize.xy * SourceSize.xy / (InputSize.xy * vec2(MASK_SIZE, MASK_DOT_HEIGHT * MASK_SIZE)));
vec2 mod_fac = floor(vTexCoord * outsize.xy * SourceSize.xy / (InputSize.xy * vec2(MASK_SIZE, MASK_DOT_HEIGHT * MASK_SIZE)));
int dot_no = int(mod((mod_fac.x + mod(mod_fac.y, 2.0) * MASK_STAGGER) / MASK_DOT_WIDTH, 3.0));
vec3 mask_weight;
......
......@@ -124,7 +124,7 @@ COMPAT_VARYING vec4 t3;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
#define CRTgamma 2.5
#define display_gamma 2.2
......
......@@ -124,7 +124,7 @@ COMPAT_VARYING vec4 t3;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
#define display_gamma 2.2
#define TEX2D(c) pow(texture(Source,(c)),vec4(display_gamma))
......
......@@ -59,9 +59,9 @@ precision mediump float;
#define PI 3.141592653589
#ifdef LINEAR_PROCESSING
# define TEX2D(c) pow(COMPAT_TEXTURE(Pass1Texture, (c)), vec4(CRTgamma))
# define TEX2D(c) pow(COMPAT_TEXTURE(OrigTexture, (c)), vec4(CRTgamma))
#else
# define TEX2D(c) COMPAT_TEXTURE(Pass1Texture, (c))
# define TEX2D(c) COMPAT_TEXTURE(OrigTexture, (c))
#endif
......@@ -204,12 +204,12 @@ uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 Pass1InputSize;
uniform COMPAT_PRECISION vec2 Pass1TextureSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 OrigTextureSize;
#define vTexCoord TEX0.xy
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......@@ -229,10 +229,10 @@ void main()
#endif
// The size of one texel, in texture-coordinates.
one = ilfac / Pass1TextureSize.xy;
one = ilfac / OrigTextureSize.xy;
// Resulting X pixel-coordinate of the pixel we're drawing.
mod_factor = vTexCoord.x * Pass1TextureSize.x * OutputSize.x / Pass1InputSize.x;
mod_factor = vTexCoord.x * OrigTextureSize.x * outsize.x / OrigInputSize.x;
}
......@@ -264,10 +264,10 @@ uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform COMPAT_PRECISION vec2 Pass1InputSize;
uniform COMPAT_PRECISION vec2 Pass1TextureSize;
uniform COMPAT_PRECISION vec2 OrigInputSize;
uniform COMPAT_PRECISION vec2 OrigTextureSize;
uniform sampler2D Texture;
uniform sampler2D Pass1Texture;
uniform sampler2D OrigTexture;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec2 one;
COMPAT_VARYING float mod_factor;
......@@ -281,7 +281,7 @@ COMPAT_VARYING vec2 cosangle;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......@@ -309,15 +309,15 @@ void main()
// Texture coordinates of the texel containing the active pixel.
#ifdef CURVATURE
vec2 cd = vTexCoord;
cd *= Pass1TextureSize / Pass1InputSize;
cd *= OrigTextureSize / OrigInputSize;
cd = (cd-vec2(0.5))*aspect*stretch.z+stretch.xy;
vec2 xy = (bkwtrans(cd, sinangle, cosangle)/overscan/aspect+vec2(0.5)) * Pass1InputSize / Pass1TextureSize;
vec2 xy = (bkwtrans(cd, sinangle, cosangle)/overscan/aspect+vec2(0.5)) * OrigInputSize / OrigTextureSize;
#else
vec2 xy = vTexCoord;
#endif
vec2 cd2 = xy;
cd2 *= Pass1TextureSize / Pass1InputSize;
cd2 *= OrigTextureSize / OrigInputSize;
cd2 = (cd2 - vec2(0.5)) * overscan + vec2(0.5);
cd2 = min(cd2, vec2(1.0)-cd2) * aspect;
vec2 cdist = vec2(cornersize);
......@@ -325,7 +325,7 @@ void main()
float dist = sqrt(dot(cd2,cd2));
float cval = clamp((cdist.x-dist)*cornersmooth,0.0, 1.0);
vec2 xy2 = ((xy*Pass1TextureSize / Pass1InputSize-vec2(0.5))*vec2(1.0,1.0)+vec2(0.5)) * InputSize / TextureSize;
vec2 xy2 = ((xy*OrigTextureSize / OrigInputSize-vec2(0.5))*vec2(1.0,1.0)+vec2(0.5)) * InputSize / TextureSize;
// Of all the pixels that are mapped onto the texel we are
// currently rendering, which pixel are we currently rendering?
vec2 ilfloat = vec2(0.0,ilfac.y > 1.5 ? mod(FrameCount,2.0) : 0.0);
......@@ -334,7 +334,7 @@ void main()
#ifdef OVERSAMPLE
//float filter = fwidth(ratio_scale.y);
float filter = InputSize.y / OutputSize.y;
float filter = InputSize.y / outsize.y;
#endif
vec2 uv_ratio = fract(ratio_scale);
......
......@@ -79,7 +79,7 @@ COMPAT_VARYING vec4 TEX0;
#define vTexCoord TEX0.xy
#define texture(c, d) COMPAT_TEXTURE(c, d)
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
#define outsize vec4(OutputSize, 1.0 / OutputSize)
void main()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment