How did they acheive that cutout stencil effect in Katamari?

Started by
3 comments, last by chippolot 18 years, 1 month ago
You know when the character moves behind a large object and there's a shape cutout of it so you can still see your character? Any idea how that was done? Does it have something to do with a stencil buffer? Any ideas? Thanks
Advertisement
If I recall it wasn't a cutout, really, but a kind of silhouette. If it were up to me I'd do something like that using normal geometry and z-fail. There is a similar effect in Chibi Robo for gamecube. Dollars to donuts says they just draw the character once using z-pass, turn on tex-gen and set up an appropriate texture, and render the character again using z-fail.
Hm... I'm not quite clear what the terms "z-pass", "tex-gen", and "z-fail" mean... Haha... could you clarify those a bit for me?
I'll explain a step by step example, sans textures.

Lets say you have a sphere that is hiding halfway behind a wall.

1) Draw the wall in blue.
2) Set the depth test to 'pass on closer'.
3) Draw the sphere in red.

At this point you have a blue wall, with part of a red sphere showing from behind it.

4) Set the depth test to 'pass on further away'.
5) Draw the sphere in green.

By setting the depth test to pass on further away, the part of the sphere that is actually behind the wall will be drawn 'in front' of it. You'll now see half the sphere in red, where it is not behind the wall, and the other half in green, where it is behind the wall.
Haha! That's really cool. I had no idea you could change the depth test! Thanks so much!

This topic is closed to new replies.

Advertisement