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:
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl b/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
index fd790009e02..6ded453225e 100644
--- a/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
@@ -8,10 +8,17 @@ uniform float density_scale;
uniform sampler3D soot_texture;
uniform sampler3D shadow_texture;
+#ifdef USE_COBA
+uniform sampler1D transfer_texture;
+uniform sampler3D color_band_texture;
+#endif
+
void main()
{
/* compute color and density from volume texture */
vec4 soot = texture3D(soot_texture, coords);
+
+#ifndef USE_COBA
vec3 soot_color;
if (soot.a != 0) {
soot_color = active_color * soot.rgb / soot.a;
@@ -31,6 +38,11 @@ void main()
/* premultiply alpha */
vec4 color = vec4(soot_alpha * soot_color, soot_alpha);
+#else
+ float color_band = texture3D(color_band_texture, coords).r;
+ vec4 transfer_function = texture1D(transfer_texture, color_band);
+ vec4 color = transfer_function * density_scale;
+#endif
gl_FragColor = color;
}