circleguard / circlevis

A (Py)Qt widget for visualizing osu! beatmaps and replays
GNU Affero General Public License v3.0
7 stars 1 forks source link

Support hardware acceleration for renderer #17

Open Stedoss opened 1 year ago

Stedoss commented 1 year ago

Might be worth it for some people who need it, but it seems to run pretty well on software rendering anyways. Tested with the following diff and it does indeed use my GPU, however resizing is very broken (and might be a pain to fix).

--- a/circlevis/renderer.py
+++ b/circlevis/renderer.py
@@ -4,6 +4,7 @@ from datetime import timedelta
 from dataclasses import dataclass

 import numpy as np
+from PyQt6.QtOpenGLWidgets import QOpenGLWidget
 from scipy import interpolate
 from PyQt6.QtGui import (QBrush, QPen, QColor, QPalette, QPainter, QPainterPath,
     QCursor)
@@ -83,7 +84,8 @@ JUDGMENT_INDICATOR_THRESHOLD = 1000
 SLIDER_TICKRATE = 50

-class Renderer(QFrame):
+class Renderer(QOpenGLWidget):
     update_time_signal = pyqtSignal(int)
     pause_signal = pyqtSignal()
     loaded_signal = pyqtSignal()
tybug commented 1 year ago

I'm not necessarily opposed to this, but I would be hesitant to move to gpu rendering without lots of testing, since now I need to worry about driver support etc. Right now I think that circlevis does really well with cpu rendering. This might only make a difference once you're rendering 50+ replays, or are on terrible hardware.