Page MenuHome

Hair Emitter's Color Attributes used for Duplicate Elements Amount in Blender 3.3.0+ Hair give transparency glitches with motion blur in Eevee
Closed, ArchivedPublic

Description

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65

Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: rBb292cfe5a936
Worked: (newest version of Blender that worked as expected)

Short description of error
My idea is to use Color Attributes or Vertex Weights of the Hair Emitter to control hair splines duplicates amount along the emitter's surface in the new Blender 3.3.0+ Geometry Node Hair system. Hair splines are duplicated with Duplicate Elements node and Emitter's Color Attribute used to control hair duplicates amount is passed into a Hair Geometry Node tree as Named Attribute using Transfer Attribute node. When such system is rendered in Eevee with Motion Blur, it results in transparency glitches. Presumably Motion Blur vectors are not calculated properly in this case. Without Motion Blur this system works just fine.

Exact steps for others to reproduce the error

  1. With selected default Cube (I'll be calling it Emitter because it is kind of emits hair) press Shift+A > Curves > Empty Hair
  2. Go to Sculpt mode and add some hair splines using Add brush so they cover a part of Emitter's surface.
  3. Go to Object mode, do the following with the Emitter:
    • Animate Emitter Z Rotation by typing in #frame/5. Using keyframes, drivers, animation modifiers, armature deformations affects the issue in the same way.
    • In the Object Data Properties tab add Color Attribute, set its default color to R=1, G=0, B=0
    • Add new Geometry Node to the Emitter
    • Add Store Named Attribute node and connect it to the Emitter's node tree, set its data type to Color. Changing Domain doesn't affect the issue's appearance.
    • Set Store Named Attribute's Name parameter to "color"
    • Connect Store Named Attribute's Attribute Input to Group Input free output
    • In the Emitter's Geometry Node modifier press the button to the left of the recently added input and select there previously added Color Attribute, so it becomes used as input
  4. Do the following in the Hair object's Geometry Node tree:
    • Add Object Info node and select the Emitter as a target object, switch mode to Relative
    • Add Transfer Attribute node, switch data type to Color. Changing Domain doesn't affect the issue's appearance.
    • Add Named Attribute, set its data type to Color, set Name to "color", connect it to Transfer Attribute's Attribute input
    • Add Separate Color node and connect its input to the Transfer Attribute's Attribute output
    • Add Duplicate Elements node, set domain to Spline and connect it to the chain after Deform Curves on Surface node; connect its Amount input to Separate Color's Red output. Using Float to Integer node to fix the Field's data type doesn't affect the issue's appearance.
    • You can optionally increase Red channel's value with Math > Multiply to get more hair duplicates.
    • You can optionally add Set Curve Radius node to make hair more fat
    • You can optionally randomize duplicated hair splines positions using Random Value interpolated to Spline domain with Interpolate Domain node and used for Offset in Set Position.
  5. In the Render Settings:
    • Enable Motion Blur. Adjusting Background Separation and Steps doesn't affect the issue's appearance.
    • Optionally enable Transparent in the Film tab.
    • Optionally switch Strand to Strips in the Curves tab. The issue appears on both.
  6. Render the frame. Some hairs will be shown as transparent holes without motion blur.

The project file ready to render showing the issue:

Event Timeline

Just to be sure, I'm not sure I've followed through, but does this report boil down to this hair not being blurred?

I mean this transparency glitch:


It becomes even more visible if some contrast object is placed behind the Hair system (here I added a plane with green emission behind the cube with hair to make it more obvious, no Screen Space Reflection is enabled):

Is that hair that doesn't overlap the surface of the object?


Also, I made a small test to compare how motion blur looks like when you increase the render settings and the effect.

The problem is not only that hair does not overlap the surface of the object. Both hair and object become semi-transparent so the background starts bleeding into them both.
This is how this object should look like. Here I use a simple integer parameter to determine a number of hair splines duplicates:


And this is how the same object looks when I use Red channel with value of 1 from the Color Attribute of the Cube:

Notice that in the viewport the result of the Geometry Node is exactly the same because in both cases the value of 1 is used for the Amount in Duplicate Elements. But in the second example the transparency grid starts to be seen pretty obviously along the most object's surface, especially in the darker areas.

Finally, I understood what the point is. Thanks for the report, I can confirm the error.

Now I will set all the flags of the report, but I need to simplify it a lot.

First: The problem of visual differences is caused by rounding:

Second: The problem is caused by bvhtree search. Although this has not been verified yet.


Now, this doesn't look like a regression, at least up to the previous attribute transfer node.

I keep searching...


Clearly, it's just a precision issue.
But since it may be that it is still strange, you can ask someone above.
Well, or at least add a check for input is single. But this is just a single case.

In this example, in the picture, searching for bvhtree returns an inaccurate value. A very small problem, but for int input it was fatal

As a result, this report does not contain a bug.
The problem with the transparent set of hairs is that they are not created if randomness makes them enter a value less than 1 in the float format.
The fix is to change the rounding.
This could be a known bug, but the problem is that this is just a case where the current implicit rounding method fails. You must use a node with explicit method selection.