返回列表 回复 发帖

学习UF三角不等式着色效果

QQ截图20230311.jpg
快照9.jpg

http://www.inrm3d.cn/viewthread.php?tid=3086&extra=&highlight=&page=7
1# changxde


哇,太漂亮了。
UF_TIA.gsp (35.58 KB)

uf着色之-三角不等式平均法
此法榕老师研究过,这两天一直在研究,效果不好。希望大家共同研究。
Triangle {
;
; Variation on the Triangle Inequality Average coloring method
; from Kerry Mitchell. The smoothing used here is based on the
; Smooth formula, which only works for z^n+c and derivates.
;
; Written by Damien M. Jones
;
init:
  float sum = 0.0
  float sum2 = 0.0
  float ac = cabs(#pixel)
  float il = 1/log(@power)
  float lp = log(log(@bailout)/2.0)
  float az2 = 0.0
  float lowbound = 0.0
  float f = 0.0
  BOOL first = true
loop:
  sum2 = sum
  IF (!first)
    az2 = cabs(#z - #pixel)
    lowbound = abs(az2 - ac)
    sum = sum + ((cabs(#z) - lowbound) / (az2+ac - lowbound))
  ELSE
    first = false
  ENDIF
final:
  sum = sum / (#numiter)
  sum2 = sum2 / (#numiter-1)
  f = il*lp - il*log(log(cabs(#z)))
  #index = sum2 + (sum-sum2) * (f+1)  
default:
  title = "Triangle Inequality Average"
  helpfile = "Uf*.chm"
  helptopic = "Html/coloring/standard/triangleinequalityaverage.html"
  param power
    caption = "Exponent"
    default = 2.0
    hint = "This should be set to match the exponent of the \
            formula you are using. For Mandelbrot, this is usually 2."
  endparam
  param bailout
    caption = "Bailout"
    default = 1e20
    min = 1
$IFDEF VER40
    exponential = true
$ENDIF
    hint = "This should be set to match the bail-out value in \
            the Formula tab. Use a very high value for good results."
  endparam
}
1# changxde
真漂亮!这个效果我在dimensions第五、六章《复数》的简介页面中见过,其放大效果是立体的,今天见到画板版的,为常老师喝彩。
这是关于三角形着色图的一段视频,可能他将三角形着色参数sum/et加入了浮雕效果:http://115.com/file/an9dlh72#          提取码:an9dlh72
常老师还是你行,不服不行!
4# xiaongxp


提取不了啊。
J1.JPG
J3.jpg
向uf光照着色开刀:
Lighting {
;
; Coloring algorithm for the Slope family of fractal types.
; This coloring algorithm performs 3D lighting for these
; fractals.
;
; Written by Damien M. Jones
;
final:
  float vz = -sqrt(1-|#z|)                ; extract implied portion of normal
  float d2r = #pi/180                        ; degrees to radians conversion factor

  ; create vector for light direction
  float lx = cos((270-@angle)*d2r) * cos(@elevation*d2r)
  float ly = sin((270-@angle)*d2r) * cos(@elevation*d2r)
  float lz = -sin(@elevation*d2r)

  ; compute cosine of angle between these vectors
  ; (this is the amount of lighting on the surface)
  float l = lx*real(#z) + ly*imag(#z) + lz*vz
  IF (l < @ambient)                        ; light is below the ambient level
    l = @ambient                        ; set it to the ambient level
  ENDIF
  IF (@ambient < 0)                        ; the ambient level is negative
    l = l + 1                                ; offset to prevent clipping at 0
  ENDIF
  #index = l*0.99                        ; reduce it just a bit to prevent
                                          ; the colors from wrapping

default:
  title = "Lighting"
  helpfile = "Uf*.chm"
  helptopic = "Html/coloring/standard/lighting.html"
  heading
    text = "Tip: Combine with one of the Slope formulas"
  endheading

  param @angle
    caption = "Light Rotation"
    default = 90.0
    hint = "Gives the rotation of the light source, in degrees. With 0 \
            degrees, the light comes from above. Positive values give \
            clockwise rotation."
  endparam
  param @elevation
    caption = "Light Elevation"
    default = 30.0
    hint = "Gives the elevation of the light source, in degrees."
  endparam
  param @ambient
    caption = "Ambient Light"
    default = 0.0
    min = -1.0
    max = 1.0
    hint = "Specifies the level of ambient light.  Use -1.0 to \
            color all surfaces."
  endparam
}
float vz = -sqrt(1-|#z|)      
对这行不理解,按这种算法只有单位圆内有意义啊?
4# xiaongxp
提取不了啊。
榕坚 发表于 2012-3-2 19:30
对不起,忘记设为“分享”了。现在可以了。
返回列表