2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2016 Blender Foundation. */
|
2017-02-07 11:20:15 +01:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup draw
|
2017-02-07 11:20:15 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-08-31 12:20:28 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch;
|
2017-06-28 13:38:24 +10:00
|
|
|
struct GPUMaterial;
|
2022-10-21 13:09:07 +02:00
|
|
|
struct GPUVertBuf;
|
2017-06-22 19:19:55 +02:00
|
|
|
struct ModifierData;
|
2018-05-09 11:14:27 +02:00
|
|
|
struct Object;
|
|
|
|
|
struct PTCacheEdit;
|
2019-08-20 10:11:53 +10:00
|
|
|
struct ParticleSystem;
|
2020-03-17 16:27:08 +01:00
|
|
|
struct Volume;
|
|
|
|
|
struct VolumeGrid;
|
2020-03-09 16:27:24 +01:00
|
|
|
struct bGPDstroke;
|
2022-05-02 09:22:14 +02:00
|
|
|
struct bGPdata;
|
2017-02-07 11:20:15 +01:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/**
|
|
|
|
|
* Shape resolution level of detail.
|
|
|
|
|
*/
|
2020-11-13 08:24:52 +01:00
|
|
|
typedef enum eDRWLevelOfDetail {
|
|
|
|
|
DRW_LOD_LOW = 0,
|
|
|
|
|
DRW_LOD_MEDIUM = 1,
|
|
|
|
|
DRW_LOD_HIGH = 2,
|
|
|
|
|
|
|
|
|
|
DRW_LOD_MAX, /* Max number of level of detail */
|
|
|
|
|
} eDRWLevelOfDetail;
|
|
|
|
|
|
2017-02-07 11:20:15 +01:00
|
|
|
void DRW_shape_cache_free(void);
|
|
|
|
|
|
2018-03-27 23:50:26 +02:00
|
|
|
/* 3D cursor */
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_cursor_get(bool crosshair_lines);
|
2018-03-27 23:50:26 +02:00
|
|
|
|
2017-02-07 11:20:15 +01:00
|
|
|
/* Common Shapes */
|
2019-12-02 01:40:58 +01:00
|
|
|
struct GPUBatch *DRW_cache_groundline_get(void);
|
2021-12-08 20:29:39 +11:00
|
|
|
/* Grid */
|
2018-08-23 13:35:10 +02:00
|
|
|
struct GPUBatch *DRW_cache_grid_get(void);
|
2021-12-08 20:29:39 +11:00
|
|
|
/**
|
|
|
|
|
* Use this one for rendering full-screen passes. For 3D objects use #DRW_cache_quad_get().
|
|
|
|
|
*/
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_fullscreen_quad_get(void);
|
2021-12-08 20:29:39 +11:00
|
|
|
/* Just a regular quad with 4 vertices. */
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_quad_get(void);
|
2021-12-08 20:29:39 +11:00
|
|
|
/* Just a regular quad with 4 vertices - wires. */
|
2019-03-06 12:39:07 -03:00
|
|
|
struct GPUBatch *DRW_cache_quad_wires_get(void);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_cube_get(void);
|
2019-12-02 01:40:58 +01:00
|
|
|
struct GPUBatch *DRW_cache_normal_arrow_get(void);
|
2017-02-07 11:20:15 +01:00
|
|
|
|
2022-01-07 11:38:08 +11:00
|
|
|
struct GPUBatch *DRW_cache_sphere_get(eDRWLevelOfDetail level_of_detail);
|
2020-11-13 08:24:52 +01:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
/* Dummy VBOs */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
struct GPUBatch *DRW_gpencil_dummy_buffer_get(void);
|
|
|
|
|
|
2017-04-21 02:18:14 +10:00
|
|
|
/* Common Object */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-12-18 17:10:38 +01:00
|
|
|
struct GPUBatch *DRW_cache_object_all_edges_get(struct Object *ob);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_object_edge_detection_get(struct Object *ob, bool *r_is_manifold);
|
|
|
|
|
struct GPUBatch *DRW_cache_object_surface_get(struct Object *ob);
|
|
|
|
|
struct GPUBatch *DRW_cache_object_loose_edges_get(struct Object *ob);
|
|
|
|
|
struct GPUBatch **DRW_cache_object_surface_material_get(struct Object *ob,
|
2018-12-16 15:17:31 +01:00
|
|
|
struct GPUMaterial **gpumat_array,
|
2020-01-17 16:05:19 +01:00
|
|
|
uint gpumat_array_len);
|
2019-08-15 12:34:31 -03:00
|
|
|
struct GPUBatch *DRW_cache_object_face_wireframe_get(struct Object *ob);
|
2020-01-28 16:39:33 +01:00
|
|
|
int DRW_cache_object_material_count_get(struct Object *ob);
|
2017-04-21 02:18:14 +10:00
|
|
|
|
2021-12-08 20:29:39 +11:00
|
|
|
/**
|
|
|
|
|
* Returns the vertbuf used by shaded surface batch.
|
|
|
|
|
*/
|
2020-06-19 17:02:55 +02:00
|
|
|
struct GPUVertBuf *DRW_cache_object_pos_vertbuf_get(struct Object *ob);
|
|
|
|
|
|
2017-02-07 11:20:15 +01:00
|
|
|
/* Empties */
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_plain_axes_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_single_arrow_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_empty_cube_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_circle_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_empty_sphere_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_empty_cylinder_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_empty_cone_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_empty_capsule_cap_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_empty_capsule_body_get(void);
|
2017-02-07 11:20:15 +01:00
|
|
|
|
2017-04-10 22:22:37 +02:00
|
|
|
/* Force Field */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_field_wind_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_field_force_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_field_vortex_get(void);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/* Screen-aligned circle. */
|
|
|
|
|
|
2019-12-02 01:40:58 +01:00
|
|
|
struct GPUBatch *DRW_cache_field_curve_get(void);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_field_tube_limit_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_field_cone_limit_get(void);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
|
|
|
|
/* Screen-aligned dashed circle */
|
|
|
|
|
|
2019-12-02 01:40:58 +01:00
|
|
|
struct GPUBatch *DRW_cache_field_sphere_limit_get(void);
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2019-02-27 12:02:02 +11:00
|
|
|
/* Lights */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2019-12-02 01:40:58 +01:00
|
|
|
struct GPUBatch *DRW_cache_light_point_lines_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_light_sun_lines_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_light_spot_lines_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_light_area_disk_lines_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_light_area_square_lines_get(void);
|
2019-02-27 12:02:02 +11:00
|
|
|
struct GPUBatch *DRW_cache_light_spot_volume_get(void);
|
2017-02-07 11:20:15 +01:00
|
|
|
|
2017-03-04 00:09:22 +01:00
|
|
|
/* Camera */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_camera_frame_get(void);
|
2019-12-02 01:40:58 +01:00
|
|
|
struct GPUBatch *DRW_cache_camera_volume_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_camera_volume_wire_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_camera_tria_wire_get(void);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_camera_tria_get(void);
|
2019-12-02 01:40:58 +01:00
|
|
|
struct GPUBatch *DRW_cache_camera_distances_get(void);
|
2017-03-04 00:09:22 +01:00
|
|
|
|
2017-02-15 03:38:21 +01:00
|
|
|
/* Speaker */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_speaker_get(void);
|
2017-02-15 03:38:21 +01:00
|
|
|
|
2017-06-07 16:00:10 +02:00
|
|
|
/* Probe */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_lightprobe_cube_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_lightprobe_grid_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_lightprobe_planar_get(void);
|
2017-06-07 16:00:10 +02:00
|
|
|
|
2017-02-22 13:00:15 +01:00
|
|
|
/* Bones */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_bone_octahedral_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_octahedral_wire_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_box_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_box_wire_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_envelope_solid_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_envelope_outline_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_point_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_point_wire_outline_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_stick_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_arrows_get(void);
|
2018-10-03 15:42:05 +02:00
|
|
|
struct GPUBatch *DRW_cache_bone_dof_sphere_get(void);
|
|
|
|
|
struct GPUBatch *DRW_cache_bone_dof_lines_get(void);
|
2017-02-22 13:00:15 +01:00
|
|
|
|
2017-02-07 11:20:15 +01:00
|
|
|
/* Meshes */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-12-18 17:10:38 +01:00
|
|
|
struct GPUBatch *DRW_cache_mesh_all_verts_get(struct Object *ob);
|
|
|
|
|
struct GPUBatch *DRW_cache_mesh_all_edges_get(struct Object *ob);
|
|
|
|
|
struct GPUBatch *DRW_cache_mesh_loose_edges_get(struct Object *ob);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_mesh_edge_detection_get(struct Object *ob, bool *r_is_manifold);
|
2018-12-16 15:17:31 +01:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_get(struct Object *ob);
|
2018-12-18 17:10:38 +01:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_edges_get(struct Object *ob);
|
2021-12-08 20:29:39 +11:00
|
|
|
/**
|
|
|
|
|
* Return list of batches with length equal to `max(1, totcol)`.
|
|
|
|
|
*/
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch **DRW_cache_mesh_surface_shaded_get(struct Object *ob,
|
2018-12-16 15:17:31 +01:00
|
|
|
struct GPUMaterial **gpumat_array,
|
2020-01-17 16:05:19 +01:00
|
|
|
uint gpumat_array_len);
|
2021-12-08 20:29:39 +11:00
|
|
|
/**
|
|
|
|
|
* Return list of batches with length equal to `max(1, totcol)`.
|
|
|
|
|
*/
|
2018-12-16 15:17:31 +01:00
|
|
|
struct GPUBatch **DRW_cache_mesh_surface_texpaint_get(struct Object *ob);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_texpaint_single_get(struct Object *ob);
|
2018-12-18 17:10:38 +01:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_vertpaint_get(struct Object *ob);
|
Sculpt Vertex Colors: Initial implementation
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time.
This commit includes:
- SCULPT_UNDO_COLOR for undo support in sculpt mode
- SCULPT_UPDATE_COLOR and PBVH flags and rendering
- Sculpt Color API functions
- Sculpt capability for sculpt tools (only enabled in the Paint Brush for now)
- Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint)
- Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint)
- Remesher reprojection in the Voxel Remehser
- Paint Brush and Smear Brush with color smoothing in alt-smooth mode
- Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors
- Color Filter
- Color picker (uses S shortcut, replaces smooth)
- Color selector in the top bar
Reviewed By: brecht
Maniphest Tasks: T72866
Differential Revision: https://developer.blender.org/D5975
2020-06-22 20:05:28 +02:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_sculptcolors_get(struct Object *ob);
|
2018-12-18 17:10:38 +01:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_weights_get(struct Object *ob);
|
2019-04-18 08:00:59 +02:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_mesh_analysis_get(struct Object *ob);
|
2018-12-07 05:03:01 +01:00
|
|
|
struct GPUBatch *DRW_cache_mesh_face_wireframe_get(struct Object *ob);
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
struct GPUBatch *DRW_cache_mesh_surface_viewer_attribute_get(struct Object *ob);
|
2017-02-07 11:20:15 +01:00
|
|
|
|
2017-04-15 16:46:17 +10:00
|
|
|
/* Curve */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_curve_edge_wire_get(struct Object *ob);
|
Geometry Nodes: viewport preview
This adds support for showing geometry passed to the Viewer in the 3d
viewport (instead of just in the spreadsheet). The "viewer geometry"
bypasses the group output. So it is not necessary to change the final
output of the node group to be able to see the intermediate geometry.
**Activation and deactivation of a viewer node**
* A viewer node is activated by clicking on it.
* Ctrl+shift+click on any node/socket connects it to the viewer and
makes it active.
* Ctrl+shift+click in empty space deactivates the active viewer.
* When the active viewer is not visible anymore (e.g. another object
is selected, or the current node group is exit), it is deactivated.
* Clicking on the icon in the header of the Viewer node toggles whether
its active or not.
**Pinning**
* The spreadsheet still allows pinning the active viewer as before.
When pinned, the spreadsheet still references the viewer node even
when it becomes inactive.
* The viewport does not support pinning at the moment. It always shows
the active viewer.
**Attribute**
* When a field is linked to the second input of the viewer node it is
displayed as an overlay in the viewport.
* When possible the correct domain for the attribute is determined
automatically. This does not work in all cases. It falls back to the
face corner domain on meshes and the point domain on curves. When
necessary, the domain can be picked manually.
* The spreadsheet now only shows the "Viewer" column for the domain
that is selected in the Viewer node.
* Instance attributes are visualized as a constant color per instance.
**Viewport Options**
* The attribute overlay opacity can be controlled with the "Viewer Node"
setting in the overlays popover.
* A viewport can be configured not to show intermediate viewer-geometry
by disabling the "Viewer Node" option in the "View" menu.
**Implementation Details**
* The "spreadsheet context path" was generalized to a "viewer path" that
is used in more places now.
* The viewer node itself determines the attribute domain, evaluates the
field and stores the result in a `.viewer` attribute.
* A new "viewer attribute' overlay displays the data from the `.viewer`
attribute.
* The ground truth for the active viewer node is stored in the workspace
now. Node editors, spreadsheets and viewports retrieve the active
viewer from there unless they are pinned.
* The depsgraph object iterator has a new "viewer path" setting. When set,
the viewed geometry of the corresponding object is part of the iterator
instead of the final evaluated geometry.
* To support the instance attribute overlay `DupliObject` was extended
to contain the information necessary for drawing the overlay.
* The ctrl+shift+click operator has been refactored so that it can make
existing links to viewers active again.
* The auto-domain-detection in the Viewer node works by checking the
"preferred domain" for every field input. If there is not exactly one
preferred domain, the fallback is used.
Known limitations:
* Loose edges of meshes don't have the attribute overlay. This could be
added separately if necessary.
* Some attributes are hard to visualize as a color directly. For example,
the values might have to be normalized or some should be drawn as arrays.
For now, we encourage users to build node groups that generate appropriate
viewer-geometry. We might include some of that functionality in future versions.
Support for displaying attribute values as text in the viewport is planned as well.
* There seems to be an issue with the attribute overlay for pointclouds on
nvidia gpus, to be investigated.
Differential Revision: https://developer.blender.org/D15954
2022-09-28 17:54:59 +02:00
|
|
|
struct GPUBatch *DRW_cache_curve_edge_wire_viewer_attribute_get(struct Object *ob);
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2017-04-21 17:58:18 +10:00
|
|
|
/* edit-mode */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-12-13 01:26:07 +01:00
|
|
|
struct GPUBatch *DRW_cache_curve_edge_normal_get(struct Object *ob);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_curve_edge_overlay_get(struct Object *ob);
|
2020-05-13 21:20:18 +02:00
|
|
|
struct GPUBatch *DRW_cache_curve_vert_overlay_get(struct Object *ob);
|
2017-04-21 02:18:14 +10:00
|
|
|
|
|
|
|
|
/* Font */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-12-14 15:23:13 +01:00
|
|
|
struct GPUBatch *DRW_cache_text_edge_wire_get(struct Object *ob);
|
2017-04-21 02:18:14 +10:00
|
|
|
|
|
|
|
|
/* Surface */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-12-14 15:23:13 +01:00
|
|
|
struct GPUBatch *DRW_cache_surf_edge_wire_get(struct Object *ob);
|
2017-04-15 16:46:17 +10:00
|
|
|
|
2017-04-13 22:09:59 +10:00
|
|
|
/* Lattice */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_lattice_verts_get(struct Object *ob);
|
|
|
|
|
struct GPUBatch *DRW_cache_lattice_wire_get(struct Object *ob, bool use_weight);
|
|
|
|
|
struct GPUBatch *DRW_cache_lattice_vert_overlay_get(struct Object *ob);
|
2017-04-13 22:09:59 +10:00
|
|
|
|
2017-05-09 16:23:47 +02:00
|
|
|
/* Particles */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_particles_get_hair(struct Object *object,
|
2018-05-26 10:41:25 +02:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct ModifierData *md);
|
2018-11-27 13:49:00 +01:00
|
|
|
struct GPUBatch *DRW_cache_particles_get_dots(struct Object *object, struct ParticleSystem *psys);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_particles_get_edit_strands(struct Object *object,
|
2018-11-27 13:49:00 +01:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct PTCacheEdit *edit,
|
|
|
|
|
bool use_weight);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_particles_get_edit_inner_points(struct Object *object,
|
2018-05-26 10:41:25 +02:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct PTCacheEdit *edit);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_particles_get_edit_tip_points(struct Object *object,
|
2018-05-26 10:41:25 +02:00
|
|
|
struct ParticleSystem *psys,
|
|
|
|
|
struct PTCacheEdit *edit);
|
2018-07-18 00:12:21 +02:00
|
|
|
struct GPUBatch *DRW_cache_particles_get_prim(int type);
|
2017-05-09 16:23:47 +02:00
|
|
|
|
Curves: Rename "Hair" types, variables, and functions to "Curves"
Based on discussions from T95355 and T94193, the plan is to use
the name "Curves" to describe the data-block container for multiple
curves. Eventually this will replace the existing "Curve" data-block.
However, it will be a while before the curve data-block can be replaced
so in order to distinguish the two curve types in the UI, "Hair Curves"
will be used, but eventually changed back to "Curves".
This patch renames "hair-related" files, functions, types, and variable
names to this convention. A deep rename is preferred to keep code
consistent and to avoid any "hair" terminology from leaking, since the
new data-block is meant for all curve types, not just hair use cases.
The downside of this naming is that the difference between "Curve"
and "Curves" has become important. That was considered during
design discussons and deemed acceptable, especially given the
non-permanent nature of the somewhat common conflict.
Some points of interest:
- All DNA compatibility is lost, just like rBf59767ff9729.
- I renamed `ID_HA` to `ID_CV` so there is no complete mismatch.
- `hair_curves` is used where necessary to distinguish from the
existing "curves" plural.
- I didn't rename any of the cycles/rendering code function names,
since that is also used by the old hair particle system.
Differential Revision: https://developer.blender.org/D14007
2022-02-07 11:55:54 -06:00
|
|
|
/* Curves */
|
|
|
|
|
|
|
|
|
|
struct GPUBatch *DRW_cache_curves_surface_get(struct Object *ob);
|
|
|
|
|
struct GPUBatch **DRW_cache_curves_surface_shaded_get(struct Object *ob,
|
|
|
|
|
struct GPUMaterial **gpumat_array,
|
|
|
|
|
uint gpumat_array_len);
|
|
|
|
|
struct GPUBatch *DRW_cache_curves_face_wireframe_get(struct Object *ob);
|
|
|
|
|
struct GPUBatch *DRW_cache_curves_edge_detection_get(struct Object *ob, bool *r_is_manifold);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
|
|
|
|
/* Volume */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2020-03-17 16:27:08 +01:00
|
|
|
typedef struct DRWVolumeGrid {
|
|
|
|
|
struct DRWVolumeGrid *next, *prev;
|
|
|
|
|
|
|
|
|
|
/* Grid name. */
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
/* 3D texture. */
|
|
|
|
|
struct GPUTexture *texture;
|
|
|
|
|
|
|
|
|
|
/* Transform between 0..1 texture space and object space. */
|
|
|
|
|
float texture_to_object[4][4];
|
|
|
|
|
float object_to_texture[4][4];
|
|
|
|
|
|
2021-02-05 16:23:34 +11:00
|
|
|
/* Transform from bounds to texture space. */
|
2020-03-17 16:27:08 +01:00
|
|
|
float object_to_bounds[4][4];
|
|
|
|
|
float bounds_to_texture[4][4];
|
|
|
|
|
} DRWVolumeGrid;
|
|
|
|
|
|
2021-04-08 12:00:26 -05:00
|
|
|
DRWVolumeGrid *DRW_volume_batch_cache_get_grid(struct Volume *volume,
|
|
|
|
|
const struct VolumeGrid *grid);
|
2020-03-17 16:27:08 +01:00
|
|
|
struct GPUBatch *DRW_cache_volume_face_wireframe_get(struct Object *ob);
|
2020-09-29 12:39:41 +02:00
|
|
|
struct GPUBatch *DRW_cache_volume_selection_surface_get(struct Object *ob);
|
2020-03-17 16:27:08 +01:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
/* GPencil */
|
2021-12-08 20:29:39 +11:00
|
|
|
|
2022-10-21 13:09:07 +02:00
|
|
|
struct GPUBatch *DRW_cache_gpencil_get(struct Object *ob, int cfra);
|
|
|
|
|
struct GPUVertBuf *DRW_cache_gpencil_position_buffer_get(struct Object *ob, int cfra);
|
|
|
|
|
struct GPUVertBuf *DRW_cache_gpencil_color_buffer_get(struct Object *ob, int cfra);
|
2020-03-09 16:27:24 +01:00
|
|
|
struct GPUBatch *DRW_cache_gpencil_edit_lines_get(struct Object *ob, int cfra);
|
|
|
|
|
struct GPUBatch *DRW_cache_gpencil_edit_points_get(struct Object *ob, int cfra);
|
2020-11-13 21:43:00 +01:00
|
|
|
struct GPUBatch *DRW_cache_gpencil_edit_curve_handles_get(struct Object *ob, int cfra);
|
|
|
|
|
struct GPUBatch *DRW_cache_gpencil_edit_curve_points_get(struct Object *ob, int cfra);
|
2022-10-24 15:28:49 +02:00
|
|
|
struct GPUBatch *DRW_cache_gpencil_sbuffer_get(struct Object *ob, bool show_fill);
|
|
|
|
|
struct GPUVertBuf *DRW_cache_gpencil_sbuffer_position_buffer_get(struct Object *ob,
|
|
|
|
|
bool show_fill);
|
|
|
|
|
struct GPUVertBuf *DRW_cache_gpencil_sbuffer_color_buffer_get(struct Object *ob, bool show_fill);
|
2022-05-02 09:22:14 +02:00
|
|
|
int DRW_gpencil_material_count_get(struct bGPdata *gpd);
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
struct GPUBatch *DRW_cache_gpencil_face_wireframe_get(struct Object *ob);
|
|
|
|
|
|
|
|
|
|
struct bGPDstroke *DRW_cache_gpencil_sbuffer_stroke_data_get(struct Object *ob);
|
2021-12-08 20:29:39 +11:00
|
|
|
/**
|
|
|
|
|
* Sbuffer batches are temporary. We need to clear it after drawing.
|
|
|
|
|
*/
|
2020-03-09 16:27:24 +01:00
|
|
|
void DRW_cache_gpencil_sbuffer_clear(struct Object *ob);
|
2021-08-31 12:20:28 +02:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|