cmake option to build without smoke sim: WITH_MOD_SMOKE

This commit is contained in:
Campbell Barton 2011-07-13 18:40:21 +00:00
parent f94c9d5d61
commit 1fd33b6e77
13 changed files with 61 additions and 3 deletions

@ -141,6 +141,7 @@ endif()
# Modifiers
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
option(WITH_MOD_SMOKE "Enable Smoke Modifier (Smoke Simulation)" ON)
option(WITH_MOD_DECIMATE "Enable Decimate Modifier" ON)
option(WITH_MOD_BOOLEAN "Enable Boolean Modifier" ON)
option(WITH_MOD_CLOTH_ELTOPO "Enable Experemental cloth solver" OFF)

@ -31,7 +31,6 @@ add_subdirectory(moto)
add_subdirectory(memutil)
add_subdirectory(iksolver)
add_subdirectory(opennl)
add_subdirectory(smoke)
add_subdirectory(mikktspace)
if(WITH_AUDASPACE)
@ -42,6 +41,10 @@ if(WITH_MOD_FLUID)
add_subdirectory(elbeem)
endif()
if(WITH_MOD_SMOKE)
add_subdirectory(smoke)
endif()
if(WITH_MOD_DECIMATE)
add_subdirectory(container)
add_subdirectory(decimation)

@ -84,7 +84,7 @@ set(SRC
)
if(WITH_OPENMP)
add_definitions(-DPARALLEL=1)
add_definitions(-DPARALLEL=1)
endif()
if(WITH_FFTW3)

@ -306,6 +306,10 @@ if(NOT WITH_MOD_FLUID)
add_definitions(-DDISABLE_ELBEEM)
endif()
if(WITH_MOD_SMOKE)
add_definitions(-DWITH_SMOKE)
endif()
if(WITH_JACK)
add_definitions(-DWITH_JACK)
endif()

@ -21,6 +21,8 @@ incs += ' ' + env['BF_ZLIB_INC']
defs = [ 'GLEW_STATIC' ]
defs.append('WITH_SMOKE') # TODO, make optional
if env['WITH_BF_PYTHON']:
incs += ' ../python'
incs += ' ' + env['BF_PYTHON_INC']

@ -516,6 +516,7 @@ static int ptcache_cloth_totpoint(void *cloth_v, int UNUSED(cfra))
return clmd->clothObject ? clmd->clothObject->numverts : 0;
}
#ifdef WITH_SMOKE
/* Smoke functions */
static int ptcache_smoke_totpoint(void *smoke_v, int UNUSED(cfra))
{
@ -652,6 +653,11 @@ static void ptcache_smoke_read(PTCacheFile *pf, void *smoke_v)
}
}
}
#else // WITH_SMOKE
static int ptcache_smoke_totpoint(void *UNUSED(smoke_v), int UNUSED(cfra)) { return 0; };
static void ptcache_smoke_read(PTCacheFile *UNUSED(pf), void *UNUSED(smoke_v)) {}
static int ptcache_smoke_write(PTCacheFile *UNUSED(pf), void *UNUSED(smoke_v)) { return 0; }
#endif // WITH_SMOKE
/* Creating ID's */
void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb)

@ -140,6 +140,19 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
#define TRI_UVOFFSET (1./4.)
/* Stubs to use when smoke is disabled */
#ifndef WITH_SMOKE
struct WTURBULENCE *smoke_turbulence_init(int *UNUSED(res), int UNUSED(amplify), int UNUSED(noisetype)) { return NULL; }
struct FLUID_3D *smoke_init(int *UNUSED(res), float *UNUSED(p0)) { return NULL; }
void smoke_free(struct FLUID_3D *UNUSED(fluid)) {}
void smoke_turbulence_free(struct WTURBULENCE *UNUSED(wt)) {}
void smoke_initWaveletBlenderRNA(struct WTURBULENCE *UNUSED(wt), float *UNUSED(strength)) {}
void smoke_initBlenderRNA(struct FLUID_3D *UNUSED(fluid), float *UNUSED(alpha), float *UNUSED(beta), float *UNUSED(dt_factor), float *UNUSED(vorticity), int *UNUSED(border_colli)) {}
long long smoke_get_mem_req(int UNUSED(xres), int UNUSED(yres), int UNUSED(zres), int UNUSED(amplify)) { return 0; }
void smokeModifier_do(SmokeModifierData *UNUSED(smd), Scene *UNUSED(scene), Object *UNUSED(ob), DerivedMesh *UNUSED(dm)) {}
#endif // WITH_SMOKE
static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm)
{
if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid)
@ -805,6 +818,9 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
// forward decleration
static void smoke_calc_transparency(float *result, float *input, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb, float correct);
static float calc_voxel_transp(float *result, float *input, int res[3], int *pixel, float *tRay, float correct);
#ifdef WITH_SMOKE
static int get_lamp(Scene *scene, float *light)
{
Base *base_tmp = NULL;
@ -1646,3 +1662,4 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa
}
}
#endif // WITH_SMOKE

@ -56,6 +56,10 @@ set(SRC
intern/gpu_codegen.h
)
if(WITH_MOD_SMOKE)
add_definitions(-DWITH_SMOKE)
endif()
add_definitions(-DGLEW_STATIC)
blender_add_lib(bf_gpu "${SRC}" "${INC}" "${INC_SYS}")

@ -13,4 +13,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
incs += ' ' + env['BF_OPENGL_INC']
defs.append('WITH_SMOKE') # TODO, make optional
env.BlenderLib ( 'bf_gpu', sources, Split(incs), defines = defs, libtype=['core','player'], priority=[160,110] )

@ -822,12 +822,18 @@ void GPU_free_smoke(SmokeModifierData *smd)
void GPU_create_smoke(SmokeModifierData *smd, int highres)
{
#ifdef WITH_SMOKE
if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && !highres)
smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smoke_get_density(smd->domain->fluid));
else if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && highres)
smd->domain->tex = GPU_texture_create_3D(smd->domain->res_wt[0], smd->domain->res_wt[1], smd->domain->res_wt[2], smoke_turbulence_get_density(smd->domain->wt));
smd->domain->tex_shadow = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->shadow);
#else // WITH_SMOKE
(void)highres;
smd->domain->tex= NULL;
smd->domain->tex_shadow= NULL;
#endif // WITH_SMOKE
}
static ListBase image_free_queue = {NULL, NULL};

@ -120,6 +120,10 @@ if(WITH_IMAGE_OPENEXR)
add_definitions(-DWITH_OPENEXR)
endif()
if(WITH_MOD_SMOKE)
add_definitions(-DWITH_SMOKE)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND INC ../quicktime)
list(APPEND INC_SYS ${QUICKTIME_INCLUDE_DIRS})

@ -14,6 +14,8 @@ cxxflags_raytrace = env['CXXFLAGS']
defs = []
defs_raytrace = []
defs.append('WITH_SMOKE') # TODO, make optional
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
if env['WITH_BF_RAYOPTIMIZATION']:
cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']

@ -220,6 +220,7 @@ static int read_voxeldata_header(FILE *fp, struct VoxelData *vd)
static void init_frame_smoke(VoxelData *vd, float cfra)
{
#ifdef WITH_SMOKE
Object *ob;
ModifierData *md;
@ -300,7 +301,13 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
}
vd->ok = 1;
return;
#else // WITH_SMOKE
(void)vd;
(void)cfra;
vd->dataset= NULL;
#endif
}
static void cache_voxeldata(struct Render *re, Tex *tex)