Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-10-09 12:19:54 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-09 13:12:38 +0300
commit9cf01d35be3a69aa162b4c5e24fe9a357f750aab (patch)
tree9510340ab84dfced7e9e54181cccf819818cf84d /source/blender/gpu/intern/gpu_draw.c
parentd4d6cbe0a77452cf828adeba0f796abd077b89e1 (diff)
Workbench: Smoke: Add support for Color Mappping for smoke debugging
Diffstat (limited to 'source/blender/gpu/intern/gpu_draw.c')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 911af3601d2..a5ec595177b 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1088,7 +1088,33 @@ void GPU_free_smoke(SmokeModifierData *smd)
if (smd->domain->tex_flame_coba)
GPU_texture_free(smd->domain->tex_flame_coba);
smd->domain->tex_flame_coba = NULL;
+
+ if (smd->domain->tex_coba)
+ GPU_texture_free(smd->domain->tex_coba);
+ smd->domain->tex_coba = NULL;
+
+ if (smd->domain->tex_field)
+ GPU_texture_free(smd->domain->tex_field);
+ smd->domain->tex_field = NULL;
+ }
+}
+
+void GPU_create_smoke_coba_field(SmokeModifierData *smd)
+{
+#ifdef WITH_SMOKE
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
+ SmokeDomainSettings *sds = smd->domain;
+
+ if (!sds->tex_field) {
+ sds->tex_field = create_field_texture(sds);
+ }
+ if (!sds->tex_coba) {
+ sds->tex_coba = create_transfer_function(TFUNC_COLOR_RAMP, sds->coba);
+ }
}
+#else // WITH_SMOKE
+ smd->domain->tex_field = NULL;
+#endif // WITH_SMOKE
}
void GPU_create_smoke(SmokeModifierData *smd, int highres)