|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I've lately been mulling over ideas about what's called 2.5D matte painting or
"2 and a half D" in the CG animation biz. Another term for it might be 'camera
projection' of an image. One of its uses is creating photo-real set extensions,
where the camera can move 'through the set' in a limited way, without showing
noticeable parallax distortion. I've been trying to come up with some idea of
how to make it work in POV-Ray--using the Screen.inc include file as a starting
point.
A precise, clear definition of '2.5D' is actually hard to find--it seems to be a
malleable description for various techniques, depending on the individual CG
artist. Haven't yet found much info about it on the web, although it's covered
in specialist books and DVDs.
The *basic* idea (AFAIU) is to project a photographic image onto 'simplified'
geometry--but in a way that the image shows no perspective foreshortening as the
object's own z-depth naturally recedes into the distance. A regular map_type 0
image_map projection in POV-Ray doesn't do that.
I had *some* success with my own code, but couldn't get the 'perspective
elimination' thing to work--which necessitated having to drastically alter an
image in Photoshop first, to eliminate its own perspective.
Then, much to my delight, I (re)-discovered Rune's ILLUSION.INC include file.
Found here...
http://runevision.com/3d/include/
It's an amazing tool! And does pretty much exactly what I was looking for. There
are only a few examples of its use in the newsgroups, all relating to still
images. But Rune's code also works (with caveats) for animation. You just feed
it an image, adjust a few parameters, and...magic! It works with multiple
objects, too. The power of this technique is two-fold: A rather crude object
can be made to look realistic and 'quasi-3D' in animation, with some (limited)
camera movement; and the applied photo can be used as-is, no laborious
reworking.
I've included some example renders. Parts of the applied image might appear to
be showing up on a thin tilted box--but it's actually overlaid onto the floor
plane! This whole topic is probably best illustrated by a simple animation, so
I'll post that too.
I made some changes to Rune's code, though (in a minor way)--parts of it seem to
be specifically for reproducing his sample POV-Ray file ('illusionsample.pov')
when they should be more generic; and the image rendered from the example looks
a bit confusing, not *visually* clear enough to show the code's real power.
As wonderful as the code is, it's not set up FOR animation (and probably wasn't
designed for that anyway, as the code *relies* on the camera position being
well-defined.) That is, a FREELY-moving camera introduces distortion into the
applied image--not really parallax distortion but something else. There's no
easy/quick solution in the parameter settings; but I'm giving that some thought,
to see what I can come up with. It *may* turn out to be very simple to fix.
Post a reply to this message
Attachments:
Download 'illusion_inc_example.jpg' (446 KB)
Preview of image 'illusion_inc_example.jpg'
|
|
| |
| |
|
|
From: Christian Froeschlin
Subject: Re: 2.5D 'matte painting'--using Rune's ILLUSION.INC
Date: 28 Jan 2013 20:22:25
Message: <51072451@news.povray.org>
|
|
|
| |
| |
|
|
Kenneth wrote:
> The *basic* idea (AFAIU) is to project a photographic image onto 'simplified'
> geometry--but in a way that the image shows no perspective foreshortening
Last weekend I was in the Escher Museum in The Hague and they had a
nice exhibit (not by Escher, I think, this was on the uppermost floor
where they show some related stuff about optical illusions) where a
builing was portrayed in this manner on a saw-tooth shaped surface, so
it looked like a normal image on a flat surface from the distance but
started to "move" and "distort" unexpectedly as you walked towards
it. Only when you got close and looked a bit from the side could
you see what was going on ;)
> That is, a FREELY-moving camera introduces distortion into the
> applied image--not really parallax distortion but something else.
Projecting the image is only half the solution, it seems to
me the critical thing is to define the correct geometry, so the
moving camera will create not just any kind of random distortion
but an approximation of the expected parallax distortion.
One way to go about this might be to paint a distance image over
the actual image in a graphics program, based on your estimated
object distance from scene content, then render as height field.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> As wonderful as the code is, it's not set up FOR animation (and probably
> wasn't designed for that anyway, as the code *relies* on the camera position
> being well-defined.) That is, a FREELY-moving camera introduces distortion
> into the applied image--not really parallax distortion but something else.
> There's no easy/quick solution in the parameter settings...
Well, I'm happy to admit that I was completely wrong about this (and my
apologies to Rune!) His code works as-is and wonderfully for animation, even
with a wildly-moving camera. The overlaid image and the objects continue to
match up--and with no *unexpected* distortion. The camera's location, look_at,
and even sky (for rotating the camera) all work with absolutely no problem...and
those changing variables don't even need to be plugged into his code! (That is,
once everything is initially set up at the camera's 'sweet spot' as illustrated
in my image post.) The final 'quasi-3D' result is really nice. I'm rather amazed
that a single image_map can do this.
I even *tried* to make things screw up; but Rune's code handled those attempts
with grace and aplomb. ;-)
When doing my initial tests of his code, I used a simple grid image, overlaid
onto some random shapes. In moving the camera, the visual result looked odd
(except at the 'sweet spot'), since the 'combined image overlay' no longer
looked square but trapezoidal; and I just *assumed* that by moving the camera I
had introduced some 'bad' distortion. But when I re-made the objects
accurately--and aligned them to the image--it turned out that what I was seeing
was in fact correct behavior.
Yes, the image_map *can* look somewhat distorted, when the camera moves way 'out
of bounds'. But that's no fault of Rune's code; it's a natural consequence of
the image_map's pixels having to 'stretch' to cover any perspective-receding
geometry in the scene, if the camera tries to look straight-on at those object
planes. (Yet the image is still nicely glued to the object.) So the usefulness
of the technique in animation requires a somewhat limited camera movement--but
not so limited as I originally thought, which is a really nice discovery. It can
all be judged by eye.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Christian Froeschlin <chr### [at] chrfrde> wrote:
>
> Last weekend I was in the Escher Museum in The Hague and they had a
> nice exhibit (not by Escher, I think, this was on the uppermost floor
> where they show some related stuff about optical illusions) where a
> builing was portrayed in this manner on a saw-tooth shaped surface, so
> it looked like a normal image on a flat surface from the distance but
> started to "move" and "distort" unexpectedly as you walked towards
> it. Only when you got close and looked a bit from the side could
> you see what was going on ;)
*That* would be something to see! I can't imagine what the visual effect would
be, though, seen in *true* 3-dimensions (unless you were to close one eye, to
eliminate the strange visual incongruity.) But that's probably what makes the
exhibit so fascinating.
>
>
> Projecting the image is only half the solution, it seems to
> me the critical thing is to define the correct geometry, so the
> moving camera will create not just any kind of random distortion
> but an approximation of the expected parallax distortion.
>
Yes indeed--as I found out ;-)
Post a reply to this message
|
|
| |
| |
|
|
From: Christian Froeschlin
Subject: Re: 2.5D 'matte painting'--using Rune's ILLUSION.INC
Date: 31 Jan 2013 19:05:28
Message: <510b06c8$1@news.povray.org>
|
|
|
| |
| |
|
|
Kenneth wrote:
> *That* would be something to see! I can't imagine what the visual effect would
> be, though, seen in *true* 3-dimensions
it occurred to me that such an object could probably be
produced using illusion.inc + mesh camera ... define sawtooth
shaped mesh, project image on it, render the texture of the mesh
as a rectangular strip, print, and fold ;)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I finally found a really good (free) description of 2.5D and its 'matte
painting' use. With a step-by-step tutorial.
http://janinepauke.blogspot.nl/2012/10/matte-painting-and-camera-mapping-in.html
A few more useful sites...
http://www.cgarchitect.com/2005/05/animated-camera-mapping-by-chris-bullen1
and
http://www.digitalurban.org/2010/01/camera-mapping-and-projection-new-york.html
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|