diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-10-09 12:19:54 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-10-09 13:12:38 +0300 |
commit | 9cf01d35be3a69aa162b4c5e24fe9a357f750aab (patch) | |
tree | 9510340ab84dfced7e9e54181cccf819818cf84d /source/blender/gpu/intern/gpu_draw.c | |
parent | d4d6cbe0a77452cf828adeba0f796abd077b89e1 (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.c | 26 |
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) |