Cycles hair animation has weird flickering

The hairs actually move.
This can be observed in the viewport and I think that when a large number of hair moves, a specific pattern develops in the reflection of the hair surface. :thinking:

yeah the hair moving over itself would definitely contribute to the moire effect. when i downloaded the file, only the back hair was simulated and jostling, but the front bangs were just a static clump. overall the more i upped the samples, the cleaner those static bangs and horns(?) seemed to render (and the back hair was fine render-wise too, just looked unnatural because of the physics jittering)

Only some of the hairs move? And the movement is done on a single curve following a proxy then the other hairs are duplicated from that single curve using the duplicate geonode…

I applied the node to the ones that aren’t simulated, but that changes nothing.

I don’t think the hairs are actually moving, just something in the render makes it look like they are…

Umm, so the answer seems to be: Render with way more samples?

How can I composit just the hair? Like it needs to cover and also be covered by the head and also cast shadows onto the head… That is a lot more complicated than just replacing the background or adding foreground elements…

To me, it looks like the entire lock of hair is rotating in @oo_1942’s videos. This is a slightly weird movement, but it shouldn’t cause flickering. Rendering with higher quality will likely help.

For this, you need to know about “holdout” and “indirect only”.

filters

  • Place the hair in a collection and the solid objects in an other.

  • When rendering the solid objects, set the hair collection to “indirect only”. This will cause the hair to be invisible, but its effects on the scene (shadows, reflections) will still be there.

  • When rendering the hair, set the objects collection to holdout. This will make the objects invisible, but they will still hide the hair if they pass in front of it, making a transparent hole in the image. You will also need to either set the background to render transparent in the render setting or add a holdout cube that surrounds the scene (either will ensure the entire background is transparent in the render and only the hair is visible).

Then, you can combine both images with “alpha over” and they will fit perfectly.

The material is different from moving.
Test the rendering without moving the character.

The problem is that the hair settings move left and right depending on the character’s movement.

And for rendering settings, we are using a higher sample for preview.
80 samples of rendering settings are not sufficient.

Yes it only appears when the hair is moving between frames. I just put a very simple animation of the hair moving left then right in the example file, but that shows the issue nicely.

It seems that the shade that the movement creates and the pattern that is caused by the reflection look like noise.
This movement does not cause natural shaking of the hair, but it works like the position of the hair root has shifted.

I don’t specialize in hair, so I don’t know how to fix it. :slightly_smiling_face:

This setting only seems to effect Cycles? Is there a similar process that works in EEVEE? (Holdout works in both but the Indirect only don’t apply to EEVEE)

Sadly no, Eevee relies on direct visibility for its shading, so there is no such thing as indirect only. If you want to do this kind of compositing, you will need Cycles.

I can disable the camera ray visibility while leaving shadow rays on. I don’t know how much of a render time saving that is, but it produces a similar effect to using the Indirect only filter.

In Cycles, disabling just the camera ray will do the same thing as using “indirect only” .

In Eevee, it’s like disabling the object completely, so you don’t get its shadows and reflections, Eevee relies on direct visibility to make those.

So long as you have Shadows enabled in EEVEE it works (Well, in EEVEE Next which is now renamed to EEVEE)

I see, it does still cast shadows even though it’s not visible, what it doesn’t do is block world light and raytracing.

Hi there! I know this is a year old post, but I am literally having the EXACT same problem you had. I’ve read through this thread over and over again but I don’t believe there was a written solution…? My hair flickers/sizzles in the render and looks exactly like your hair. How did you go about fixing this?

The fix boils down to essentially: Render with more samples until the problem goes away.

In practice that may mean rendering the hair in a separate pass with a higher number of samples then compositing it into the main render which you do with less samples.

It’s not obvious that samples are the problem because everything else looks perfect and the hair looks perfect in each frame. But the problem is that without enough samples the hair looks ever so slightly different from frame to frame making it look like the hairs are moving.

So you suggest just re rendering the hair at a higher sample rate than the body and whatnot?

How would I do that? I did see the whole “holdout” and “indirect” thing but clicking either one didn’t change my render at all. Thanks for the reply though!

I mean if you can afford the render time, just render the whole thing with more samples.

The process is different for EEVEE vs Cycles. But basically you want to render everything except the hair, with the hair just contributing shadows. Then render just the hair against transparency (can use a plane + crypto-matte). Comp them together.

Ah so you suggest cryptomattes? Yeah I forgot to specify, I am indeed using Cycles. Alright, got it. I’ll just render the hair separately with cryptomattes with higher samples. Thanks so much

Depends on your scene. In cycles you can set the hair to ‘Indirect Only’ when rendering the rest of the scene to get shadows. When rendering the hair you set the rest of the scene to ‘Holdout’.

Lighting obviously remains the same for both passes.

The cycles holdout mode should give you transparent mask without needed any mattes.