|
Blender V4.3
|
Classes | |
| struct | RegionViewData |
Functions | |
| RegionViewData | region_init (ARegion ®ion, const int2 &win_size) |
| void | region_reset (ARegion ®ion, const RegionViewData &data) |
| GPUOffScreen * | image_render_begin (const int2 &win_size) |
| Image * | image_render_end (Main &bmain, GPUOffScreen *buffer) |
| void | compute_view_matrices (const ViewContext &view_context, const Scene &scene, const int2 &win_size, const float2 &zoom, const float2 &offset) |
| void | set_view_matrix (const RegionView3D &rv3d) |
| void | clear_view_matrix () |
| void | set_projection_matrix (const RegionView3D &rv3d) |
| void | clear_projection_matrix () |
| void | draw_dot (const float4x4 &transform, const float3 &position, const float point_size, const ColorGeometry4f &color) |
| void | draw_polyline (const float4x4 &transform, const IndexRange indices, Span< float3 > positions, const VArray< ColorGeometry4f > &colors, const bool cyclic, const float line_width) |
| static GPUUniformBuf * | create_shader_ubo (const RegionView3D &rv3d, const int2 &win_size, const Object &object, const eGPDstroke_Caps cap_start, const eGPDstroke_Caps cap_end, const bool is_fill_stroke) |
| static void | draw_grease_pencil_stroke (const float4x4 &transform, const RegionView3D &rv3d, const int2 &win_size, const Object &object, const IndexRange indices, Span< float3 > positions, const VArray< float > &radii, const VArray< ColorGeometry4f > &colors, const bool cyclic, const eGPDstroke_Caps cap_start, const eGPDstroke_Caps cap_end, const bool fill_stroke, const float radius_scale) |
| static void | draw_dots (const float4x4 &transform, const IndexRange indices, Span< float3 > positions, const VArray< float > &radii, const VArray< ColorGeometry4f > &colors, const float radius_scale) |
| void | draw_circles (const float4x4 &transform, const IndexRange indices, Span< float3 > centers, const VArray< float > &radii, const VArray< ColorGeometry4f > &colors, const float2 &viewport_size, const float line_width, const bool fill) |
| void | draw_lines (const float4x4 &transform, IndexRange indices, Span< float3 > start_positions, Span< float3 > end_positions, const VArray< ColorGeometry4f > &colors, float line_width) |
| void | draw_grease_pencil_strokes (const RegionView3D &rv3d, const int2 &win_size, const Object &object, const bke::greasepencil::Drawing &drawing, const float4x4 &transform, const IndexMask &strokes_mask, const VArray< ColorGeometry4f > &colors, const bool use_xray, const float radius_scale) |
Variables | |
| constexpr const bool | enable_debug_gpu_capture = true |
| constexpr const float | min_stroke_thickness = 0.05f |
| void blender::ed::greasepencil::image_render::clear_projection_matrix | ( | ) |
Definition at line 202 of file grease_pencil_image_render.cc.
References GPU_matrix_identity_projection_set().
| void blender::ed::greasepencil::image_render::clear_view_matrix | ( | ) |
Definition at line 192 of file grease_pencil_image_render.cc.
References GPU_matrix_identity_set().
Referenced by draw_grease_pencil_strokes(), and blender::ed::sculpt_paint::grease_pencil_fill_overlay_cb().
| void blender::ed::greasepencil::image_render::compute_view_matrices | ( | const ViewContext & | view_context, |
| const Scene & | scene, | ||
| const int2 & | win_size, | ||
| const float2 & | zoom, | ||
| const float2 & | offset ) |
Set up the view matrix for world space rendering.
| win_size | Size of the render window. |
| zoom | Zoom factor to render a smaller or larger part of the view. |
| offset | Offset of the view relative to the overall size. |
Definition at line 126 of file grease_pencil_image_render.cc.
References ViewContext::depsgraph, ED_view3d_update_viewmat(), ED_view3d_viewplane_get(), orthographic_m4(), perspective_m4(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), ViewContext::region, ViewContext::rv3d, ViewContext::v3d, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
|
static |
Definition at line 261 of file grease_pencil_image_render.cc.
References blender::math::average(), copy_v2_v2(), data, GP_XRAY_3DSPACE, GPU_uniformbuf_create_ex(), and RegionView3D::pixsize.
Referenced by draw_grease_pencil_stroke().
| void blender::ed::greasepencil::image_render::draw_circles | ( | const float4x4 & | transform, |
| const IndexRange | indices, | ||
| Span< float3 > | centers, | ||
| const VArray< float > & | radii, | ||
| const VArray< ColorGeometry4f > & | colors, | ||
| const float2 & | viewport_size, | ||
| const float | line_width, | ||
| const bool | fill ) |
Draw points as circles.
Definition at line 395 of file grease_pencil_image_render.cc.
References blender::math::average(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINE_STRIP, GPU_PRIM_TRI_STRIP, GPU_SHADER_3D_FLAT_COLOR, GPU_SHADER_3D_POLYLINE_FLAT_COLOR, GPU_vertformat_attr_add(), immAttr4fv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2fv(), immVertex3fv(), immVertexFormat(), indices, blender::math::to_scale(), and blender::math::transform_point().
Referenced by blender::ed::sculpt_paint::grease_pencil_fill_overlay_cb().
| void blender::ed::greasepencil::image_render::draw_dot | ( | const float4x4 & | transform, |
| const float3 & | position, | ||
| float | point_size, | ||
| const ColorGeometry4f & | color ) |
Draw a dot with a given size and color.
Definition at line 207 of file grease_pencil_image_render.cc.
References attr_size(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_POINTS, GPU_program_point_size(), GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR, GPU_vertformat_attr_add(), immAttr1f(), immAttr4fv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), M_SQRT2, and blender::math::transform_point().
|
static |
Definition at line 357 of file grease_pencil_image_render.cc.
References attr_size(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_POINTS, GPU_program_point_size(), GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR, GPU_vertformat_attr_add(), immAttr1f(), immAttr4fv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), indices, blender::bke::greasepencil::LEGACY_RADIUS_CONVERSION_FACTOR, min_stroke_thickness, and blender::math::transform_point().
Referenced by draw_grease_pencil_strokes().
|
static |
Definition at line 286 of file grease_pencil_image_render.cc.
References create_shader_ubo(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINE_STRIP_ADJ, GPU_SHADER_GPENCIL_STROKE, GPU_uniformbuf_free(), GPU_vertformat_attr_add(), immAttr1f(), immAttr4fv(), immBeginAtMost(), immBindBuiltinProgram(), immBindUniformBuf(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), indices, blender::bke::greasepencil::LEGACY_RADIUS_CONVERSION_FACTOR, min_stroke_thickness, and blender::math::transform_point().
Referenced by draw_grease_pencil_strokes().
| void blender::ed::greasepencil::image_render::draw_grease_pencil_strokes | ( | const RegionView3D & | rv3d, |
| const int2 & | win_size, | ||
| const Object & | object, | ||
| const bke::greasepencil::Drawing & | drawing, | ||
| const float4x4 & | transform, | ||
| const IndexMask & | strokes_mask, | ||
| const VArray< ColorGeometry4f > & | colors, | ||
| bool | use_xray, | ||
| float | radius_scale = 1.0f ) |
Draw curves geometry.
| mode | Mode of eMaterialGPencilStyle_Mode. |
Definition at line 507 of file grease_pencil_image_render.cc.
References BKE_object_material_get(), clear_view_matrix(), blender::bke::Curve, draw_dots(), draw_grease_pencil_stroke(), MaterialGPencilStyle::flag, blender::index_mask::IndexMask::foreach_index(), GP_MATERIAL_HIDE, GP_MATERIAL_MODE_DOT, GP_MATERIAL_MODE_LINE, GP_MATERIAL_MODE_SQUARE, GP_STROKE_CAP_ROUND, Material::gp_style, GPU_DEPTH_LESS_EQUAL, GPU_depth_mask(), GPU_depth_mask_get(), GPU_DEPTH_NONE, GPU_depth_test(), GPU_polygon_offset(), GPU_program_point_size(), MaterialGPencilStyle::mode, blender::bke::greasepencil::Drawing::radii(), set_view_matrix(), and blender::bke::greasepencil::Drawing::strokes().
Referenced by blender::ed::sculpt_paint::grease_pencil_fill_overlay_cb().
| void blender::ed::greasepencil::image_render::draw_lines | ( | const float4x4 & | transform, |
| IndexRange | indices, | ||
| Span< float3 > | start_positions, | ||
| Span< float3 > | end_positions, | ||
| const VArray< ColorGeometry4f > & | colors, | ||
| float | line_width ) |
Draw lines with start and end points.
Definition at line 479 of file grease_pencil_image_render.cc.
References GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_3D_FLAT_COLOR, GPU_vertformat_attr_add(), immAttr4fv(), immBeginAtMost(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), indices, and blender::math::transform_point().
Referenced by blender::ed::sculpt_paint::grease_pencil_fill_overlay_cb().
| void blender::ed::greasepencil::image_render::draw_polyline | ( | const float4x4 & | transform, |
| IndexRange | indices, | ||
| Span< float3 > | positions, | ||
| const VArray< ColorGeometry4f > & | colors, | ||
| bool | cyclic, | ||
| float | line_width ) |
Draw a poly line from points.
Definition at line 228 of file grease_pencil_image_render.cc.
References GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINE_STRIP, GPU_SHADER_3D_FLAT_COLOR, GPU_vertformat_attr_add(), immAttr4fv(), immBeginAtMost(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), indices, and blender::math::transform_point().
| GPUOffScreen * blender::ed::greasepencil::image_render::image_render_begin | ( | const int2 & | win_size | ) |
Create and off-screen buffer for rendering.
Definition at line 66 of file grease_pencil_image_render.cc.
References enable_debug_gpu_capture, GPU_clear_color(), GPU_clear_depth(), GPU_debug_capture_begin(), GPU_matrix_identity_projection_set(), GPU_matrix_identity_set(), GPU_matrix_push(), GPU_matrix_push_projection(), GPU_offscreen_bind(), GPU_offscreen_create(), GPU_RGBA8, and GPU_TEXTURE_USAGE_HOST_READ.
| Image * blender::ed::greasepencil::image_render::image_render_end | ( | Main & | bmain, |
| GPUOffScreen * | buffer ) |
Finish rendering and convert the off-screen buffer into an image.
Definition at line 92 of file grease_pencil_image_render.cc.
References BKE_image_add_from_imbuf(), BKE_image_release_ibuf(), ImBuf::byte_buffer, ImBufByteBuffer::data, ImBufFloatBuffer::data, enable_debug_gpu_capture, ImBuf::float_buffer, GPU_DATA_FLOAT, GPU_DATA_UBYTE, GPU_debug_capture_end(), GPU_matrix_pop(), GPU_matrix_pop_projection(), GPU_offscreen_free(), GPU_offscreen_height(), GPU_offscreen_read_color(), GPU_offscreen_unbind(), GPU_offscreen_width(), IB_rect, Image::id, ID_TAG_DOIT, IMB_allocImBuf(), IMB_rect_from_float(), and ID::tag.
| RegionViewData blender::ed::greasepencil::image_render::region_init | ( | ARegion & | region, |
| const int2 & | win_size ) |
Set up region to match the render buffer size.
Definition at line 44 of file grease_pencil_image_render.cc.
References data.
| void blender::ed::greasepencil::image_render::region_reset | ( | ARegion & | region, |
| const RegionViewData & | data ) |
Restore original region size after rendering.
Definition at line 59 of file grease_pencil_image_render.cc.
| void blender::ed::greasepencil::image_render::set_projection_matrix | ( | const RegionView3D & | rv3d | ) |
Definition at line 197 of file grease_pencil_image_render.cc.
References GPU_matrix_projection_set, and RegionView3D::winmat.
| void blender::ed::greasepencil::image_render::set_view_matrix | ( | const RegionView3D & | rv3d | ) |
Definition at line 187 of file grease_pencil_image_render.cc.
References GPU_matrix_set, and RegionView3D::viewmat.
Referenced by draw_grease_pencil_strokes().
|
constexpr |
Definition at line 42 of file grease_pencil_image_render.cc.
Referenced by image_render_begin(), and image_render_end().
|
constexpr |
Definition at line 284 of file grease_pencil_image_render.cc.
Referenced by draw_dots(), and draw_grease_pencil_stroke().