Maniphest T56609

Object rotation increases render time more than 10 times.
Confirmed, NormalTO DO

Assigned To
None
Authored By
Хамуков Аскер (askerpro)
Aug 29 2018, 11:09 PM
Tags
  • Cycles
  • Render & Cycles
Subscribers
Brecht Van Lommel (brecht)
Sebastian Koenig (sebastian_k)
Thomas Dinges (dingto)
Yevgeny Makarov (jenkm)
Хамуков Аскер (askerpro)

Description

System Information
Tested with windows 7 64bit and windows 10 64bit.
CPU ryzen 5 1600
GPU GTX 780
RAM 8GB GDDR4
(bug appears on other computers too)

Blender Version
tested with 2.79 and 2.8
Worked: (optional)

Short description of error
If I rotate object for about 45 degrees around Z axis render time increases more than 10 times.
But in preview mode there is no difference in render time before and after rotation.


Exact steps for others to reproduce the error
just rotate the object on attached blend file around Z axis about 45 degrees and compare render times before and after.
10seconds for 2000 samples before rotation and about 10 minutes after.
Based on a (as simple as possible) attached .blend file with minimum amount of steps

Event Timeline

Хамуков Аскер (askerpro) created this task.Aug 29 2018, 11:09 PM
Yevgeny Makarov (jenkm) added a subscriber: Yevgeny Makarov (jenkm).Aug 30 2018, 8:40 AM
This comment was removed by Yevgeny Makarov (jenkm).
Хамуков Аскер (askerpro) added a comment.Aug 30 2018, 8:46 AM

I tryed this object with no light source, except AO and bug still exists. If i remove doybles from mesh and simplify it, it takes less time to render after rotation, but still much more, than before rotation.

Sebastian Koenig (sebastian_k) added a subscriber: Sebastian Koenig (sebastian_k).Aug 30 2018, 11:04 AM

Wow, what a weird file! I can confirm there are differences in render time, but could not figure out why. I tried with not light source, with a different camera, with a different world, with no materials.
Still the same problem, in some rotation it renders really fast, and then, the more I increase the rotation, the render time increases as well.
It also doesnt depend on the camera angle, since rotating the object and the camera together still produce the same issue. However, copying the object and the camera and pasting it in a different file seems to eliminate the problem. Weird!

Хамуков Аскер (askerpro) added a comment.Aug 30 2018, 11:13 AM

Could you please send me that file, where u eliminated the problem. I had no success with transfering the object into new empty project, problem didn't dissapear.

Sebastian Koenig (sebastian_k) added a comment.Aug 30 2018, 1:00 PM

Turns out, I was wrong. The issus got a bit better, but there still is a significant slowdown happening.
I have prepared a file with the default world, no lamps, just the 2 objects (camera and mesh from your file). There are 2 keyframes, on frame 1 it renders fast, and frame 2 it renders slow.
I have tested with latest master as well as 2.79a. So I would say, bug confirmed.

Sebastian Koenig (sebastian_k) lowered the priority of this task from 90 to 50.Aug 30 2018, 1:00 PM
Brecht Van Lommel (brecht) lowered the priority of this task from 50 to Normal.Aug 30 2018, 1:01 PM
Brecht Van Lommel (brecht) edited projects, added Cycles; removed BF Blender.
Brecht Van Lommel (brecht) edited a custom field.
Brecht Van Lommel (brecht) added a subscriber: Brecht Van Lommel (brecht).

This is a typical issue with raytracers, many long thin faces along one direction are difficult to fit well in a BVH unless the faces are aligned to the X/Y/Z axis.

I'll consider this a To Do item, maybe we can make the spatial splits handle this case better, but would not strictly consider this a bug since it requires different BVH algorithms.

Brecht Van Lommel (brecht) moved this task from Backlog to Reliability on the Cycles board.Aug 30 2018, 1:03 PM
Sebastian Koenig (sebastian_k) added a comment.Aug 30 2018, 1:04 PM

Ah, thanks for the clarification! :)

Brecht Van Lommel (brecht) added a comment.Aug 30 2018, 1:23 PM

Also, the workaround is to subdivide the object more so the faces are not so long.

Хамуков Аскер (askerpro) added a comment.EditedAug 30 2018, 5:06 PM
In T56609#531572, @Brecht Van Lommel (brecht) wrote:

Also, the workaround is to subdivide the object more so the faces are not so long.

Thanks for your comment, I tryed to subdivide my mesh along faces and render time decreased much.


but it seems to be a littlebit routine to subdivide :)
Could you please explain me a little bit more:
why there is no problem in preview mode?
BVH structure in preview and final render are different?
(dynamic and static) that's the cause?

Is it possible to final render with dynamic bvh?

LINK to blender stackexchange topic, for other users, who got this problem.

Brecht Van Lommel (brecht) added a comment.Aug 30 2018, 5:40 PM

It's not possible to render with dynamic BVH currently.

In preview mode all objects have their own BVH which in this case is aligned with the faces. For final render we try to put as much as possible in one global BVH, and only multiple instanced objects get their own BVH. This is usually faster but backfires here.

Brecht Van Lommel (brecht) added a project: Render & Cycles.Jun 18 2020, 6:16 PM
Thomas Dinges (dingto) added a subscriber: Thomas Dinges (dingto).Nov 25 2022, 2:58 PM

Checked in Blender 3.5 (master) again:

CPU: 11s -> 35s
GPU (HIP): 13s -> 80s

It seems Embree is doing a better job here than our own BVH, even though it's also 3x slower.