Guest User

Untitled

a guest
Aug 26th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. #@gui Rectexture : fx_rectexture, fx_rectexture(1)
  2. #@gui : note = note("Generates textures from rectangles, difference blending and warping.")
  3. #@gui : Recompute = button(0)
  4. #@gui : Iterations = int(10,0,500)
  5. #@gui : Colours = choice(3,"Random colours (difference blending)","Random colours (diffblend + sine mapping)","Random colours (diffblend + sinemap + random HSV mixing)","Black and white")
  6. #@gui : Warp Multiplier = float(1,0,5)
  7. #@gui : Warp Boundary = choice(5,"Random","Random [non-transparent]","Transparent","Nearest","Periodic", "Mirror")
  8. #@gui : Channel(s) = choice(3,"All","RGBA [all]","RGB [all]","RGB [red]","RGB [green]","RGB [blue]","RGBA [alpha]","Linear RGB [all]","Linear RGB [red]","Linear RGB [green]","Linear RGB [blue]","YCbCr [luminance]","YCbCr [blue-red chrominances]","YCbCr [blue chrominance]","YCbCr [red chrominance]","YCbCr [green chrominance]","Lab [lightness]","Lab [ab-chrominances]","Lab [a-chrominance]","Lab [b-chrominance]","Lch [ch-chrominances]","Lch [c-chrominance]","Lch [h-chrominance]","HSV [hue]","HSV [saturation]","HSV [value]","HSI [intensity]","HSL [lightness]","CMYK [cyan]","CMYK [magenta]","CMYK [yellow]","CMYK [key]","YIQ [luma]","YIQ [chromas]")
  9. #@gui : Value action = choice("None","Cut","Normalize")
  10.  
  11. rectexture:
  12. -split_opacity -l[0]
  13.  
  14. -if {$3==0}
  15. -fill_color[-1] ${-RGB}
  16. -elif {$3==1}
  17. -fill_color[-1] ${-RGB}
  18. -elif {$3==2}
  19. -fill_color[-1] ${-RGB}
  20. -else
  21. rr={255*round(u)}
  22. -fill_color[-1] $rr,$rr,$rr
  23. -endif
  24. -repeat {max(0,$2)}
  25. +fill_color 0,0,0
  26. -if {$3==0}
  27. -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB}
  28. -blend[-1,-2] difference
  29. -elif {$3==1}
  30. -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB}
  31. -blend[-1,-2] difference
  32. -elif {$3==2}
  33. -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB}
  34. -blend[-1,-2] difference
  35. -else
  36. -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,255,255,255
  37. -blend[-1,-2] difference
  38. -fi
  39. -done
  40. -if {$5==0}
  41. f={u(0,3)}
  42. -elif {$5==1}
  43. f={u(0,2)+1}
  44. -else
  45. f={($5)-2}
  46. -fi
  47. -fx_warp_by_intensity {$4*(u(2)-1)},{$4*(u(2)-1)},{w*$4*(u(2)-1)},{h*$3*(u(2)-1)},0,0,{$f},0,0
  48. -if {$3==1}
  49. -normalize 0,{u(5,20)*pi} sin[-1] -n 0,255
  50. -fi
  51. -if {$3==2}
  52. -normalize 0,{u(5,20)*pi} sin[-1] -n 0,255
  53. mults=u(0,2.5)
  54. multv=u(0,2.5)
  55. -fx_mix_hsv {(2^u(0,2.5))-1},{u(-180,180)},0,{(2^$mults)-1},{max(0,2-(2^$mults))*u(-1,1)},0,{(2^$multv)-1},{max(0,2-(2^$multv))*u(-1,1)},0,0,2,0
  56. -fi
  57. -endl a c
  58.  
  59. fx_rectexture:
  60.  
  61. index=0
  62. layers=l
  63.  
  64. -repeat {max(0,$layers)}
  65. -ac[$index] "-rectexture $*",$-2,$-1
  66. index={$index+1}
  67. -done
Advertisement
Add Comment
Please, Sign In to add comment