I’m working on anime-style stylization.
I created a simple scene with eyes visible through the hair. And a stylized shadow for the hair, which is only visible on the head.
A simple example without complex geometry and heavy materials
I have a fairly weak computer and I want to optimize this scene as much as possible so that in the future, when I add more complex and heavy objects, my blender doesn’t crash.
Is this possible?
Render eevee
Version blender 4.1
File : Trans test.blend (1.3 MB)
Your compositing setup is complex, but not heavy on performance. The polygon count is completely reasonable and there are no textures. There is no performance concern for the moment, but this will have to be checked again once the full scene is there.
You are using shader to RGB, so this will have to be rendered in Eevee. The main concerns for performance in Eevee are going to be the number of lights and shadows, polygon count, and the shader to RGB node itself, which is expensive (beware using too many of those nodes, reuse materials where possible).
I’m concerned that I have to use three layers with different objects (in other words, render the scene three times) and also several AOV layers. And I don’t know how to avoid shader to RGB if the AOV layer only accepts either a color or a value.
[Although I haven’t cleared out some duplicate or unused channels, I’ll just delete them in the future, so I’m not paying attention to them right now. As for the ones I’m already using, I can only say…
I don’t know.
But I’ll try to explain which layer is responsible for what.
Layers
Hair - The hair layer is initially unused because I only need hair.
But since objects like the head overlap it, creating a transparent area, I’m currently using “AOV Color 2” for this.
Shadow - The shadow from the hair as an object should appear only on the face and not extend beyond it. (It might be possible to shorten this by dragging it onto the Hair layer, but I don’t know how yet.)
AOV
Would you be using real lighting in the final product? If yes, wouldn’t that make actual shadows anyway?
If you won’t use real shadows and need the fake stylized shadow, maybe there could be a way to do it without compositing, directly on the mesh itself? The solution I would have thought of for doing this kind of stylized shadow is a semi transparent mesh that’s shrinkwrapped on the head.
I use an artificial light source that I create from vectors and normals, so I don’t have any real shadows. The modifier might work fine on a simple sphere, but on a complex face with moving eyes, ears, and a mouth, and the hair has a rig that also moves, all of this will likely create artifacts.
The hair mesh and armature are duplicated. Then I remove all the hair elements that don’t need to be there, because they won’t be casting a “shadow”.
(And to point out what i hope is obvious: there’s no “shadow from a light” here. We’re creating the illusion of a shadow. I don’t use Eevee light shadows at all for characters.)
Basic setup for the shadow material below. It’s possible to cast the shadow onto multiple colors (skin + eyebrow + etc) with mix nodes, but I’m keeping it simple here to demo the method:
If you have hair hanging over the eyes, and want the eyes to partially show through - then it’s simply a matter of:
Assign an AOV output to the eyeshader in the main view layer
Create a view layer with only the eyes
In the compositor, mix the eyes (from 2) over the render, using the AOV (from 1) as the alpha matte. Then mix level = amount of eye showing through the hair.
Example (Also, i made the eyebrow included in the AOV.)