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-08 12:25:24 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-08 18:20:09 +0300
commiteea22dd5ef0aaf58066bbff460315c8867741920 (patch)
tree9b835f732c4395b81e570ddf103d39770da20e92 /source/blender/gpu/intern/gpu_draw.c
parentba3ef44a6b57970b278c3a99a7ee00906efa3eb7 (diff)
Workbench: Smoke: Fix display
Includes the following fixes - Fix smoke texture creation: data was interpreted as Byte instead of Floats. - Fix Velocity texture not being free after draw: also was causing crashes. - Fix display_thickness not being copied during COW. - Fix Blending and general volume rendering algorithm. - Add Volume Shadowing support.
Diffstat (limited to 'source/blender/gpu/intern/gpu_draw.c')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 7902c5296aa..594a2d6d740 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -915,9 +915,10 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres)
}
/* density only */
else {
- sds->tex = GPU_texture_create_3D(
- sds->res[0], sds->res[1], sds->res[2],
- GPU_R8, smoke_get_density(sds->fluid), NULL);
+ sds->tex = GPU_texture_create_nD(
+ sds->res[0], sds->res[1], sds->res[2], 3,
+ smoke_get_density(sds->fluid),
+ GPU_R8, GPU_DATA_FLOAT, 0, true, NULL);
/* Swizzle the RGBA components to read the Red channel so
* that the shader stay the same for colored and non color
@@ -931,10 +932,11 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres)
}
sds->tex_flame = (
smoke_has_fuel(sds->fluid) ?
- GPU_texture_create_3D(
- sds->res[0], sds->res[1], sds->res[2],
- GPU_R8, smoke_get_flame(sds->fluid), NULL) :
- NULL);
+ GPU_texture_create_nD(
+ sds->res[0], sds->res[1], sds->res[2], 3,
+ smoke_get_flame(sds->fluid),
+ GPU_R8, GPU_DATA_FLOAT, 0, true, NULL) :
+ NULL);
}
else if (!sds->tex && highres) {
/* rgba texture for color + density */
@@ -946,9 +948,10 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres)
}
/* density only */
else {
- sds->tex = GPU_texture_create_3D(
- sds->res_wt[0], sds->res_wt[1], sds->res_wt[2],
- GPU_R8, smoke_turbulence_get_density(sds->wt), NULL);
+ sds->tex = GPU_texture_create_nD(
+ sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], 3,
+ smoke_turbulence_get_density(sds->wt),
+ GPU_R8, GPU_DATA_FLOAT, 0, true, NULL);
/* Swizzle the RGBA components to read the Red channel so
* that the shader stay the same for colored and non color
@@ -962,15 +965,18 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres)
}
sds->tex_flame = (
smoke_turbulence_has_fuel(sds->wt) ?
- GPU_texture_create_3D(
- sds->res_wt[0], sds->res_wt[1], sds->res_wt[2],
- GPU_R8, smoke_turbulence_get_flame(sds->wt), NULL) :
- NULL);
+ GPU_texture_create_nD(
+ sds->res[0], sds->res[1], sds->res[2], 3,
+ smoke_turbulence_get_flame(sds->wt),
+ GPU_R8, GPU_DATA_FLOAT, 0, true, NULL) :
+ NULL);
}
- sds->tex_shadow = GPU_texture_create_3D(
- sds->res[0], sds->res[1], sds->res[2],
- GPU_R8, sds->shadow, NULL);
+ sds->tex_shadow = GPU_texture_create_nD(
+ sds->res[0], sds->res[1], sds->res[2], 3,
+ sds->shadow,
+ GPU_R8, GPU_DATA_FLOAT, 0, true, NULL);
+
}
#else // WITH_SMOKE
(void)highres;