Guest User

AlphaCut

a guest
May 9th, 2020
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function init()
  2.     setName("Alpha Cut")
  3.     setDesc("Put Transparency into stuff")
  4.     setSize(100,18+18+24+64+8+8+7+4)
  5.     addOutput(24+32)
  6.     addInput("Texture",24+64+8+8)
  7.     addInput("Alpha",18+24+64+8+8)
  8.     addParameter("Cut","Lightness Cut",18+18+24+64+8+8,50,0,100)
  9. end
  10. -- Ugly way to use channels
  11. function apply()
  12.     math.randomseed (getValue(5,0,0,1))
  13.     x = 0
  14.     y = 0
  15.     tileSize = getTileSize()
  16.     for i=0, tileSize*tileSize-1 do
  17.         x = i%tileSize
  18.         y = math.floor(i/tileSize)
  19.         outr, outg, outb = getValue(0,x,y,1)
  20.         if (getValue(2,0,0,100) < getValue(1,x,y,1)) then
  21.             setPixel(0,x,y,outr,outg,outb)
  22.         end
  23.     end
  24.    
  25.    
  26. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×