|
![](/i/fill.gif) |
Christopher James Huff wrote:
> ...I
> suspect tracing the environment map will take as long or longer than
> just tracing reflected rays.
You're right for stills, but the speedup could be quite significant for
animations (if the environment map can be re-used). Tracing several rays
for _blurred_ reflections is quite expensive...
Warp wrote:
> What you are doing there is projecting the scene onto the surface of
> the object. That's not a reflection, not even close.
Sure, but you can project it onto a large, invisible (no_image,
no_reflection) sphere. Here's a short scene that does the trick:
Set renderEnvMap to true and save the image as "envmap.png" (It uses a
spherical camera).
Then set renderEnvMap to false and useEnvMap to true, be sure to correct
the path to the previously rendered image, change the filename (to not
overwrite the image-map) and render it to see the effect. Set useEnvMap
to false to compare it with true reflections.
You could use focal blur (while rendering the environment map) or
postprocessing to blur the image map. Alternatively you can use a
photograpy as enveronment map (I'd use a cube with six pictures instead
of the sphere then).
As Warp pointed out, this is just a fake, but if there are no other
objects too close to the reflecting object no one will notice it ;-)
#declare renderEnvMap = true;
#declare useEnvMap = false;
#if (!renderEnvMap)
camera {
location <0,15,-20>
look_at <0,3,0>
angle 50
}
#else
camera {
spherical
angle 360 180
location <0,3,0>
look_at <0,3,1>
}
#end
plane {
y, 0
pigment { checker rgb 1 rgb 0}
finish { ambient 0 diffuse 1 }
#if (useEnvMap) no_reflection #end
}
cylinder {
<-7,0,-2>,<-7,6,-2>,2
pigment { color rgb <1,0,0> }
finish { ambient 0 diffuse 1 specular 1 roughness 0.05 }
#if (useEnvMap) no_reflection #end
}
cone {
<7,0,-2>,2,<7,6,-2>,0
pigment { color rgb <0,0,1> }
finish { ambient 0 diffuse 1 specular 1 roughness 0.05 }
#if (useEnvMap) no_reflection #end
}
light_source { <-100,100,-100> color rgb 0.6 }
light_source { <100,10,-100> color rgb 0.3 }
light_source { <0,100,100> color rgb 0.9 }
#if (!renderEnvMap)
sphere {
<0,3,0>,3
finish { specular 5 roughness 0.002 reflection 1 }
}
#end
#if (useEnvMap)
sphere {
<0,0,0>,1
no_image
no_shadow
pigment { image_map { png "f:/envmap.png" map_type 1 }
rotate <0,-90,0> }
finish { ambient 1 }
scale 100
translate <0,3,0>
}
#end
Post a reply to this message
|
![](/i/fill.gif) |