|
![](/i/fill.gif) |
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
> I think we both mean the same thing :-)
>
> As there is a lamp shade, I did not use a spotlight but simple point/area
> lights within a scattering media. However, in both cases, the halo effect is
> not really there like in the original, which is the reason for my emissive
> media around the light source.
>
> This is the media code I use for both halo and scattering:
>
> //====start code
> #local HaloScale = 100;
> #local colLum = rgb <1.0, 1.0, 0.9>; // light color
> #local haloTurb = 0.1; // outer halo turbulence
> #local haloStrength = 0.5; // inner and outer halo intensity
> (outer halo is 50% inner halo intensity)
> #local DensityShift = 0.6; //0.9 // shifts the density within the media
>
> #local DensityHalo =
> density {
> spherical
> turbulence haloTurb
> color_map {
> [0.4 rgb 0]
> [0.8 colLum*haloStrength*0.05]
> [1.0 colLum*haloStrength*0.5]
> }
> scale <1, 1, 1>
> translate DensityShift*y
> }
>
> #local mediaHalo =
> media {
> emission haloStrength*0.5
> intervals 1
> samples 100
> confidence 0.9999
> variance 1/10
> density {DensityHalo}
> }
In reality, scattering media will additionally scatter the light itself, which
is why it gets illuminated outside of the direct light cone. The scattering
media is not going to carry the light outside of the light cone (except maybe
with radiosity usage). What I did to try to simulate this in my theatre scene
was add light sources within my media. I ended up trying to tune a spotlight to
produce a similar illumination profile to the Henyey-Greenstein scattering
(actually a spot and a point as the spot will only cover the forward 180deg):
ecc=eccentricity for type 5 scattering
#local I0=1/(4*pi)*(1-pow(ecc,2))/pow(1+pow(ecc,2)-2*ecc,3/2); //base
intensity
#local I1=1/(4*pi)*(1-pow(ecc,2))/pow(1+pow(ecc,2),3/2); //maximum intensity
union{
light_source {0 //forward half of light scattering
rgb (I0-I1)
fade_power FP fade_distance FD
spotlight
point_at -y // lighting direction
radius 0 //use 0 for no hotspot
falloff 90 //use full 90deg, doesn't work past 90
tightness 6 //value of 6 is a good general relationship with ecc=0.6
area_light <0, LRAD, 0> <0, 0, LRAD> //area light parameters added to
soften if needed
2, 2
adaptive 1
circular orient jitter
}
light_source {0 //general base fill for scattering
rgb (I1)
fade_power FP fade_distance FD
area_light <0, LRAD, 0> <0, 0, LRAD>
2, 2
adaptive 1
circular orient jitter
}
I don't know how this will affect the media scattering as I turned off media
interaction in mine as I just wanted the general lighting, but it may give you
some ideas to start with.
-tgq
Post a reply to this message
|
![](/i/fill.gif) |