Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/workbench_volume.c
| Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| SmokeModifierData *smd = (SmokeModifierData *)md; | SmokeModifierData *smd = (SmokeModifierData *)md; | ||||
| SmokeDomainSettings *sds = smd->domain; | SmokeDomainSettings *sds = smd->domain; | ||||
| WORKBENCH_PrivateData *wpd = vedata->stl->g_data; | WORKBENCH_PrivateData *wpd = vedata->stl->g_data; | ||||
| DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); | DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); | ||||
| DRWShadingGroup *grp = NULL; | DRWShadingGroup *grp = NULL; | ||||
| /* Don't show smoke before simulation starts, this could be made an option in the future. */ | /* Don't show smoke before simulation starts, this could be made an option in the future. */ | ||||
| if (!sds->fluid || CFRA < sds->point_cache[0]->startframe) { | if (!sds->fluid || !(sds->type == FLUID_DOMAIN_TYPE_GAS) /* || CFRA < sds->point_cache[0]->startframe*/ ) { | ||||
| return; | return; | ||||
| } | } | ||||
| wpd->volumes_do = true; | wpd->volumes_do = true; | ||||
| if (sds->use_coba) { | if (sds->use_coba) { | ||||
| GPU_create_smoke_coba_field(smd); | GPU_create_smoke_coba_field(smd); | ||||
| } | } | ||||
| else if (!sds->wt || !(sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) { | else if (!(sds->flags & FLUID_DOMAIN_USE_NOISE)) { | ||||
| GPU_create_smoke(smd, 0); | GPU_create_smoke(smd, 0); | ||||
| } | } | ||||
| else if (sds->wt && (sds->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) { | else if (sds->flags & FLUID_DOMAIN_USE_NOISE) { | ||||
| GPU_create_smoke(smd, 1); | GPU_create_smoke(smd, 1); | ||||
| } | } | ||||
| if ((!sds->use_coba && sds->tex == NULL) || | if ((!sds->use_coba && sds->tex == NULL) || | ||||
| (sds->use_coba && sds->tex_field == NULL)) | (sds->use_coba && sds->tex_field == NULL)) | ||||
| { | { | ||||
| return; | return; | ||||
| } | } | ||||
| const bool use_slice = (sds->slice_method == MOD_SMOKE_SLICE_AXIS_ALIGNED && | const bool use_slice = (sds->slice_method == FLUID_DOMAIN_SLICE_AXIS_ALIGNED && | ||||
| sds->axis_slice_method == AXIS_SLICE_SINGLE); | sds->axis_slice_method == AXIS_SLICE_SINGLE); | ||||
| if (use_slice) { | if (use_slice) { | ||||
| float invviewmat[4][4]; | float invviewmat[4][4]; | ||||
| DRW_viewport_matrix_get(invviewmat, DRW_MAT_VIEWINV); | DRW_viewport_matrix_get(invviewmat, DRW_MAT_VIEWINV); | ||||
| const int axis = (sds->slice_axis == SLICE_AXIS_AUTO) | const int axis = (sds->slice_axis == SLICE_AXIS_AUTO) | ||||
| ? axis_dominant_v3_single(invviewmat[2]) | ? axis_dominant_v3_single(invviewmat[2]) | ||||
| ▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines | |||||