Last active
December 18, 2019 19:44
-
-
Save quizcanners/c6e43393ab30245e79bf5fc3788841dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline float3 DetectSmoothEdge(float3 edge, float3 junkNorm, float3 sharpNorm, float3 edge0, float3 edge1, float3 edge2) { | |
edge = max(0, edge - 0.965) * 28; | |
float allof = edge.r + edge.g + edge.b; | |
float border = min(1, allof); | |
float3 edgeN = edge0*edge.r + edge1*edge.g + edge2*edge.b; | |
float junk = min(1, (edge.g*edge.b + edge.r*edge.b + edge.r*edge.g)*2); | |
return normalize((sharpNorm*(1 - border)+ border*edgeN)*(1 - junk) + junk*(junkNorm)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment