diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-01-10 19:53:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-01-10 21:05:10 +0300 |
commit | 82049cbe7e6003cf9941008a155af4ec08504009 (patch) | |
tree | 1ca391828f32df89f0902cc61539df6a4a940a6e /source/blender/editors/space_view3d/drawvolume.c | |
parent | f1e8204f5afc88903edff5719d0bb159a5f483ba (diff) |
OpenGL Smoke: fix color issue, and clarify meaning of variables in the shader.
Diffstat (limited to 'source/blender/editors/space_view3d/drawvolume.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawvolume.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 801419b81c0..58142d7ee4a 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -327,7 +327,8 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob, int shadow_location = GPU_shader_get_uniform(shader, "shadow_texture"); int flame_location = GPU_shader_get_uniform(shader, "flame_texture"); int actcol_location = GPU_shader_get_uniform(shader, "active_color"); - int cellspace_location = GPU_shader_get_uniform(shader, "cell_spacing"); + int stepsize_location = GPU_shader_get_uniform(shader, "step_size"); + int densityscale_location = GPU_shader_get_uniform(shader, "density_scale"); int invsize_location = GPU_shader_get_uniform(shader, "invsize"); int ob_sizei_location = GPU_shader_get_uniform(shader, "ob_sizei"); int min_location = GPU_shader_get_uniform(shader, "min"); @@ -351,12 +352,14 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob, GPU_shader_uniform_texture(shader, spec_location, tex_spec); } - float active_color[4] = { 0.7, 0.7, 0.7, 10.0 }; - if ((sds->active_fields & SM_ACTIVE_COLORS) != 0) - copy_v3_v3(active_color, sds->active_color); + float active_color[3] = { 0.9, 0.9, 0.9 }; + float density_scale = 10.0f; + if ((sds->active_fields & SM_ACTIVE_COLORS) == 0) + mul_v3_v3(active_color, sds->active_color); - GPU_shader_uniform_vector(shader, actcol_location, 4, 1, active_color); - GPU_shader_uniform_vector(shader, cellspace_location, 1, 1, &sds->dx); + GPU_shader_uniform_vector(shader, actcol_location, 3, 1, active_color); + GPU_shader_uniform_vector(shader, stepsize_location, 1, 1, &sds->dx); + GPU_shader_uniform_vector(shader, densityscale_location, 1, 1, &density_scale); GPU_shader_uniform_vector(shader, min_location, 3, 1, min); GPU_shader_uniform_vector(shader, ob_sizei_location, 3, 1, ob_sizei); GPU_shader_uniform_vector(shader, invsize_location, 3, 1, invsize); |