Skip to content

Commit

Permalink
Tunning lcd3x
Browse files Browse the repository at this point in the history
  • Loading branch information
frangarcj committed Nov 23, 2016
1 parent 6e99e2e commit 73874af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ before_install:
- tar xjf *.tar.bz2
- export VITASDK=$PWD/vitasdk
- export PATH=$VITASDK/bin:$PATH
- wget https://releases.linaro.org/15.02/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf.tar.xz
- wget https://releases.linaro.org/archive/15.02/components/toolchain/binaries/arm-linux-gnueabihf/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf.tar.xz
- tar xf gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf.tar.xz
- export PATH=$(pwd)/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/bin:$PATH
- rm gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf.tar.xz
Expand Down
6 changes: 3 additions & 3 deletions shaders/crt_easymode_f.cg
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,18 @@ float4 main(uniform sampler2D tex : TEXUNIT0, float2 coords : TEXCOORD0, uniform
float bright = (max(col.r, max(col.g, col.b)) + luma) / 2.0;
float scan_bright = clamp(bright, SCANLINE_BRIGHT_MIN, SCANLINE_BRIGHT_MAX);
float scan_beam = clamp(bright * SCANLINE_BEAM_WIDTH_MAX, SCANLINE_BEAM_WIDTH_MIN, SCANLINE_BEAM_WIDTH_MAX);
float scan_weight = 1.0 - pow(cos(coords.y * 2.0 * PI * IN.texture_size.y) * 0.5 + 0.5, scan_beam) * SCANLINE_STRENGTH;
float scan_weight = 1.0 - pow(cos(coords.x * 2.0 * PI * IN.texture_size.x) * 0.5 + 0.5, scan_beam) * SCANLINE_STRENGTH;

float mask = 1.0 - MASK_STRENGTH;
float2 mod_fac = floor(coords * IN.output_size * IN.texture_size / (IN.video_size * float2(MASK_SIZE, MASK_DOT_HEIGHT * MASK_SIZE)));
int dot_no = int(fmod((mod_fac.x + fmod(mod_fac.y, 2.0) * MASK_STAGGER) / MASK_DOT_WIDTH, 3.0));
int dot_no = int(fmod((mod_fac.y + fmod(mod_fac.x, 2.0) * MASK_STAGGER) / MASK_DOT_WIDTH, 3.0));
float3 mask_weight;

if (dot_no == 0) mask_weight = float3(1.0, mask, mask);
else if (dot_no == 1) mask_weight = float3(mask, 1.0, mask);
else mask_weight = float3(mask, mask, 1.0);

if (IN.video_size.y >= SCANLINE_CUTOFF) scan_weight = 1.0;
if (IN.video_size.x >= SCANLINE_CUTOFF) scan_weight = 1.0;

col2 = col.rgb;
col *= float3(scan_weight);
Expand Down
5 changes: 2 additions & 3 deletions shaders/lcd3x_f.cg
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/

/* configuration (higher values mean brighter image but reduced effect depth) */
static const int brighten_scanlines = 16;
static const int brighten_lcd = 4;
static const int brighten_scanlines = 32;
static const int brighten_lcd = 12;


static const float3 offsets = 3.141592654 * float3(1.0/2,1.0/2 - 2.0/3,1.0/2-4.0/3);
Expand All @@ -32,4 +32,3 @@ float4 main (

return float4(color.x, color.y, color.z, 1.0);
}

0 comments on commit 73874af

Please sign in to comment.