[Bf-blender-cvs] [b20a8630b24] soc-2020-fluid-tools: Fluid: Limited gridlines to raw grid display
Sriharsha Kotcharlakot
noreply at git.blender.org
Mon Jun 29 08:46:35 CEST 2020
Commit: b20a8630b24ee1b665d6a2be455f8adfc74e69bd
Author: Sriharsha Kotcharlakot
Date: Mon Jun 29 12:16:00 2020 +0530
Branches: soc-2020-fluid-tools
https://developer.blender.org/rBb20a8630b24ee1b665d6a2be455f8adfc74e69bd
Fluid: Limited gridlines to raw grid display
===================================================================
M release/scripts/startup/bl_ui/properties_physics_fluid.py
M source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 2aeb56d1ae7..b632a976a56 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -1269,7 +1269,8 @@ class PHYSICS_PT_viewport_display(PhysicButtonsPanel, Panel):
if not do_full_slicing:
col.prop(domain, "slice_axis")
col.prop(domain, "slice_depth")
- col.prop(domain, "show_gridlines", text="Show Gridlines")
+ if domain.display_interpolation == "RAW" or domain.coba_field == "FLAGS":
+ col.prop(domain, "show_gridlines", text="Show Gridlines")
col = col.column()
col.active = do_full_slicing
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
index 0c4ede901b3..0f40b287a6c 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
@@ -138,7 +138,7 @@ vec4 sample_raw(sampler3D ima, vec3 co)
void volume_properties(vec3 ls_pos, out vec3 scattering, out float extinction)
{
vec3 co = ls_pos * 0.5 + 0.5;
-#ifdef VOLUME_SLICE
+#if defined(VOLUME_SLICE) && (!(defined(USE_TRILINEAR) || defined(USE_TRICUBIC)) || showFlags)
bool gridline = (showFlags) ? on_gridline(flagTexture, co) : on_gridline(densityTexture, co);
if (gridline) {
scattering = vec3(0.0, 0.0, 0.0);
@@ -184,7 +184,7 @@ void volume_properties(vec3 ls_pos, out vec3 scattering, out float extinction)
if (tval.rgb == vec3(0.0)) {
tval.rgb += vec3(0.5, 0.0, 0.0); /* medium red */
}
- }
+ }
else {
float val = sample_volume_texture(densityTexture, co).r * gridScale;
tval = texture(transferTexture, val);
More information about the Bf-blender-cvs
mailing list