Fixed the "edge" effect in the Shader sample
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1275 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
4c9f2e18cd
commit
fb543957ee
2 changed files with 3 additions and 2 deletions
|
@ -21,7 +21,8 @@ void main()
|
|||
texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
|
||||
texture2D(texture, gl_TexCoord[0].xy + offx + offy) * -1.0;
|
||||
|
||||
float edge = sqrt(hEdge.rgb * hEdge.rgb + vEdge.rgb * vEdge.rgb);
|
||||
vec3 result = sqrt(hEdge.rgb * hEdge.rgb + vEdge.rgb * vEdge.rgb);
|
||||
float edge = length(result);
|
||||
if (edge > threshold)
|
||||
gl_FragColor.rgb = vec3(0, 0, 0);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue