From fb543957eefdb40edb13a5dcd05ea82ee1aa4657 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 12 Nov 2009 07:44:11 +0000 Subject: [PATCH] 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 --- samples/bin/datas/shader/edge.sfx | 3 ++- samples/ftp/Ftp.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/bin/datas/shader/edge.sfx b/samples/bin/datas/shader/edge.sfx index ce0d99c61..d944c5832 100644 --- a/samples/bin/datas/shader/edge.sfx +++ b/samples/bin/datas/shader/edge.sfx @@ -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 diff --git a/samples/ftp/Ftp.cpp b/samples/ftp/Ftp.cpp index c66fcf6ce..b0c001ecc 100644 --- a/samples/ftp/Ftp.cpp +++ b/samples/ftp/Ftp.cpp @@ -163,7 +163,7 @@ int main() { // Download a file from server std::string filename, directory; - std::cout << "filename of the file to download (relative to current directory): "; + std::cout << "Filename of the file to download (relative to current directory): "; std::cin >> filename; std::cout << "Directory to download the file to: "; std::cin >> directory;