8000 Draw lines with no geometry shader by einarf · Pull Request #2714 · pythonarcade/arcade · GitHub
[go: up one dir, main page]

Skip to content

Draw lines with no geometry shader #2714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2025
Merged

Draw lines with no geometry shader #2714

merged 1 commit into from
Jun 7, 2025

Conversation

einarf
Copy link
Member
@einarf einarf commented Jun 7, 2025

No description provided.

@einarf einarf requested a review from Copilot June 7, 2025 18:52
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the geometry-shader–based line rendering with an instanced vertex-shader approach, removing the unbuffered geometry shader and updating the draw calls and context setup accordingly.

  • Remove unbuffered_geo.glsl and shift quad construction into the vertex shader
  • Update draw_line/draw_lines to use instanced rendering instead of gl.LINES
  • Adjust Context to configure a dummy quad buffer and instance position buffer

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
resources/system/shaders/shapes/line/unbuffered_vs.glsl New instanced vertex shader generates quads by gl_VertexID
resources/system/shaders/shapes/line/unbuffered_geo.glsl Removed old geometry shader
draw/line.py Switched geometry.render calls to use instances
context.py Dropped geometry shader, added dummy quad & instance buffers
Comments suppressed due to low confidence (2)

resources/system/shaders/shapes/line/unbuffered_vs.glsl:10

  • The attribute 'in_vert' is declared but not actually used after moving quad logic into the shader via gl_VertexID. Consider removing it and the corresponding dummy buffer setup to simplify the pipeline.
in vec2 in_vert;

resources/system/shaders/shapes/line/unbuffered_vs.glsl:24

  • [nitpick] Using the literal '4' for the quad vertex count is a magic number. Define a constant like 'const int QUAD_VERT_COUNT = 4;' for clarity and easier updates.
    vec2 positions[4] = vec2[4](

@einarf einarf merged commit cb5799f into development Jun 7, 2025
7 checks passed
@einarf einarf deleted the lines-no-geo branch June 7, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0