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:
LaurentGom 2009-11-12 07:44:11 +00:00
parent 4c9f2e18cd
commit fb543957ee
2 changed files with 3 additions and 2 deletions

View File

@ -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 +
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) if (edge > threshold)
gl_FragColor.rgb = vec3(0, 0, 0); gl_FragColor.rgb = vec3(0, 0, 0);
else else

View File

@ -163,7 +163,7 @@ int main()
{ {
// Download a file from server // Download a file from server
std::string filename, directory; 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::cin >> filename;
std::cout << "Directory to download the file to: "; std::cout << "Directory to download the file to: ";
std::cin >> directory; std::cin >> directory;