HairParticleSystem in combination with volume scattering for atmosphere makes Blender 3.0 very slow in rendering

Issue #824 resolved
Jochen Sutter created an issue

I have a strange issue if I use a figure made with Diffeo 1.6.0 (this issue is not with figures made in 1.5.0).
The cycles x rendering is getting extremy slow (20x slower) as soon I use a scene with volume scattering for atmospehere effects and a figure with a Hair particle system on it’s mesh. It’s getting slow only if I use Hair + Volume scattering Atmosphere together.

Is this a known issue? Is there any way to convert Blender 3.0 Scenes back to Blender 2.93.

Comments (26)

  1. Jochen Sutter reporter

    I made here a simple file. G8M basemesh imported with V1.6.1 in Blender 3.0

    If you open the file you get the figure with a simple hair particular system standing in the fog. Very slow rendering, also in preview. As soon as you make the hair unvisible the rendering is very fast. Oddly enough the rendering stay fast also if you make the hair visible again for the preview. But in final rendering the rendering is always very slow, when you render it with hair and fog

    you can download this file here to test
    https://1drv.ms/u/s!Au0R_gJJcvPWgdcPbGUbEyYzbrAw4A?e=XELPKP

  2. Jochen Sutter reporter

    In final render it’s rendering around 20 times slower. I don’t know if its a bug of the Diffeo tool or of Blender 3.0. But the issue is on Diffeo imported figures only. If I a make hair on a simple cube the rendering is fast, also in final rendering. Only hair on diffeo Imported figure causes this issue. (Figures imprted with Diffeo 1.5.0 also work without this issue)

  3. Thomas Larsson repo owner

    What you can do to reduce render time, particularly for viewport rendering, is to turn on Simplify and play with the settings there. All the settings are relevant in this case, I think. E.g., if child particles is turned on Blender has to draw 100 times as many strands. Also, I wouldn’t use 128 samples for viewport rendering.

    It may also be better to move the particle modifier before the subsurf, so there are fewer faces that the particles grow from. This is also the difference with the cube, which only has six faces.

  4. Thomas Larsson repo owner

    The plugin uses a volume node to match iray skin. That usually works well, but perhaps it interacts with the atmosphere somehow. You could try to turn off Volume in the global settings before importing the model.

    I also noted that the hair uses the face material. You probably want a separate hair material for that.

  5. Jochen Sutter reporter

    I removed all subsurfaces and childs and make just simple 100 hairs and also tried that with simplify values Remouving volume in the global setting befor importing. No effekt. fast rendering in preview, slow in final.

    But now i removed all materials. and maked all just simple white. Now it’s rendering also fast in final. So I think it has to do with materials. I’will copy the materials from a V1.5.0 figure to the new one. maby that works?

  6. Alessandro Padovani

    Can you please provide a simple test scene in duf format that I can import myself to blender ? I want to compare 1.5.0 and 1.6.1 to verify the rendering speed, so I can also check the difference with the hair materials.

    Another issue with slow hair is #767 with tips to work around it.

  7. Jochen Sutter reporter

    I figured out, the issue is caused by the material of Cornea and EyeMoisture. Maybe it’s the “DAZ Refraction” Group.
    As soon I delete this “DAZ Refraction” Group in both materials it works. Final render is fast. 🙂

  8. Jochen Sutter reporter

    The issue is resolved for me. But maybe you can resolve the issue in the Plugin? I don’t know whats ecaxtly wrong in the “DAZ refraction”. But with a simple glass shader ir works.

  9. Jochen Sutter reporter

    Maybe it has to do anything with Tranparency. I have the same issue in the dickdator and there is it the transparency alpha channel wich slows down the final rendering in combination with hair particles and volume scattering…

  10. Alessandro Padovani

    It seems there’s something wrong with the cube volume, don’t know if this is a blender bug. But I found a workaround that works fine enough without cropping any material, with the two steps below the rendering speed seems back to normal here.

    1. instead of using a cube you can plug the volume directly in the world output
    2. instead of using a sun light you can use a point light

    note. Of course without “cast shadow” the rendering is much faster, if the figure stays in that dense fog then shadows are probably not so important.

  11. Thomas Larsson repo owner

    Apparently the transparent node is the offender. If I replace DAZ Refraction with a Refraction BSDF, rendering is still fast, but it becomes slow if I replace it with a Transparent BSDF.

  12. Jochen Sutter reporter

    Yes, you get this issue as soon I have an object (even a simple plain) with hair particles and transparency in combination with volumscattering for atmosphere. I also have this issue if I use the world volume for the atmosphere. I think it’s a Blender 3.0 bug.

  13. Alessandro Padovani

    note. may be solution. I noticed that all the material previews are pink because the test scene misses all the textures. That is, cycles is expecting textures and can’t find them. So basically the test scene is a corrupt file. This is probably why things go wrong.

    As a side note the hair material face-1.001 doesn’t make any sense either.

  14. Alessandro Padovani

    update. solution. Yes, if I unplug the normal input with the missing textures from the daz refraction then everything works fine. So this is the issue. The transparent shader can’t work fine with missing textures.

  15. Jochen Sutter reporter

    Ok, but I have the issue in that simple scene with the cubes and just a simple transparency in the link above. Without any textures or normals. I can use Priciple shader with alpha set to 0 or use a transparent shader for the cube with the hair particles. In both cases I get the issue.

  16. Alessandro Padovani

    In your second example it is very hard for the render engine to cast shadows on the hair through the fog. If you disable cast shadows everything works fine. Don’t know if this is normal. In any case this is not related to diffeomorphic and seems more a blender issue.

    The fog alone renders fine. The hair alone renders fine. The hair + fog without shadows renders fine. The hair + fog with shadows gets the slowdown.

    edit. note. If I use alpha = 1 in the principled shader there are no issues, cast shadows work fine. I can also use a transparent base color instead of the alpha channel. See the solution below.

  17. Alessandro Padovani

    update. solution for second example. Yes if I use a transparent material for the hair the rendering slows down a lot, even without cast shadows. If I use a transparent material on normal geometry such as suzanne for example then everything works fine so this is an issue only with the particles hair material. So a workaround is to avoid transparent materials for particle hair. On the other side particle hair doesn’t need a transparent material so this is a non-issue, you can USE THE DEDICATED HAIR SHADERS FOR PARTICLE HAIR, as diffeomorphic does depending on the global settings.

    You may want to report this as a blender issue to see what the blender guys can do. But at the end this seems more a misuse of shaders since particle hair is intended to be used with its own dedicated shaders.

    edit. note. In eevee you must use the principled shader because the hair shaders are not supported. In this case avoid the alpha channel, that is, make alpha = 1.

    edit.note. Please note that in the dedicated hair shaders you can also use a transparent color for the color channel and everything works fine. This is so for the principled shader too in eevee, just avoid the alpha channel.

    edit. note. In the first example I replaced the hair material with diffuse since the original hair material didn’t make any sense. That’s why it worked fine for me once I fixed the missing textures.

  18. Jochen Sutter reporter

    Thank you very much. I think it’s managable this way. Yes the hair particles don’t have to be transparent, but the geometry on where the hair particales are I use transparency maps sometime.

  19. Alessandro Padovani

    Thomas, as a result from this issue reported by Jochen, we may want to remove the “keep material“ option for sheet hair. I never use this option myself for sheet hair, but indeed it makes little sense because “normal” materials are not good for particle hair anyway. So we may want to make the “keep material“ option only available for tube and line hair.

    As a minor note we may use better descriptions since sheet, tube and line make little sense to daz users. Those are transmapped hair for sheet, SBH strand based hair for tube, and dForce hair for line. Also a better default would be to have the resize hair option checked, since multiple particle systems make little sense too in my opinion, I always use resize.

    Hair Type:

    • transmapped (sheet)
    • SBH (tube)
    • dForce (line)

    edit. Also may be “multi materials“ can be removed as an option and always enabled. I mean if we keep materials then multi materials is intended anyway. Even if we don’t keep materials it makes little sense to discard multiple materials if the hair get them.

    edit. important. The “fade roots” option uses a trasparent bsdf too. This should be warned that can cause performance issues with an environment fog. I never use “fade roots” myself since “root and tip shrink” does a similar effect without using transparency. So may be we can remove the “fade root“ option too.

  20. Alessandro Padovani

    Xin, do you know if there’s any way to uv map a particle strand ? This way we could use the hair textures for the sheet option. I searched on google but can’t find anything good.

  21. Thomas Larsson repo owner

    Some of the issues are dealt with in the last commit.

    Keep Material no longer appears for sheet hair.

    If Multi Materials is enabled the number of particle systems increases, since each particle system has a single material as well as a single strand length. So I want to keep this as an option to keep down the number of particle systems.

    I added a warning to the Fading Roots option. I have not used it myself, but have seen nice things done with it, so I want to keep it. Most scenes don’t have atmospheric effects (at least mine don’t) so it is usually not a problem.

  22. Log in to comment