Skip to content
Snippets Groups Projects
Commit 2b962212 authored by Brecht Van Lommel's avatar Brecht Van Lommel
Browse files

Fix #33411: crash baking smoke with FFT high resolution.

CMake had FFTW disabled by default, and when FFTW was not enabled it lead to
uninitialized memory usage. Now it falls back to wavelet if there is no FFTW,
and I've enabled it by default in CMake. If it's not found on Linux it will get
disabled automatically.
parent 4742dc3f
No related branches found
No related tags found
No related merge requests found
......@@ -127,7 +127,7 @@ option(WITH_PYTHON_MODULE "Enable building as a python module which runs without
option(WITH_BUILDINFO "Include extra build details (only disable for development & faster builds)" ON)
option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ON)
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
option(WITH_GAMEENGINE "Enable Game Engine" ON)
option(WITH_PLAYER "Build Player" OFF)
......@@ -387,10 +387,6 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
endif()
if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
message(FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON")
endif()
# may as well build python module without a UI
if(WITH_PYTHON_MODULE)
set(WITH_HEADLESS ON)
......@@ -1670,6 +1666,10 @@ if(APPLE OR WIN32)
endif()
endif()
if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
message(FATAL_ERROR "WITH_MOD_OCEANSIM requires WITH_FFTW3 to be ON")
endif()
if(WITH_CYCLES)
if(NOT WITH_OPENIMAGEIO)
message(FATAL_ERROR "Cycles reqires WITH_OPENIMAGEIO, the library may not have been found. Configure OIIO or disable WITH_CYCLES")
......
......@@ -220,22 +220,26 @@ void WTURBULENCE::setNoise(int type)
{
if(type == (1<<1)) // FFT
{
// needs fft
#ifdef WITH_FFTW3
// needs fft
std::string noiseTileFilename = std::string("noise.fft");
generatTile_FFT(_noiseTile, noiseTileFilename);
return;
#else
fprintf(stderr, "FFTW not enabled, falling back to wavelet noise.\n");
#endif
}
else if(type == (1<<2)) // curl
#if 0
if(type == (1<<2)) // curl
{
// TODO: not supported yet
return;
}
else // standard - wavelet
{
#endif
std::string noiseTileFilename = std::string("noise.wavelets");
generateTile_WAVELET(_noiseTile, noiseTileFilename);
}
}
// init direct access functions from blender
void WTURBULENCE::initBlenderRNA(float *strength)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment