 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Przemek Loesch wrote:
> Hi Sam!
Przemek,
I'm sorry my reply is late. I didn't see yours until today :)
<clip>
> and lower right is depth-map
> corrected by making difference with gray, to shift focal point to the
> middle.
Interesting trick.
> My only question to you is about applying blur: Is there any way to apply an
> effect selectively relative to gray map?
Yes, there is.
With my technique, I blurred only the depth map with the Gimp. With POV,
I used the blurred depth_map as a 'container' for the real image. You
can blur an image in POV by using the average pattern and a #while loop.
The blurred pattern is placed in another pigment_map which is inside the
depth_map.
It's a bit hard for me to explain, so here's a prototype:
#declare depth_map =
pigment{
image_map{
tga"depth_map.tga" interpolate 2 once
}
}
#declare actual_image =
pigment{
image_map{
tga"actual_image.tga" interpolate 2 once
}
}
#declare R = seed(0001);
#declare DOF=
pigment {
// our 'container'
pigment_pattern{depth_map}
pigment_map{
#local V=0;
#while(V<=1)
[V
// this blurs the image
average
pigment_map{
#local vv=0;
#while(vv<=V*255)
[1
actual_image
// the 'V/20' at the end of the line below is how
// we adaptively blur the image according to our
// depth_map
translate<rand(R)-rand(R),rand(R)-rand(R),0>*V/20
]
#local vv=vv+1;
#end
}
]
#local V=V+1/255;
#end
}
}
I hope this helps.
Good luck~
-Sam
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thank you Sam,
I see your technique is completely different than I thought. It may be very
useful if we try to make all things with POVRay. I still try to make it
purely in MegaPOV with matrixes defined for each point.
Przemek
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Przemek Loesch wrote:
> Thank you Sam,
> I see your technique is completely different than I thought. It may be very
> useful if we try to make all things with POVRay.
Yes, it would be nice. Since I have to pre-blur the depth_map, it would
be very difficult to do the whole effect with POV alone.
> I still try to make it
> purely in MegaPOV with matrixes defined for each point.
> Przemek
What does that do? Does it involve the matrix keyword?
-Sam
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Samuel Benge <stb### [at] hotmail com> wrote:
> What does that do? Does it involve the matrix keyword?
Not at all. I have never used "matrix" keyword but if I am not mistaken it
describes transformation of an object in 3D space. Actually I want to use
array[n][n], but technically it can be called matrix.
My idea is to create matrixes like this:
#declare array_for_single_point = array[5][5];
And then to fill this array with values based on depth map. The values are
scales for neighbours' colors.
For example - array for point which is exactly in focal distance looks like
this:
|0 0 0 0 0|
|0 0 0 0 0|
|0 0 25 0 0|
|0 0 0 0 0|
|0 0 0 0 0|
and for point which is completelly out of focus:
|1 1 1 1 1|
|1 1 1 1 1|
|1 1 1 1 1|
|1 1 1 1 1|
|1 1 1 1 1|
For all other points which are in between the values are in range 0-25.
The final value of color for the given point is averaged based on matrix
content.
I don't have any working code yet and even I'am not sure if it works like
this. If you are interested in please study "convolution_matrix.pov" and
"pprocess.inc" from MegaPov samples.
Przemek
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |