-
-
Notifications
You must be signed in to change notification settings - Fork 412
Refactor Geometry Rendering #909
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
Open
kblaschke
wants to merge
19
commits into
projectM-visualizer:master
Choose a base branch
from
kblaschke:refactor-geometry-rendering
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor Geometry Rendering #909
kblaschke
wants to merge
19
commits into
projectM-visualizer:master
from
kblaschke:refactor-geometry-rendering
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6ec8ece
to
bfad7d1
Compare
Reduced draw calls from 4/8 to 1/2 by specifying 8 vertices accessed via indices to draw each border in a single call.
Also get rid of the additional index attribute array, as gl_VertexID contains the same information and is free.
Now using the generated grid vertices and indices directly, drawing the warp mesh in a single draw call. This will increase the number of drawn vertices, but all GPUs made in the past decade can easily deal with 100K triangles or more.
bfad7d1
to
92c94c8
Compare
…e rendering to match MilkDrop orientation
Cherry-picked a commit from @kholbrook1303 from PR #907 on top of my changes. Fixes issue #903 |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In preparation for future changes and to make the rendering process less verbose, I've refactored all code related to drawing geometry (points, lines, triangles, quads, ...) into a small number of wrapper classes which store and manage the vertex data. Since I've reworked all rendering code in projectM in this changeset, here's an overview of what has changed:
TextureCopier
are now cached.Mesh
class manages the most frequently used buffers: position, color and texture coordinates.Mesh
class always uses indexed rendering, e.g. usingglDrawElements()
.gl_VertexID
uniform.Point
data type in the default waveform implementations has been changed from theRenderItem
type to the newPoint
class in thelibprojectM::Renderer
namespace.Besides reviewing the code, helping with regression testing with presets would be really nice! I've already tested each effect thoroughly while implementing the changes, but some small mistakes may still be present.