Bizarre render times with Refraction node #41633

Closed
opened 2014-08-29 16:56:33 +02:00 by Kent Trammell · 22 comments

OS X 10.9.4, 2014 Mac Pro, 3.5 GHz 6-Core Intel Xeon E5, AMD FirePro D500 3072 MB

Blender 2.71

DESCRIPTION: I switched out a Glass BSDF node for Refraction BSDF node and the render time jumped from 4.5 minutes to a predicted 76 hours. My purpose was to separate refraction's from reflections for additional control. Using Cycles on CPU.

TROUBLESHOOT: Download and unzip this archive , open the .blend file and look in the node editor. In the frame labeled "SWITCH THESE" render once with the glass BSDF and once with the refraction BSDF.

problem.jpg

OS X 10.9.4, 2014 Mac Pro, 3.5 GHz 6-Core Intel Xeon E5, AMD FirePro [D500](https://archive.blender.org/developer/D500) 3072 MB Blender 2.71 DESCRIPTION: I switched out a Glass BSDF node for Refraction BSDF node and the render time jumped from 4.5 minutes to a predicted 76 hours. My purpose was to separate refraction's from reflections for additional control. Using Cycles on CPU. TROUBLESHOOT: Download and unzip [this archive ](https://dl.dropboxusercontent.com/u/2127530/refractionBSDF_issue.zip), open the .blend file and look in the node editor. In the frame labeled "SWITCH THESE" render once with the glass BSDF and once with the refraction BSDF. ![problem.jpg](https://archive.blender.org/developer/F107315/problem.jpg)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @khtrammell-1

Added subscriber: @khtrammell-1

Added subscriber: @kevindietrich

Added subscriber: @kevindietrich

Added subscribers: @Sergey, @ThomasDinges, @mont29

Added subscribers: @Sergey, @ThomasDinges, @mont29

Don’t know whether this is bug or expected (some settings can lead to insane render times…).

Don’t know whether this is bug or expected (some settings can lead to insane render times…).
Member

Added subscriber: @MartijnBerger

Added subscriber: @MartijnBerger
Member

@mont29 well glass also does refraction. so I would not expect this outcome.

@mont29 well glass also does refraction. so I would not expect this outcome.
Author

The goal of this scene was to experiment with the ray length absorption technique. So perhaps my node setup is "weird" in that the absorption factor mixes the glass/refraction with a translucent BSDF (closer to the surface is glass/refraction, deeper in the object is translucent BSDF). Perhaps this is where the refraction BSDF freaks out?

Like @mont29 said, since glass BSDF handles it fine I would expect the same from the refraction node...

Thanks for looking into this!

The goal of this scene was to experiment with the ray length absorption technique. So perhaps my node setup is "weird" in that the absorption factor mixes the glass/refraction with a translucent BSDF (closer to the surface is glass/refraction, deeper in the object is translucent BSDF). Perhaps this is where the refraction BSDF freaks out? Like @mont29 said, since glass BSDF handles it fine I would expect the same from the refraction node... Thanks for looking into this!

Yes, that's indeed very slow with the Refraction shader, I cannot think of a valid reason here at first, needs more investigation.

Yes, that's indeed very slow with the Refraction shader, I cannot think of a valid reason here at first, needs more investigation.

@Sergey: I cannot find a difference between Glass and Refraction shader in the code (svm_closure.h etc.). Glass Shader does reflection and refraction, Refraction Shader obviously just refraction. So I would expect rendertime to be lower even, not sure why this is happening. Maybe you have more luck.

@Sergey: I cannot find a difference between Glass and Refraction shader in the code (svm_closure.h etc.). Glass Shader does reflection and refraction, Refraction Shader obviously just refraction. So I would expect rendertime to be lower even, not sure why this is happening. Maybe you have more luck.

Added subscriber: @brecht

Added subscriber: @brecht

Glass is a mix between reflection (glossy) and refraction (transmission), mixed based on fresnel, at each bounce it will pick one of the two. If you use refraction you only get transmission bounces, and they are set to 12 in this file, while glossy is set to 4. Further, if you refract rather than reflect, you're typically going to be doing more bounces because you're entering the object, if you're reflected off it then you're done. So some increased render time is expected depending on the scene.

This is more than I would expect, so something bad might be going on. But rendering e.g. 5x or 10x slower would seem plausible to me.

Glass is a mix between reflection (glossy) and refraction (transmission), mixed based on fresnel, at each bounce it will pick one of the two. If you use refraction you only get transmission bounces, and they are set to 12 in this file, while glossy is set to 4. Further, if you refract rather than reflect, you're typically going to be doing more bounces because you're entering the object, if you're reflected off it then you're done. So some increased render time is expected depending on the scene. This is more than I would expect, so something bad might be going on. But rendering e.g. 5x or 10x slower would seem plausible to me.
Sergey Sharybin self-assigned this 2014-09-01 09:55:09 +02:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Looked into the file in details, the slowdown here is caused by quite dense BVH tree, which could make ray intersection rather slow to perform. And as Brecht described above changing shader tree in that way increases number of bounces a lot and each of the bounce happens inside of the object. while using Glass shader will bounce to the enviroment much sooner.

All this combined together leads to rather long render times. Plus the time prediction is really inaccurate -- it assumes all the tiles are the same complexity and all the samples takes the same time to calculate, which is't true in this scene.

I've let single sample to render and the slowdown was only the factor of 20, which is much closer to the expected one.

Using progessive refine might give better approximation (it'll be still off tho). And you can try limiting number of bounces or reducing the number of subdivisions on the object in order to make BVH intersections faster.

For sure stuff could be optimized, but that'd be considered a TODO, not a bug. So thanks for the report and stay tuned for the Cycles optimizations!

Looked into the file in details, the slowdown here is caused by quite dense BVH tree, which could make ray intersection rather slow to perform. And as Brecht described above changing shader tree in that way increases number of bounces a lot and each of the bounce happens inside of the object. while using Glass shader will bounce to the enviroment much sooner. All this combined together leads to rather long render times. Plus the time prediction is _really_ inaccurate -- it assumes all the tiles are the same complexity and all the samples takes the same time to calculate, which is't true in this scene. I've let single sample to render and the slowdown was only the factor of 20, which is much closer to the expected one. Using progessive refine might give better approximation (it'll be still off tho). And you can try limiting number of bounces or reducing the number of subdivisions on the object in order to make BVH intersections faster. For sure stuff could be optimized, but that'd be considered a TODO, not a bug. So thanks for the report and stay tuned for the Cycles optimizations!
Author

Thanks for looking into this @ThomasDinges, @brecht, @Sergey!

Thanks for looking into this @ThomasDinges, @brecht, @Sergey!

Added subscriber: @ZauberParacelsus

Added subscriber: @ZauberParacelsus

I filed a duplicate report of this issue earlier today. I found that the problem does not occur if you set the Refraction BSDF's roughness value to 0.001, and doing so made a huge difference in render times for me: 41 seconds versus 20 minutes. So, setting your roughness to that value could be a useful workaround.

I filed a duplicate report of this issue earlier today. I found that the problem does not occur if you set the Refraction BSDF's roughness value to 0.001, and doing so made a huge difference in render times for me: 41 seconds versus 20 minutes. So, setting your roughness to that value could be a useful workaround.

Added subscriber: @KonstantinsVisnevskis

Added subscriber: @KonstantinsVisnevskis

@ZauberParacelsus This saved me lots of headache inventing bizarre workaround shading trees :) Thanks.

@ZauberParacelsus This saved me lots of headache inventing bizarre workaround shading trees :) Thanks.

@KonstantinsVisnevskis Aye, you're welcome :-)

@KonstantinsVisnevskis Aye, you're welcome :-)

Added subscriber: @quacker

Added subscriber: @quacker

Had the same issue with a project a while ago. Very long render times using Refraction. Just did @ZauberParacelsus's suggestion and yeah that seems to be the culprit.

I also noted that my computer becomes very unresponsive and sometimes I get an nVidia driver timeout error with Roughness at 0, while it stays normal at 0.001. Card used is a GTX 780 Ti. Example render:

  • Roughness at 0.001. (Finished in 1:29):
    1.jpg

  • Roughness at 0. (07:26 and still not nearly finished):
    2.jpg

Perhaps the Roughness for Refraction shader should be automatically clamped at a really low value when set to 0?

Had the same issue with a project a while ago. Very long render times using Refraction. Just did @ZauberParacelsus's suggestion and yeah that seems to be the culprit. I also noted that my computer becomes very unresponsive and sometimes I get an nVidia driver timeout error with Roughness at 0, while it stays normal at 0.001. Card used is a GTX 780 Ti. Example render: - Roughness at 0.001. (Finished in *1:29*): ![1.jpg](https://archive.blender.org/developer/F136656/1.jpg) - Roughness at 0. (*07:26* and still not nearly finished): ![2.jpg](https://archive.blender.org/developer/F136658/2.jpg) Perhaps the Roughness for Refraction shader should be automatically clamped at a really low value when set to 0?
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
10 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#41633
No description provided.