Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #@gui Rectexture : fx_rectexture, fx_rectexture(1)
- #@gui : note = note("Generates textures from rectangles, difference blending and warping.")
- #@gui : Recompute = button(0)
- #@gui : Iterations = int(10,0,500)
- #@gui : Colours = choice(3,"Random colours (difference blending)","Random colours (diffblend + sine mapping)","Random colours (diffblend + sinemap + random HSV mixing)","Black and white")
- #@gui : Warp Multiplier = float(1,0,5)
- #@gui : Warp Boundary = choice(5,"Random","Random [non-transparent]","Transparent","Nearest","Periodic", "Mirror")
- #@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]")
- #@gui : Value action = choice("None","Cut","Normalize")
- rectexture:
- -split_opacity -l[0]
- -if {$3==0}
- -fill_color[-1] ${-RGB}
- -elif {$3==1}
- -fill_color[-1] ${-RGB}
- -elif {$3==2}
- -fill_color[-1] ${-RGB}
- -else
- rr={255*round(u)}
- -fill_color[-1] $rr,$rr,$rr
- -endif
- -repeat {max(0,$2)}
- +fill_color 0,0,0
- -if {$3==0}
- -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB}
- -blend[-1,-2] difference
- -elif {$3==1}
- -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB}
- -blend[-1,-2] difference
- -elif {$3==2}
- -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,${-RGB}
- -blend[-1,-2] difference
- -else
- -rectangle[-1] {u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,{u(-50,150)}%,1,255,255,255
- -blend[-1,-2] difference
- -fi
- -done
- -if {$5==0}
- f={u(0,3)}
- -elif {$5==1}
- f={u(0,2)+1}
- -else
- f={($5)-2}
- -fi
- -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
- -if {$3==1}
- -normalize 0,{u(5,20)*pi} sin[-1] -n 0,255
- -fi
- -if {$3==2}
- -normalize 0,{u(5,20)*pi} sin[-1] -n 0,255
- mults=u(0,2.5)
- multv=u(0,2.5)
- -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
- -fi
- -endl a c
- fx_rectexture:
- index=0
- layers=l
- -repeat {max(0,$layers)}
- -ac[$index] "-rectexture $*",$-2,$-1
- index={$index+1}
- -done
Advertisement
Add Comment
Please, Sign In to add comment