Guest User

Untitled

a guest
Feb 16th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import UIKit
  2. import ARKit
  3.  
  4. class EffectNodeHelper {
  5. static func getAlphaShader() -> SKShader {
  6. return SKShader(source: """
  7. void main() {
  8. vec2 texCoords = v_tex_coord;
  9. vec2 colorCoords = vec2(texCoords.x, texCoords.y);
  10. vec2 alphaCoords = vec2(texCoords.x, texCoords.y);
  11. vec4 color = texture2D(u_texture, colorCoords);
  12. float alpha = texture2D(u_texture, alphaCoords).r;
  13. gl_FragColor = vec4(color.rgb, alpha);
  14. }
  15. """)
  16. }
  17. }
Add Comment
Please, Sign In to add comment