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
; 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
}
UF中的这一光照特效,在UF中如何玩,我不知如何在UF中玩这个特效?