Project

General

Profile

Emulator Issues #12725 » 0integerscaling.glsl

taolas, 06/05/2022 09:15 PM

 
void main()
{
float4 c0 = Sample();
float2 rat = GetWindowResolution()/GetResolution();
float x = GetWindowResolution().x - GetResolution().x;
float y = GetWindowResolution().y - GetResolution().y;
float x1 = (x / 2.0) * GetInvWindowResolution().x;
float x2 = (GetWindowResolution().x - x / 2.0) * GetInvWindowResolution().x;
float y1 = (y / 2.0) * GetInvWindowResolution().y;
float y2 = (GetWindowResolution().y - y / 2.0) * GetInvWindowResolution().y;
if (GetCoordinates().x < x1 || x2 < GetCoordinates().x || GetCoordinates().y < y1 || y2 < GetCoordinates().y)
{
c0.r = 0.0;
c0.b = 0.0;
c0.g = 100.0;
}
else
{
float2 offset = ((GetCoordinates() * rat - float2(x1, y1) * rat));
c0 = SampleLocation(offset);
}
SetOutput(c0);
}
(1-1/5)