[ 14 posts ]  Reply to topicPost new topic 
Anime Eyes Seen through Hair, Replicating the effect in Maya
Author Message
 [us]
 Post subject: Anime Eyes Seen through Hair
PostPosted: Sat Jun 24, 2017 10:15 am 
User avatar
Wafer-thin Animator
Member
[*]
[*]
[*]
Even though this is more of an animation question, I think it'll also benefit game developers who seek a solution for a similar problem.

Anyway, you know how anime characters have part of their eyes visible when obstructed by hair?
Image
Image

How do you replicate this effect in Maya or Blender? While I know that compositing is a reasonable option, the effect is rendered in real time in a game like the [i]Wind Waker[/img].
Image

By figuring this out, I can improve the quality of my Paper Mario puppets because I no longer have to layer parts with the Z Axis and prevent this from happening.
Image

I even tried finding a tutorial to fix this problem, but I didn't have much luck.

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Sat Jun 24, 2017 1:51 pm 
User avatar
C# Programmer
Member
[*]
[*]
[*]
[*]
What was the paper mario problem again? Was it related to flipping?


Here's a general game solution:

1) Draw all of body:
1a) Exceptions: Draw hair with a stencil value of s.
2) Draw eyes again, but only where the stencil buffer value is equal to s. Set ZTest=Always so the eyes will not be hidden by the hair. I'm not sure, but you may have to set ZWrite=Off, though you probably won't have a problem if you don't.

On the eye redraw, you can change the color blending and get the first pic . A normal redraw gets you the other pic examples.

You can draw other parts with the same stencil value if you want the eyes to show through them too.

I don't know the specific Blender or Maya solution, but look into stencil buffers.

_________________
MFGG TKO (scrapped) - Animations
Image
"It feels that time is better spent on original creations" - Konjak
Focus on the performance, the idea, not the technical bits or details - Milt Kahl
 
Top
Offline 
 
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Sat Jun 24, 2017 5:48 pm 
User avatar
Wafer-thin Animator
Member
[*]
[*]
[*]
The problem is that I want to reduce the spaces between each part as much as humanly possible. That way, if looking at the puppet from a different angle (i.e. an overhead view), it won't look so odd. The rub is that the best way to achieve it, which is having the parts share the same Z coordinates, will results in glitchy textures that won't look good for the final render. By cracking the secret of Toon Link's hair, I could effectively have parts get as close as they want without any side-effects.

So, I looked into stencil buffers and I'm not 100% certain about how they work. My only guess is that they behave similarly to how I handle the alpha when I work on the final render. In that case, I create an image that is all black and has white silhouettes of the parts.

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Sat Jun 24, 2017 6:49 pm 
User avatar
C# Programmer
Member
[*]
[*]
[*]
[*]
Here's a simpler idea. It doesn't solve the "eyes in front of hair" problem, but it does solve the visible spacing problem. Instead of layering by different Z depth values, just change your draw order. All pieces will have the same Z-depth, but the order they're drawn in determines their layering. You will have to set ZTest to "closer or equal" so pieces rendered at the same place are drawn in front. If you still need the "eyes in front of hair" thing, the above solution would work here too.

_________________
MFGG TKO (scrapped) - Animations
Image
"It feels that time is better spent on original creations" - Konjak
Focus on the performance, the idea, not the technical bits or details - Milt Kahl
 
Top
Offline 
 
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Sat Jun 24, 2017 7:09 pm 
User avatar
Wafer-thin Animator
Member
[*]
[*]
[*]
Actually, I only mentioned the "eyes in front of hair" problem because I feel like it best describes the effect I was going for regarding the puppet parts. My logic was if I was able to find out how they did it, I could apply a similar technique to my paper Mario puppets and reduce the dependency of the Z axis.

