[Cycles] How to reduce the speed difference between preview and render?

I am using Blender 2.66.0 r54697.

I did a small test because of something that is bugging me a lot.

Attached is a blend file.

In layer one a cube with a lot of poly. Subdiv modifier has been used but applied. So it’s just a cube with a lot of faces.

Light source is a cube mapped with a skybox.

I changed only two settings. Samples : 500 in both cases. Tiles 256 x 256, so it render faster. The rest should be default. Cuda is activated and GPU compute is enabled.

Now when I look at the result in the preview window, it goes ligthning fast. Cool I think. Rendering that triffle should be a breeze. But pressing F12 and …

everything…

goes…

slow…

And if you increase the number of polygons (add subdiv modifier with two subdivision e.g.) you can even have the extreme case where the preview render is LIGTHNING FAST. And F12 crash (Graphic card is a GTX 670. error code 3 if it helps).

I know preview is just meant for that, preview. But even at almost full screen (1680*1050) preview works like a breeze for a very similar result to the F12 render (when it works).

Does it do the same on your machines? I am curious.

Thanks in advance to anyone taking the time to test this.

Attachments

test.blend (1.46 MB)

Subsurface modifier have different settings for preview and final render. You basically compare renders that have orders of magnitude face number difference.

Saw that previously on other posts from BA.

http://www.blender.org/forum/viewtopic.php?t=23466&sid=e88d6fb240326cf8a8009d771db43e9e

However, I apply the modifier each time. I should have mentionned that.

But in all case the number of polygons plays a large role in the F12 render speed.

I think the real culprit is the skybox. Remove the skybox and F12 rendering is fast. Even with high poly counts.

The fact that it is slow is strange because it’s the same thing as using a background with an image texture… But because it does not support cube maps, I had to use a skybox…

So, still puzzled.

However, I apply the modifier each time. I should have mentionned that.

Sorry, but i have trouble with english and not sure you understand me. Can you make screenshot of your Subdivision Modifers settings and post here? I mean, you mention that you apply it in both renders, but are modifier settings same for “view” and “render” fields as here http://wiki.blender.org/uploads/f/f1/25-Manual-Modifiers-Subsurf.png (differ settings on screeshot) ?

To apply a modifier means removing it from the stack and keeping only the result. As such there is no more subdiv modifier. Only the number of poly influence rendering in that case.

But as I said, the calculation time drop if I just remove the skybox (blend file included btw ;))

Got same issue in CPU even in preview mode, it deadly slow, i suspect direct light changes in core Cycles. Nothing suspicious in scene except background and light not converted yet to Node system. Will update post if found more.

I think i found it.

The problem is BVH quality. All 3 boxes are ideally parallel to xyz axis, that it force some corner case of BVH builder, i apply transformation and slightly rotate big “environment cube” to make it not parallel and it got speedup. To be completely sure one must visualize internal BVH structure. Better file bug to make more developers see that issue.

Darn. I think you are right (that’s a big understatement, you, sir, are a Cycles Genius).

I rotated the skybox once in X then once in Y so that it is not parallel to the small cube and render time is around 00:39.85 second.

With the non modified blend I get a render time of 18:56.53 !

I will re-download Blender (in case it was a corrected bug that I was unaware of) and if it does the same thing, bug report.

I would have never thought of something like that. Thanks a lot.

[UPDATE] 2.66a also has the same problem.

[UPDATE2] I am not sure if this bug report relate to the case. Any advice? I don’t want to duplicate a bug report…
http://projects.blender.org/tracker/?func=detail&atid=498&aid=34341&group_id=9

Here on linux 64, nv GT560, Blender 2.66.5 r55895, it is the same. As soon as i rotate SkyBox 2 deg (R 2, as it is in the file) image renders in 54 sec, while in default state 1st tile alone (out of 40) takes more than 2 minutes.

File in bugtracker referred for render test is taken offline due to texture pack errors or something and this issue somehow is toned down over there.

I’d suggest report this with attached .blend from 1st post.

http://projects.blender.org/tracker/?func=detail&atid=498&aid=34921&group_id=9 <- bug declared and solved in less than 24 hours. Just incredible.

Thanks everyone, we did good.