mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 07:41:31 +11:00
Update powervr2.slang
This commit is contained in:
parent
125e1a2bb4
commit
1b161e80b4
|
@ -17,16 +17,14 @@ layout(push_constant) uniform Push
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
uint FrameCount;
|
uint FrameCount;
|
||||||
float INTERLACED, VGASIGNAL, LUMBOOST;
|
float INTERLACED, VGASIGNAL;
|
||||||
} params;
|
} params;
|
||||||
|
|
||||||
#pragma parameter INTERLACED "PVR - Interlace smoothing" 1.00 0.00 1.00 1.0
|
#pragma parameter INTERLACED "PVR - Interlace smoothing" 1.00 0.00 1.00 1.0
|
||||||
#pragma parameter VGASIGNAL "PVR - VGA signal loss" 0.00 0.00 1.00 1.0
|
#pragma parameter VGASIGNAL "PVR - VGA signal loss" 0.00 0.00 1.00 1.0
|
||||||
#pragma parameter LUMBOOST "PVR - Luminance gain" 0.35 0.00 1.00 0.01
|
|
||||||
|
|
||||||
#define INTERLACED params.INTERLACED
|
#define INTERLACED params.INTERLACED
|
||||||
#define VGASIGNAL params.VGASIGNAL
|
#define VGASIGNAL params.VGASIGNAL
|
||||||
#define LUMBOOST params.LUMBOOST
|
|
||||||
|
|
||||||
#define HW 1.00
|
#define HW 1.00
|
||||||
|
|
||||||
|
@ -76,8 +74,9 @@ void main()
|
||||||
// Blend vertically for composite mode
|
// Blend vertically for composite mode
|
||||||
if (bool(INTERLACED))
|
if (bool(INTERLACED))
|
||||||
{
|
{
|
||||||
int taps = int(8);
|
int taps = int(3);
|
||||||
float tap = 0.62/taps;
|
|
||||||
|
float tap = 2.0f/taps;
|
||||||
vec2 texcoord4 = vTexCoord;
|
vec2 texcoord4 = vTexCoord;
|
||||||
texcoord4.x = texcoord4.x;
|
texcoord4.x = texcoord4.x;
|
||||||
texcoord4.y = texcoord4.y + ((tap*(taps/2))/480.0f);
|
texcoord4.y = texcoord4.y + ((tap*(taps/2))/480.0f);
|
||||||
|
@ -85,19 +84,17 @@ void main()
|
||||||
int bl;
|
int bl;
|
||||||
vec4 ble;
|
vec4 ble;
|
||||||
|
|
||||||
|
ble.r = 0.00f;
|
||||||
|
ble.g = 0.00f;
|
||||||
|
ble.b = 0.00f;
|
||||||
|
|
||||||
for (bl=0;bl<taps;bl++)
|
for (bl=0;bl<taps;bl++)
|
||||||
{
|
{
|
||||||
texcoord4.y += (tap / 480.0f);
|
texcoord4.y += (tap / 480.0f);
|
||||||
ble.rgb += texture(Source, texcoord4).rgb / taps;
|
ble.rgb += texture(Source, texcoord4).rgb / taps;
|
||||||
}
|
}
|
||||||
|
|
||||||
color.rgb = color.rgb * 0.25 + ( ble.rgb * 0.75);
|
color.rgb = ( ble.rgb );
|
||||||
}
|
|
||||||
|
|
||||||
// Some games use a luminance boost (JSR etc)
|
|
||||||
if (bool(LUMBOOST))
|
|
||||||
{
|
|
||||||
color.rgb += (((color.r * LUM_R) + (color.g * LUM_G) + (color.b * LUM_B)) * LUMBOOST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dither. ALWAYS do this for 16bpp
|
// Dither. ALWAYS do this for 16bpp
|
||||||
|
|
Loading…
Reference in a new issue