Anyway, while I doubt that you're familiar with Maya to give me a good answer, would you mind helping me search for how to effectively manipulating the draw order? I tried Google searching what you said, but no dice.

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Sat Jun 24, 2017 7:56 pm 
User avatar
C# Programmer
Member
[*]
[*]
[*]
[*]
Sure, but I'm currently playing DK Tropical Freeze, so I'll search later today.

edit:

I saw something about render layers and display layers, but creating a layer per piece seems tedious.

An alternative is to make a root transform. Its zScale should equal 1. Then construct mario as a child of the root with your current depth ordering setup. Before you render a scene, change the root transform's scale to zScale = .0001. That keeps your depth ordering while at least significantly reducing the spacing problem. It also means you can go back and edit each piece's depth by resetting zScale=1 then doing your normal edits.

I used to have maya so I know there is a node editor thing. Along with a root per character, you can also add a root for the entire scene. Then use constraints or the node editor to link each character's ZScale to the scene's ZScale. That means you only have to change 1 place to get rid of all character's spacing problems.

_________________
MFGG TKO (scrapped) - Animations
Image
"It feels that time is better spent on original creations" - Konjak
Focus on the performance, the idea, not the technical bits or details - Milt Kahl
 
Top
Offline 
 
 
 [zz]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Sat Jun 24, 2017 11:15 pm 
User avatar
Member
[*]
Are you sure that the eyebrows aren't just a different model separate from the main model, but attached to the character in the engine? I don't know hardly anything about 3D so that's my best guess.

 
Top
Offline 
 
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Sun Jun 25, 2017 7:48 am 
User avatar
Wafer-thin Animator
Member
[*]
[*]
[*]
I'm not entirely sure what you mean, P-Star7. If you're implying that the eyes and eyebrows of Toon Link are a separate model, then that's a reasonable assumption. That way, it's easier to apply certain programming to see them in a similar fashion to anime eyes if viewed through the hair.

TheShyGuy wrote:
I saw something about render layers and display layers, but creating a layer per piece seems tedious.

An alternative is to make a root transform. Its zScale should equal 1. Then construct mario as a child of the root with your current depth ordering setup. Before you render a scene, change the root transform's scale to zScale = .0001. That keeps your depth ordering while at least significantly reducing the spacing problem. It also means you can go back and edit each piece's depth by resetting zScale=1 then doing your normal edits.

I used to have maya so I know there is a node editor thing. Along with a root per character, you can also add a root for the entire scene. Then use constraints or the node editor to link each character's ZScale to the scene's ZScale. That means you only have to change 1 place to get rid of all character's spacing problems.

You mean scale the whole puppet down via the Z-Axis? I actually experimented with that feature before I considered writing this topic. While it works fine enough when the movement is limited to the X and Y-Axes (or the X and Y-Axes defined by the parent object), the problem arises when movement from the Z-Axis is involved. While I have no doubt that the basic "layering" functions I built into the rig work as intended, rotational movement that seep into Z coordinates (i.e. how Paratroopa wings animate) are badly distorted. Since this kind of scaling is handled by a NURBS curve I use as a universal scaling handle, an interesting solution is parenting the other parts to separate scaling system. The only downside is that it requires a lot of work and experimenting to have that scaling work properly with the main scaling (let alone the other controls). Since I'm applying a largely untested feature to a couple of parts, I think it's more trouble than it's worth.

EDIT: Since I use multiple NURBS curves for rigging purposes (i.e. parenting the parts to a NURBS curve), I tried scaling one of the "joints" down the Z-Axis. As it turned out, it worked better than I anticipated and offered no interference when rotating it freely. It's still a little impractical to apply it to every part (not to mention that I'm still uncertain as to whether or not scaling the parts like this cause any form of clipping); however, I'm willing to experiment with this breakthrough further. As of now, a smart idea is applying it only to the head since those are made of a lot of parts. As for the rest of the body, besides controlling the Z coordinates manually, fixing the layering problems for those parts is inconsequential.

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Mon Jun 26, 2017 5:12 pm 
User avatar
C# Programmer
Member
[*]
[*]
[*]
[*]
A long time ago, I remember mentioning to use projection. A projection is equivalent to just rendering the involved pieces to a texture. You'd have the normal Z-depth set up. Then, for pieces that are meant to be on the same plane, you'd project them onto a quad or subdivided quad. For pieces like wings that deform, you don't deform the pieces that make up the wing. You deform the quad that has the projected wing image on it.

