Vanishing point

offonoll's picture

Does anyone have an idea how to tranlate the vanishing point x,y,z? would be waesome to do something like this.

http://www.youtube.com/watch?v=w1StCGhmjvI&feature=player_embedded

benoitlahoz's picture
Re: Vanishing point

Very impressive...

Please consider my reply as a noobz one, but : isn't it the same system as a normal map ? So, maybe with a GLSL shader ?

[edit : off topic, oops... sorry]

gtoledo3's picture
Re: Vanishing point

That whole setup of how the normal stuff is happening, and carving 3D out of the 2D imagery is really interesting... I have to look at that more before it all sinks in. That's so cool, and I would love to understand more about how the process that they are doing that with.

...but the main thing (at least to me eye), besides that technique, is that there are characters that remain flat no matter what, and then the background seen seems to pan around via an accelerometer. This is a really quick and ugly mock up of a somewhat different approach to being able to "look behind" a character like this.

PreviewAttachmentSize
quick and ugly_GT.qtz841.28 KB

psonice's picture
Re: Vanishing point

I can say roughly how this is probably working, as I've done something very similar, purely in QC in the past.

Basically, the guy is painting a depth map to match the image, then the depth map is just used to modify the z coordinates of the vertices in a grid. I.e. it's a straight displacement map effect. This gives you a 3d model from the depth map, it's then textured normally. It's very easy in QC if you have a depth map, you just use a sampler in the vertex shader. On the ipad it's harder, because you can't use vertex samplers :( I guess they just do this in software as it's a static mesh. The characters are a separate object rendered with no fancy depth stuff.

Doing it with a normal map wouldn't work very well, something fancy like parallax occlusion mapping might look ok. But a displacement map would look better.

I'm actually working on a relaxed cone mapping shader just now, if I get it working I'll post up the .qtz. It's like parallax mapping, but much better :) (it's also resulted in frequent hard resets when I make a mistake.. ouch!)

memo's picture
Re: Vanishing point

yea this is bang on, though you should put the sprite inside the look at patch too, see attached.

To move the vanishing point, is simply moving the camera target, i.e. where the camera is looking at. So the Kineme look at patch is perfect. technically you could do it with the 3d transformation patch, but it would be tricky!

A normal map doesn't actually deform the mesh, just fakes the normals to trick the lighting to look like it's deformed. So if you rotate the camera you would see that its still flat. In the video, the image is being deformed by the heightmap drawn in, basically a heightfield, and then the foreground layer is plonked in front. Works really well.

PreviewAttachmentSize
quick and ugly_GT - 2.qtz841.37 KB

gtoledo3's picture
Re: Vanishing point

Nice, I see what you mean - the object actually is in the same environment. At first it didn't look like that to me, because they are all so uniformly at this kind of z=0 place where there isn't much offset at all when the pad rotates. Good tweak, that's better.

I knew the look at's params would map pretty easily to the accelerometer.

I was confused about the first comment on the thread about normals (yes, I do understand how this works and that it wouldn't work in the context of offsetting camera), but I guess I didn't really think about it too much. NOW I understand the very obvious aspect of what I was seeing... geez a heightmap to deform the 2D! That's just the kind of non-standard workaround I love!

It's an extremely similar concept to something I did with spherical panoramic heightmaps to make 3D environments out of photo as a gag on a B.B's look. I never considered applying at that way though. I'm kind of excited about this look! I love the "3D southpark/stage prop" look when rendered in actual 3D, and this is a really cool twist. Thanks for having shared this!

gtoledo3's picture
Re: Vanishing point

Totally see what you (and memo) below mean about the fact that the guy is making a depth map. It was obviously a depth map that he was drawing, and I was having a feebleminded moment. That's pretty exciting, because it wouldn't take much to polish this off and have that exact look basically. It's visually appealing for sure.

offonoll's picture
Re: Vanishing point

This is great!!! Can't wait to play with it! Let's see what I come out from this...

Thank you George and Memo!

offonoll's picture
Re: Vanishing point

Hi! I guess this is harder. By using look at, I am just translating the camera, same as using translate in 3D transform. By translating center camera in Look at, it rotates. If you watch the video, the first depth field and 4 corners are attached to the viewer. They don't rotate at all and neighter translate. Instead it just translates the ended vanishing point. I guess this has to be done in glsl. is it right?