Skip to content

Investigate line width control for dashed lines in Vulkan #52

@MightyBOBcnc

Description

@MightyBOBcnc

In the Merge Tool we use a vertex shader + fragment shader to draw dashed lines in the multi-merge mode. This is based on a code example provided by Blender.

Older example:
https://docs.blender.org/api/3.0/gpu.html#custom-shader-for-dotted-3d-line

Updated example:
https://docs.blender.org/api/4.5/gpu.html#custom-shader-for-dotted-3d-line

When Blender is using OpenGL as a back end we have historically been able to use gpu.state.line_width_set() to change the line width outside of the shaders themselves. This does not work with Vulkan. We likely need to modify the vert and/or frag shader to regain control over line width.

There may be something useful to learn from Blender's source, e.g.:
https://projects.blender.org/blender/blender/src/branch/main/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions