diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-07-20 19:35:29 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-07-20 19:35:52 +0300 |
commit | 62a819202e79ed41651a1e3d9b686a6363ef20cb (patch) | |
tree | ad76c69c788833d1bd87c392ddad9e11ad579c76 /source/blender/gpu/intern | |
parent | 7d85495ab9e0b27180ed06e14a19dd7640262bbc (diff) |
Fluid: Refactored smoke noise system
This refactor is in response to reports in which the adaptive domain with noise caused a crash (e.g. T79009). It should also fix issues where the smoke appeared to be cut off when using the adaptive domain together with noise. It is also possible that some of these changes improve the lines issue from T74559.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw_smoke.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_draw_smoke.c b/source/blender/gpu/intern/gpu_draw_smoke.c index 89261afaebd..e0b94e20574 100644 --- a/source/blender/gpu/intern/gpu_draw_smoke.c +++ b/source/blender/gpu/intern/gpu_draw_smoke.c @@ -196,7 +196,7 @@ static GPUTexture *create_density_texture(FluidDomainSettings *fds, int highres) float *data; if (highres) { - data = manta_smoke_turbulence_get_density(fds->fluid); + data = manta_noise_get_density(fds->fluid); } else { data = manta_smoke_get_density(fds->fluid); @@ -212,14 +212,14 @@ static GPUTexture *create_density_texture(FluidDomainSettings *fds, int highres) static GPUTexture *create_color_texture(FluidDomainSettings *fds, int highres) { - const bool has_color = (highres) ? manta_smoke_turbulence_has_colors(fds->fluid) : + const bool has_color = (highres) ? manta_noise_has_colors(fds->fluid) : manta_smoke_has_colors(fds->fluid); if (!has_color) { return NULL; } - int cell_count = (highres) ? manta_smoke_turbulence_get_cells(fds->fluid) : fds->total_cells; + int cell_count = (highres) ? manta_noise_get_cells(fds->fluid) : fds->total_cells; int *dim = (highres) ? fds->res_noise : fds->res; float *data = MEM_callocN(sizeof(float) * cell_count * 4, "smokeColorTexture"); @@ -228,7 +228,7 @@ static GPUTexture *create_color_texture(FluidDomainSettings *fds, int highres) } if (highres) { - manta_smoke_turbulence_get_rgba(fds->fluid, data, 0); + manta_noise_get_rgba(fds->fluid, data, 0); } else { manta_smoke_get_rgba(fds->fluid, data, 0); @@ -245,7 +245,7 @@ static GPUTexture *create_color_texture(FluidDomainSettings *fds, int highres) static GPUTexture *create_flame_texture(FluidDomainSettings *fds, int highres) { float *source = NULL; - const bool has_fuel = (highres) ? manta_smoke_turbulence_has_fuel(fds->fluid) : + const bool has_fuel = (highres) ? manta_noise_has_fuel(fds->fluid) : manta_smoke_has_fuel(fds->fluid); int *dim = (highres) ? fds->res_noise : fds->res; @@ -254,7 +254,7 @@ static GPUTexture *create_flame_texture(FluidDomainSettings *fds, int highres) } if (highres) { - source = manta_smoke_turbulence_get_flame(fds->fluid); + source = manta_noise_get_flame(fds->fluid); } else { source = manta_smoke_get_flame(fds->fluid); |