Of course, then you'd have the problem where the topology of the quad may not be useful for the deformation you want. Ideally, I suppose you'd want the deformer mesh to have the same topology as the pieces...

Besides the topology problem, do you think the rest is reasonable? Or perhaps, should I elaborate on the stencil solution? Neither work for deformations, but they still solve the spacing problem.

_________________
MFGG TKO (scrapped) - Animations
Image
"It feels that time is better spent on original creations" - Konjak
Focus on the performance, the idea, not the technical bits or details - Milt Kahl
 
Top
Offline 
 
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Mon Jun 26, 2017 6:58 pm 
User avatar
Wafer-thin Animator
Member
[*]
[*]
[*]
Funny you should mention your projection method. I was actually considering it during some stages of development. Perhaps you could link the way to how I would achieve this in Maya? It's possibly my best bet now because the Scaling Z method is having some pieces clip through slightly. I don't know much about the method, but my assumption is setting up a camera elsewhere in the scene and using it to film a puppet I animate out of bonds. Then, what the camera is filming is projected onto a texture and I go from there; however, if the method is actually filming the puppet in a separate file and exporting the mages as a sequence onto a plane, then I won't bother. It's nothing personal, but I don't want to hop files just to make adjustments. In fact, that was why I developed the concept for my custom animation software in the first place.

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Mon Jun 26, 2017 7:31 pm 
User avatar
C# Programmer
Member
[*]
[*]
[*]
[*]
Yeah, that's right. The method doesn't, or at least shouldn't, require saving to a file.

I no longer have Maya, but I'll try to find a solution with Blender. Though, if you're only interested in the proof of concept, it'd be easiest for me to do it in Unity and send you the executable. If you need a Blender example, then it will take me some time to figure out.

_________________
MFGG TKO (scrapped) - Animations
Image
"It feels that time is better spent on original creations" - Konjak
Focus on the performance, the idea, not the technical bits or details - Milt Kahl
 
Top
Offline 
 
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Tue Jun 27, 2017 5:31 am 
User avatar
Wafer-thin Animator
Member
[*]
[*]
[*]
When you say executable, you mean an EXE file? That's a problem for me because I strictly use a Mac OS. Still, if you would showcase it in a video recording or diagram, that could work. Personally, all I really need is what to type in the Google search bar, so I could find the resources myself. While I would try it now, the previous attempts at searching up concepts for Maya yielded inadequate results.

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Tue Jun 27, 2017 1:05 pm 
User avatar
C# Programmer
Member
[*]
[*]
[*]
[*]
Image

This was done in Unity by just rendering the pieces to a render texture then using that as a texture for the quad, cube, sphere and capsule. I'll go look for a Blender solution.

_________________
MFGG TKO (scrapped) - Animations
Image
"It feels that time is better spent on original creations" - Konjak
Focus on the performance, the idea, not the technical bits or details - Milt Kahl
 
Top
Offline 
 
 
 [us]
 Post subject: Re: Anime Eyes Seen through Hair
PostPosted: Tue Jun 27, 2017 1:14 pm 
User avatar
Wafer-thin Animator
Member
[*]
[*]
[*]
That looks a little strange, but I think I understand. Hopefully, Blender is similar enough to Maya, so that I can apply the technique there.

 
Top
Offline 
 User page at mfgg.net
 
« Previous topic | Next topic »
Display posts from previous:  Sort by  
 [ 14 posts ]  Reply to topicPost new topic 


Who is online

Users browsing this topic: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group