LuxCoreRender / BlendLuxCore

Blender Integration for LuxCore
GNU General Public License v3.0
735 stars 91 forks source link

Crash after 2^31 Polys #107

Closed batstick closed 6 years ago

batstick commented 6 years ago

Windows 10 64-Bit, Radeon Pro Duo, GTX 980, 5820k, 32gb ram

File "C:\Users\thisismyusername\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\utils\render.py", line 121, in get_pretty_stats
    triangle_count = stats.Get("stats.dataset.trianglecount").GetInt()
RuntimeError: bad lexical cast: source type value could not be interpreted as target
ERROR: bad lexical cast: source type value could not be interpreted as target

Having over 2^31 polys (2,147,483,648) causes this error in LuxCore regardless of the rendering settings, cpu/gpu/opencl/path/bidir. Doesn't matter, always crashes. I suspect that the poly variable is set to be 31 bits with one reserved for positive/negative? Is increasing this limit viable? Thanks!

The easiest way to cause this issue is to have high polycount particles. Found it while making a forest. It also takes a very long time to compile. polycrash.zip

Theverat commented 6 years ago

I'm probably using the wrong getter (GetInt()) to retrieve the value. Looking at the LuxCore samples, Dade is using a mixture of GetFloat() and get<double>(). However, the original value seems to be unsigned long long: https://github.com/LuxCoreRender/LuxCore/blob/061f0e89e9157732a00f3ad936a4d23f19ad2a5d/include/luxrays/core/dataset.h#L78

I'll see if I can get it as unsigned long long with LuxCore property getters.

batstick commented 6 years ago

Thanks for the quick response!

Theverat commented 6 years ago

I added a getter for unsigned long long and it works:

unbenannt