Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const float weights[9] = float[9](

void main()
{
vec2 coord = gl_FragCoord.xy * (1.0 / 256.0);
float uvstep = 1.0 / 256.0;
vec2 coord = floor(gl_FragCoord.xy) * (1.0 / 255.0);
float uvstep = 1.0 / 255.0;

vec4 res = vec4(0);

Expand Down
4 changes: 2 additions & 2 deletions shaders/src/main/glsl/samples/450/stable_sampler_loop.frag
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ uniform sampler2D tex;
void main()
{
int i = 0;
vec2 coord = gl_FragCoord.xy * (1.0 / 256.0);
vec2 coord = floor(gl_FragCoord.xy) * (1.0 / 255.0);
vec4 texel = texture(tex, coord);
while (texel.x + texel.y + texel.z > 1.0 && i < 16)
{
coord = texel.xz + texel.yy;
coord = floor(coord * 256.0) / 256.0;
coord = floor(coord * 255.0) / 255.0;
texel = texture(tex, coord);
i++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ uniform sampler2D tex;

void main()
{
_GLF_color = texture(tex, gl_FragCoord.xy * (1.0 / 256.0));
_GLF_color = texture(tex, floor(gl_FragCoord.xy) * (1.0 / 255.0));
}

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ uniform sampler2D tex;

void main()
{
vec2 coord = gl_FragCoord.xy * (1.0 / 256.0);
vec2 coord = floor(gl_FragCoord.xy) * (1.0 / 255.0);
vec4 res = vec4(0.25);
coord *= 2.0;
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ vec2 polarize(vec2 coord)

void main()
{
vec2 coord = gl_FragCoord.xy * (1.0 / 256.0);
vec2 coord = floor(gl_FragCoord.xy) * (1.0 / 255.0);
coord = polarize(coord);
coord = floor(coord * 256.0) / 256.0;
coord = floor(coord * 255.0) / 255.0;
_GLF_color = vec4(texture(tex, coord).xyz, 1.0);
}

Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ vec2 polarize(vec2 coord)

void main()
{
vec2 coord = gl_FragCoord.xy * (1.0 / 256.0);
vec2 coord = floor(gl_FragCoord.xy) * (1.0 / 255.0);

vec2 coord1 = polarize(coord + vec2(20.0 / 256.0, -80.0 / 256.0));
vec2 coord2 = polarize(coord + vec2(-60.0 / 256.0, 40.0 / 256.0));
vec2 coord1 = polarize(coord + vec2(20.0 / 255.0, -80.0 / 255.0));
vec2 coord2 = polarize(coord + vec2(-60.0 / 255.0, 40.0 / 255.0));
vec2 coord3 = polarize(coord);

coord = coord1 - coord2 + coord3;
coord = floor(coord * 256.0) / 256.0;
coord = floor(coord * 255.0) / 255.0;
_GLF_color = vec4(texture(tex, coord).xyz, 1.0);
}

4 changes: 2 additions & 2 deletions shaders/src/main/glsl/samples/450/stable_sampler_reuse.frag
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ uniform sampler2D tex;

void main()
{
vec3 texel = texture(tex, gl_FragCoord.xy * (1.0 / 256.0)).xyz;
vec3 texel = texture(tex, floor(gl_FragCoord.xy) * (1.0 / 255.0)).xyz;
vec2 reuse = (texel.xz + texel.yy) * 0.5 + vec2(0.25, 0.25);
reuse = floor(reuse * 256.0) / 256.0;
reuse = floor(reuse * 255.0) / 255.0;
_GLF_color = texture(tex, reuse);
}

6 changes: 3 additions & 3 deletions shaders/src/main/glsl/samples/450/stable_sampler_trace.frag
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ uniform sampler2D tex;
void main()
{
int i = 0;
vec2 uvstep = vec2(1.0) * (1.0 / 256.0);
float slope = 2.0 / 256.0;
vec2 coord = gl_FragCoord.xy * (1.0 / 256.0);
vec2 uvstep = vec2(1.0) * (1.0 / 255.0);
float slope = 2.0 / 255.0;
vec2 coord = floor(gl_FragCoord.xy) * (1.0 / 255.0);
float refh = texture(tex, coord).y;
coord -= uvstep;
refh += slope;
Expand Down