reb
Class REB_TrapShapeTobyGeometrixTexture
Object
common:Generic
common:TrapShape
reb:REB_TrapShapeTobyGeometrixTexture
class
- TrapShape:REB_TrapShapeTobyGeometrixTexture
This texture is derived from the code of Toby Marshall.
Ultra Fractal Source
Toggle UF Source Code Display
class REB_TrapShapeTobyGeometrixTexture(common.ulb:TrapShape) {
; This texture is derived from the code of Toby Marshall. <br>
public:
import "common.ulb"
; Constructor
func REB_TrapShapeTobyGeometrixTexture(Generic pparent)
TrapShape.TrapShape(pparent)
endfunc
; Call this for each iteration being trapped.
float func Iterate(complex pz)
TrapShape.Iterate(pz)
float zrzr = 0
float zizi = 0
float rzrz = 0
float iziz = 0
float r0r0 = 0
float i0i0 = 0
float r1r1 = 0
float i1i1 = 0
float azaz = 0
float bzbz = 0
float czcz = 0
float dzdz = 0
int iii = 0
float avav = 1
float xbxb = 1
float frfr = 0
float fifi = 0
float zaza = 0
float zzzz = 0
complex ptr = 0
complex tz = ((pz-@trxia)*@trxib)^@trxic
float x = real(tz)
float y = imag(tz)
if @trinit == 0
ptr = (@fntx11(@fntx10(tz))^@exad10)
elseif @trinit == 1
ptr = (@fntx10(real(tz))^@exad10+@fntx11(imag(tz))^@exad11)
elseif @trinit == 2
ptr = (@fntx10(real(tz))^@exad10-@fntx11(imag(tz))^@exad11)
elseif @trinit == 3
ptr = (@fntx10(real(tz))^@exad10*@fntx11(imag(tz))^@exad11)
elseif @trinit == 4
ptr = (@fntx10(imag(tz))^@exad10-@fntx11(real(tz))^@exad11)
elseif @trinit == 5
ptr = (@fntx11(@fntx10(x))^@exad10)
elseif @trinit == 6
ptr = (@fntx11(@fntx10(y))^@exad10)
elseif @trinit == 7
ptr = (@fntx10(x)^@exad10+@fntx11(y)^@exad11)
elseif @trinit == 8
ptr = (@fntx10(x)^@exad10-@fntx11(y)^@exad11)
elseif @trinit == 9
ptr = (@fntx11(y)^@exad11-@fntx10(x)^@exad10)
elseif @trinit == 10
ptr = (@fntx10(x)^@exad10*@fntx11(y)^@exad11)
elseif @trinit == 11
ptr = (@fntx10(x)^@exad10/@fntx11(y)^@exad11)
elseif @trinit == 12
ptr = (@fntx11(y)^@exad11/@fntx10(x)^@exad10)
elseif @trinit == 13
ptr = (@fntx10(x)^@exad10^@fntx11(y)^@exad11)
elseif @trinit == 14
ptr = (@fntx11(y)^@exad11^@fntx10(x)^@exad10)
elseif @trinit == 15
ptr = (@fntx10(x)^@exad10+@fntx11(tz)^@exad11)
elseif @trinit == 16
ptr = (@fntx10(x)^@exad10-@fntx11(tz)^@exad11)
elseif @trinit == 17
ptr = (@fntx11(tz)^@exad11-@fntx10(x)^@exad10)
elseif @trinit == 18
ptr = (@fntx10(x)^@exad10*@fntx11(tz)^@exad11)
elseif @trinit == 19
ptr = (@fntx10(x)^@exad10/@fntx11(tz)^@exad11)
elseif @trinit == 20
ptr = (@fntx11(tz)^@exad11/@fntx10(x)^@exad10)
elseif @trinit == 21
ptr = (@fntx10(y)^@exad10+@fntx11(tz)^@exad11)
elseif @trinit == 22
ptr = (@fntx10(y)^@exad10-@fntx11(tz)^@exad11)
elseif @trinit == 23
ptr = (@fntx11(tz)^@exad11-@fntx10(y)^@exad10)
elseif @trinit == 24
ptr = (@fntx10(y)^@exad10*@fntx11(tz)^@exad11)
elseif @trinit == 25
ptr = (@fntx10(y)^@exad10/@fntx11(tz)^@exad11)
elseif @trinit == 26
ptr = (@fntx11(tz)^@exad11/@fntx10(y)^@exad10)
endif
zrzr = real(@fnzr(ptr))*@scc
zizi = imag(@fnzi(ptr))*@scc
rzrz = floor(zrzr)
iziz = floor(zizi)
r0r0 = rzrz - 1
i0i0 = iziz - 1
r1r1 = rzrz + 1
i1i1 = iziz + 1
azaz = cabs(@fn1tx(r0r0) + @fn2tx(i0i0))
azaz = cabs(@fn3tx(azaz))
azaz = (azaz % @shad1 * 2)
bzbz = cabs(@fn1tx(r1r1) + @fn2tx(i0i0))
bzbz = cabs(@fn3tx(bzbz))
bzbz = (bzbz % @shad2 * 2)
czcz = cabs(@fn1tx(r1r1) + @fn2tx(i1i1))
czcz = cabs(@fn3tx(czcz))
czcz = (czcz % @shad3 * 2)
dzdz = cabs(@fn1tx(r0r0) + @fn2tx(i1i1))
dzdz = cabs(@fn3tx(dzdz))
dzdz = (dzdz % @shad4 * 2)
iii = 1
repeat
avav = avav / (@trp1 * 2)
xbxb = xbxb / (@trp2 * 2)
frfr = rzrz + avav
fifi = iziz + avav
zaza = (azaz + bzbz + czcz + dzdz) / (@trp3 * 4)
zzzz = zzzz * xbxb + zaza
if (zrzr > frfr)
if (zizi > fifi)
rzrz = frfr
iziz = fifi
azaz = zzzz
else
rzrz = frfr
dzdz = zzzz
endif
else
if (zizi > fifi)
iziz = fifi
bzbz = zzzz
else
czcz = zzzz
endif
endif
iii = iii + 1
until iii >= @freq
float texture_tr = (zaza-trunc(zaza*2)^@exp)
if @geo_limit != 0
texture_tr = ((zaza-trunc(zaza)^@exp*2)% @geo_limit)
endif
if @geo_sgn == true
texture_tr = abs(texture_tr)
endif
return texture_tr/5
endfunc
default:
title = "Toby's Geometrix Texture"
int param v_trapshapetobysgeometrixtexture
caption = "Version (Trap Shape Toby's Geometrix Texture)"
default = 101
hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used."
visible = @v_trapshapetobysgeometrixtexture < 101
endparam
param trinit
caption = "Geometrix Init"
enum = "z""real+imag(z)""real-imag(z)""real*imag(z)""imag-real(z)" \
"x""y""x+y""x-y""y-x""x/y""x*y""y/x""x^y""y^x""x+z""x-z""z-x""x*z" \
"x/z""z/x""y+z""y-z""z-y""y*z""y/z""z/y"
hint = "Determines which variable(s) initialize(s) the texture"
default = 0
endparam
func fntx10
caption = "Init Function 1"
default = ident()
hint = "Modifies the 1st variable defined in \
'Geometrix Initialization'"
endfunc
func fntx11
caption = "Init Function 2"
default = ident()
hint = "Modifies the 2nd variable defined in \
'Geometrix Initialization'"
endfunc
complex param trxia
caption = "Pattern 1"
default = (0.0,0.0)
visible = (@trinit < 5 || @trinit > 14 && @trinit < 21)
endparam
complex param trxib
caption = "Pattern 2"
default = (1.0,0.0)
visible = (@trinit < 5 || @trinit > 14 && @trinit < 21)
endparam
complex param trxic
caption = "Pattern 3"
default = (1.0,0.0)
visible = (@trinit < 5 || @trinit > 14 && @trinit < 21)
endparam
complex param exad10
caption = "Frequency 1"
default = (1.0,0.0)
hint = "Changes the pattern frequency by acting on the 1st (or only) \
variable defined in 'Geometrix Initialization'"
endparam
complex param exad11
caption = "Frequency 2"
default = (1.0,0.0)
hint = "Changes the pattern frequency by acting on the 2nd variable \
(when present) defined in 'Geometrix Initialization'"
visible = !(@trinit == 0 ||@trinit == 5 || @trinit == 6 ||\
@trinit == 21)
endparam
float param exp
caption = "Contrast"
default = 0.6
hint = "Higher values intensify the contrast between texture sections. If \
you find burned-out areas of texture try lowering this value"
endparam
float param scc
caption = "Density"
default = 1.0
hint = "Higher values create finer detail in the texture"
endparam
float param trp1
caption = "Scale"
default = 1
hint = "Densest texture is at '1'. Try other values and increase the \
'Density' value to achieve different texture patterns"
endparam
float param freq
caption = "Definition 1"
default = 10
hint = "Works interactively with other 'Definition' params. Higher values \
yield more texture definition and/or complexity"
endparam
float param trp2
caption = "Definition 2"
default = .7
hint = "Works interactively with other 'Definition' params. Lower values \
yield more texture definition"
endparam
float param trp3
caption = "Definition 3"
default = .7
hint = "Works interactively with other 'Definition' params. Higher values \
yield more texture definition"
endparam
float param shad1
caption = "Shading 1"
default = 1
hint = "Affects the shading of certain areas of texture"
endparam
float param shad2
caption = "Shading 2"
default = 1
hint = "Affects the shading of certain areas of texture"
endparam
float param shad3
caption = "Shading 3"
default = 1
hint = "Affects the shading of certain areas of texture"
endparam
float param shad4
caption = "Shading 4"
default = 1
hint = "Affects the shading of certain areas of texture"
endparam
func fnzr
caption = "Z function 1"
default = ident()
endfunc
func fnzi
caption = "Z function 2"
default = ident()
endfunc
func fn1tx
caption = "Real function"
default = sqrt()
endfunc
func fn2tx
caption = "Imag function"
default = ident()
endfunc
func fn3tx
caption = "Overall function"
default = asin()
endfunc
float param geo_limit
caption = "Geometrix Limit"
default = 0.0
hint = "Low values limit texture contrast. Zero is 'off'"
endparam
bool param geo_sgn
caption = "Soften Texture"
default = false
endparam
}
Method Summary |
float |
Iterate(complex pz)
Call this for each iteration being trapped. |
Methods inherited from class Object |
|
REB_TrapShapeTobyGeometrixTexture
public REB_TrapShapeTobyGeometrixTexture(Generic pparent)
- Constructor
REB_TrapShapeTobyGeometrixTexture
public REB_TrapShapeTobyGeometrixTexture()
Iterate
public float Iterate(complex pz)
- Call this for each iteration being trapped.
- Overrides:
Iterate
in class TrapShape