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:
authorSriharsha Kotcharlakot <k.venkatsriharsha@gmail.com>2020-09-15 18:51:14 +0300
committerSriharsha Kotcharlakot <k.venkatsriharsha@gmail.com>2020-09-15 20:43:01 +0300
commitf137022f9919f4dd315ec6b325a08e1bf5aec6fb (patch)
tree4b15aa230eb100e77b41dfffb8ef5e7501c55db5 /source/blender/makesdna
parentbedbd8655ed1d331aeaf756874c46dbed93168a1 (diff)
Liquid Simulation Display Options (GSoC 2020)
All the changes made in the branch `soc-2020-fluid-tools` are included in this patch. **Major changes:** === Viewport Display === - //Raw voxel display// or //closest (nearest-neighbor)// interpolation for displaying the underlying voxel data of the simulation grids more clearly. - An option to display //gridlines// when the slicing method is //single//. ==== Grid Display ==== - Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Manta GUI. ==== Vector Display ==== - //**M**arker **A**nd **C**ell// grid visualization options for vector grids like velocity or external forces. - Made vector display options available for external forces. ==== Coloring options for //gridlines// ==== - Range highlighting and cell filtering options for displaying the simulation grid data more precisely. - Color gridlines with flags. - Also, made slicing and interpolation options available for Volume Object. Reviewed By: JacquesLucke, sebbas Differential Revision: https://developer.blender.org/D8705
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_fluid_types.h77
-rw-r--r--source/blender/makesdna/DNA_volume_defaults.h1
-rw-r--r--source/blender/makesdna/DNA_volume_types.h25
3 files changed, 87 insertions, 16 deletions
diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h
index 6035c43ad57..8e7f3471e1e 100644
--- a/source/blender/makesdna/DNA_fluid_types.h
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -66,12 +66,6 @@ enum {
FLUID_DOMAIN_FILE_BIN_OBJECT = (1 << 4),
};
-/* Slice method. */
-enum {
- FLUID_DOMAIN_SLICE_VIEW_ALIGNED = 0,
- FLUID_DOMAIN_SLICE_AXIS_ALIGNED = 1,
-};
-
/* Axis aligned method. */
enum {
AXIS_SLICE_FULL = 0,
@@ -86,17 +80,32 @@ enum {
SLICE_AXIS_Z = 3,
};
-/* Axis aligned method. */
-enum {
- VOLUME_INTERP_LINEAR = 0,
- VOLUME_INTERP_CUBIC = 1,
-};
+/* Display interpolation method. */
+typedef enum FLUID_DisplayInterpolationMethod {
+ FLUID_DISPLAY_INTERP_LINEAR = 0,
+ FLUID_DISPLAY_INTERP_CUBIC = 1,
+ FLUID_DISPLAY_INTERP_CLOSEST = 2,
+} FLUID_DisplayInterpolationMethod;
enum {
VECTOR_DRAW_NEEDLE = 0,
VECTOR_DRAW_STREAMLINE = 1,
+ VECTOR_DRAW_MAC = 2,
+};
+
+enum {
+ VECTOR_DRAW_MAC_X = (1 << 0),
+ VECTOR_DRAW_MAC_Y = (1 << 1),
+ VECTOR_DRAW_MAC_Z = (1 << 2),
};
+/* Fluid domain vector fields. */
+typedef enum FLUID_DisplayVectorField {
+ FLUID_DOMAIN_VECTOR_FIELD_VELOCITY = 0,
+ FLUID_DOMAIN_VECTOR_FIELD_GUIDE_VELOCITY = 1,
+ FLUID_DOMAIN_VECTOR_FIELD_FORCE = 2,
+} FLUID_DisplayVectorField;
+
enum {
SNDPARTICLE_BOUNDARY_DELETE = 0,
SNDPARTICLE_BOUNDARY_PUSHOUT = 1,
@@ -125,6 +134,28 @@ enum {
FLUID_DOMAIN_FIELD_FORCE_X = 11,
FLUID_DOMAIN_FIELD_FORCE_Y = 12,
FLUID_DOMAIN_FIELD_FORCE_Z = 13,
+ FLUID_DOMAIN_FIELD_PHI = 14,
+ FLUID_DOMAIN_FIELD_PHI_IN = 15,
+ FLUID_DOMAIN_FIELD_PHI_OUT = 16,
+ FLUID_DOMAIN_FIELD_PHI_OBSTACLE = 17,
+ FLUID_DOMAIN_FIELD_FLAGS = 18,
+ FLUID_DOMAIN_FIELD_PRESSURE = 19,
+};
+
+/* Fluid gridline display color field types. */
+enum {
+ FLUID_GRIDLINE_COLOR_TYPE_FLAGS = 1,
+ FLUID_GRIDLINE_COLOR_TYPE_RANGE = 2,
+};
+
+/* Fluid cell types. */
+enum {
+ FLUID_CELL_TYPE_NONE = 0,
+ FLUID_CELL_TYPE_FLUID = (1 << 0),
+ FLUID_CELL_TYPE_OBSTACLE = (1 << 1),
+ FLUID_CELL_TYPE_EMPTY = (1 << 2),
+ FLUID_CELL_TYPE_INFLOW = (1 << 3),
+ FLUID_CELL_TYPE_OUTFLOW = (1 << 4),
};
/* Fluid domain types. */
@@ -446,6 +477,8 @@ typedef struct FluidDomainSettings {
struct GPUTexture *tex_velocity_x;
struct GPUTexture *tex_velocity_y;
struct GPUTexture *tex_velocity_z;
+ struct GPUTexture *tex_flags;
+ struct GPUTexture *tex_range_field;
struct Object *guide_parent;
/** Vertex velocities of simulated fluid mesh. */
struct FluidDomainVertexVelocity *mesh_velocities;
@@ -605,29 +638,41 @@ typedef struct FluidDomainSettings {
int timesteps_maximum;
/* Display options. */
- char slice_method, axis_slice_method;
- char slice_axis, draw_velocity;
float slice_per_voxel;
float slice_depth;
float display_thickness;
+ float grid_scale;
struct ColorBand *coba;
float vector_scale;
+ float gridlines_lower_bound;
+ float gridlines_upper_bound;
+ float gridlines_range_color[4];
+ char axis_slice_method;
+ char slice_axis;
+ char show_gridlines;
+ char draw_velocity;
char vector_draw_type;
+ char vector_field; /* Simulation field used for vector display. */
+ char vector_scale_with_magnitude;
+ char vector_draw_mac_components;
char use_coba;
char coba_field; /* Simulation field used for the color mapping. */
char interp_method;
+ char gridlines_color_field; /* Simulation field used to color map onto gridlines. */
+ char gridlines_cell_filter;
+ char _pad9[7];
/* OpenVDB cache options. */
int openvdb_compression;
float clipping;
char openvdb_data_depth;
- char _pad9[7]; /* Unused. */
+ char _pad10[7]; /* Unused. */
/* -- Deprecated / unsed options (below). -- */
/* View options. */
int viewsettings;
- char _pad10[4]; /* Unused. */
+ char _pad11[4]; /* Unused. */
/* Pointcache options. */
/* Smoke uses only one cache from now on (index [0]), but keeping the array for now for reading
@@ -637,7 +682,7 @@ typedef struct FluidDomainSettings {
int cache_comp;
int cache_high_comp;
char cache_file_format;
- char _pad11[7]; /* Unused. */
+ char _pad12[7]; /* Unused. */
} FluidDomainSettings;
diff --git a/source/blender/makesdna/DNA_volume_defaults.h b/source/blender/makesdna/DNA_volume_defaults.h
index 8239f263c6c..a710754659b 100644
--- a/source/blender/makesdna/DNA_volume_defaults.h
+++ b/source/blender/makesdna/DNA_volume_defaults.h
@@ -32,6 +32,7 @@
.density = 1.0f, \
.wireframe_type = VOLUME_WIREFRAME_BOXES, \
.wireframe_detail = VOLUME_WIREFRAME_COARSE, \
+ .slice_depth = 0.5f, \
}
#define _DNA_DEFAULT_VolumeRender \
diff --git a/source/blender/makesdna/DNA_volume_types.h b/source/blender/makesdna/DNA_volume_types.h
index 30ac67281e2..bbd23298aea 100644
--- a/source/blender/makesdna/DNA_volume_types.h
+++ b/source/blender/makesdna/DNA_volume_types.h
@@ -38,6 +38,10 @@ typedef struct VolumeDisplay {
float density;
int wireframe_type;
int wireframe_detail;
+ int interpolation_method;
+ int axis_slice_method;
+ int slice_axis;
+ float slice_depth;
int _pad[1];
} VolumeDisplay;
@@ -119,5 +123,26 @@ typedef enum VolumeRenderSpace {
VOLUME_SPACE_WORLD = 1,
} VolumeRenderSpace;
+/* VolumeDisplay.interpolation_method */
+typedef enum VolumeDisplayInterpMethod {
+ VOLUME_DISPLAY_INTERP_LINEAR = 0,
+ VOLUME_DISPLAY_INTERP_CUBIC = 1,
+ VOLUME_DISPLAY_INTERP_CLOSEST = 2,
+} VolumeDisplayInterpMethod;
+
+/* VolumeDisplay.axis_slice_method */
+typedef enum AxisAlignedSlicingMethod {
+ VOLUME_AXIS_SLICE_FULL = 0,
+ VOLUME_AXIS_SLICE_SINGLE = 1,
+} AxisAlignedSlicingMethod;
+
+/* VolumeDisplay.slice_axis */
+typedef enum SliceAxis {
+ VOLUME_SLICE_AXIS_AUTO = 0,
+ VOLUME_SLICE_AXIS_X = 1,
+ VOLUME_SLICE_AXIS_Y = 2,
+ VOLUME_SLICE_AXIS_Z = 3,
+} SliceAxis;
+
/* Only one material supported currently. */
#define VOLUME_MATERIAL_NR 1