diff options
author | Sriharsha Kotcharlakot <k.venkatsriharsha@gmail.com> | 2020-09-15 18:51:14 +0300 |
---|---|---|
committer | Sriharsha Kotcharlakot <k.venkatsriharsha@gmail.com> | 2020-09-15 20:43:01 +0300 |
commit | f137022f9919f4dd315ec6b325a08e1bf5aec6fb (patch) | |
tree | 4b15aa230eb100e77b41dfffb8ef5e7501c55db5 /source/blender/makesdna/DNA_fluid_types.h | |
parent | bedbd8655ed1d331aeaf756874c46dbed93168a1 (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/DNA_fluid_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_fluid_types.h | 77 |
1 files changed, 61 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; |