mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Fixed shader examples
This commit is contained in:
parent
0f2fb0e2f6
commit
0e826d8dec
@ -6,15 +6,15 @@ void main()
|
|||||||
vec2 offx = vec2(offset, 0.0);
|
vec2 offx = vec2(offset, 0.0);
|
||||||
vec2 offy = vec2(0.0, offset);
|
vec2 offy = vec2(0.0, offset);
|
||||||
|
|
||||||
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 1 +
|
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 1.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy - offx) * 2 +
|
texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy + offx) * 2 +
|
texture2D(texture, gl_TexCoord[0].xy + offx) * 2.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy - offy) * 2 +
|
texture2D(texture, gl_TexCoord[0].xy - offy) * 2.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy + offy) * 2 +
|
texture2D(texture, gl_TexCoord[0].xy + offy) * 2.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1 +
|
texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1 +
|
texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1 +
|
texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
|
||||||
texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1;
|
texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
|
||||||
|
|
||||||
gl_FragColor = gl_Color * (pixel / 13.0);
|
gl_FragColor = gl_Color * (pixel / 13.0);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ uniform vec2 mouse;
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
float factor = 5 + 100 * length(mouse);
|
float factor = 5.0 + 100.0 * length(mouse);
|
||||||
vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
|
vec2 pos = floor(gl_TexCoord[0].xy * factor + 0.5) / factor;
|
||||||
|
|
||||||
gl_FragColor = texture2D(texture, pos) * gl_Color;
|
gl_FragColor = texture2D(texture, pos) * gl_Color;
|
||||||
|
Loading…
Reference in New Issue
Block a user