Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
ShaderEffect.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <PhosphorRendering/phosphorrendering_export.h>
7
8#include <QColor>
9#include <QImage>
10#include <QMutex>
11#include <QPointF>
12#include <QQuickItem>
13#include <QSizeF>
14#include <QStringList>
15#include <QUrl>
16#include <QVariantMap>
17#include <QVector4D>
18
19#include <QPointer>
20#include <array>
21#include <atomic>
22#include <memory>
23
24QT_BEGIN_NAMESPACE
25class QSGNode;
26QT_END_NAMESPACE
27
28namespace PhosphorShaders {
30}
31
32namespace PhosphorRendering {
33
34class ShaderNodeRhi;
35
41inline constexpr int kMaxUserTextureSlots = 4;
42
57class PHOSPHORRENDERING_EXPORT ShaderEffect : public QQuickItem
58{
59 Q_OBJECT
60
61 // ── Shadertoy-compatible animation uniforms ──────────────────────
62 Q_PROPERTY(qreal iTime READ iTime WRITE setITime NOTIFY iTimeChanged FINAL)
63 Q_PROPERTY(qreal iTimeDelta READ iTimeDelta WRITE setITimeDelta NOTIFY iTimeDeltaChanged FINAL)
64 Q_PROPERTY(int iFrame READ iFrame WRITE setIFrame NOTIFY iFrameChanged FINAL)
65 Q_PROPERTY(QSizeF iResolution READ iResolution WRITE setIResolution NOTIFY iResolutionChanged FINAL)
66 Q_PROPERTY(QPointF iMouse READ iMouse WRITE setIMouse NOTIFY iMouseChanged FINAL)
67 Q_PROPERTY(bool isReversed READ isReversed WRITE setIsReversed NOTIFY isReversedChanged FINAL)
68
69
85 Q_PROPERTY(bool playing READ isPlaying WRITE setPlaying NOTIFY playingChanged FINAL)
86
87 // ── Shader source ────────────────────────────────────────────────
88 Q_PROPERTY(QUrl shaderSource READ shaderSource WRITE setShaderSource NOTIFY shaderSourceChanged FINAL)
89 Q_PROPERTY(QUrl vertexShaderUrl READ vertexShaderUrl WRITE setVertexShaderUrl NOTIFY vertexShaderUrlChanged FINAL)
90 Q_PROPERTY(QVariantMap shaderParams READ shaderParams WRITE setShaderParams NOTIFY shaderParamsChanged)
91 Q_PROPERTY(QQuickItem* sourceItem READ sourceItem WRITE setSourceItem NOTIFY sourceItemChanged FINAL)
92
93 // ── Multipass ────────────────────────────────────────────────────
94 Q_PROPERTY(
95 QString bufferShaderPath READ bufferShaderPath WRITE setBufferShaderPath NOTIFY bufferShaderPathChanged FINAL)
96 Q_PROPERTY(QStringList bufferShaderPaths READ bufferShaderPaths WRITE setBufferShaderPaths NOTIFY
97 bufferShaderPathsChanged FINAL)
98 Q_PROPERTY(bool bufferFeedback READ bufferFeedback WRITE setBufferFeedback NOTIFY bufferFeedbackChanged FINAL)
99 Q_PROPERTY(qreal bufferScale READ bufferScale WRITE setBufferScale NOTIFY bufferScaleChanged FINAL)
100 Q_PROPERTY(QString bufferWrap READ bufferWrap WRITE setBufferWrap NOTIFY bufferWrapChanged FINAL)
101 Q_PROPERTY(QStringList bufferWraps READ bufferWraps WRITE setBufferWraps NOTIFY bufferWrapsChanged FINAL)
102 Q_PROPERTY(QString bufferFilter READ bufferFilter WRITE setBufferFilter NOTIFY bufferFilterChanged FINAL)
103 Q_PROPERTY(QStringList bufferFilters READ bufferFilters WRITE setBufferFilters NOTIFY bufferFiltersChanged FINAL)
104
105 // ── Custom parameters (32 floats in 8 vec4s) ────────────────────
106 Q_PROPERTY(QVector4D customParams1 READ customParams1 WRITE setCustomParams1 NOTIFY customParamsChanged FINAL)
107 Q_PROPERTY(QVector4D customParams2 READ customParams2 WRITE setCustomParams2 NOTIFY customParamsChanged FINAL)
108 Q_PROPERTY(QVector4D customParams3 READ customParams3 WRITE setCustomParams3 NOTIFY customParamsChanged FINAL)
109 Q_PROPERTY(QVector4D customParams4 READ customParams4 WRITE setCustomParams4 NOTIFY customParamsChanged FINAL)
110 Q_PROPERTY(QVector4D customParams5 READ customParams5 WRITE setCustomParams5 NOTIFY customParamsChanged FINAL)
111 Q_PROPERTY(QVector4D customParams6 READ customParams6 WRITE setCustomParams6 NOTIFY customParamsChanged FINAL)
112 Q_PROPERTY(QVector4D customParams7 READ customParams7 WRITE setCustomParams7 NOTIFY customParamsChanged FINAL)
113 Q_PROPERTY(QVector4D customParams8 READ customParams8 WRITE setCustomParams8 NOTIFY customParamsChanged FINAL)
114
115 // ── Custom colors (16 color slots) ───────────────────────────────
116 Q_PROPERTY(QColor customColor1 READ customColor1 WRITE setCustomColor1 NOTIFY customColorsChanged FINAL)
117 Q_PROPERTY(QColor customColor2 READ customColor2 WRITE setCustomColor2 NOTIFY customColorsChanged FINAL)
118 Q_PROPERTY(QColor customColor3 READ customColor3 WRITE setCustomColor3 NOTIFY customColorsChanged FINAL)
119 Q_PROPERTY(QColor customColor4 READ customColor4 WRITE setCustomColor4 NOTIFY customColorsChanged FINAL)
120 Q_PROPERTY(QColor customColor5 READ customColor5 WRITE setCustomColor5 NOTIFY customColorsChanged FINAL)
121 Q_PROPERTY(QColor customColor6 READ customColor6 WRITE setCustomColor6 NOTIFY customColorsChanged FINAL)
122 Q_PROPERTY(QColor customColor7 READ customColor7 WRITE setCustomColor7 NOTIFY customColorsChanged FINAL)
123 Q_PROPERTY(QColor customColor8 READ customColor8 WRITE setCustomColor8 NOTIFY customColorsChanged FINAL)
124 Q_PROPERTY(QColor customColor9 READ customColor9 WRITE setCustomColor9 NOTIFY customColorsChanged FINAL)
125 Q_PROPERTY(QColor customColor10 READ customColor10 WRITE setCustomColor10 NOTIFY customColorsChanged FINAL)
126 Q_PROPERTY(QColor customColor11 READ customColor11 WRITE setCustomColor11 NOTIFY customColorsChanged FINAL)
127 Q_PROPERTY(QColor customColor12 READ customColor12 WRITE setCustomColor12 NOTIFY customColorsChanged FINAL)
128 Q_PROPERTY(QColor customColor13 READ customColor13 WRITE setCustomColor13 NOTIFY customColorsChanged FINAL)
129 Q_PROPERTY(QColor customColor14 READ customColor14 WRITE setCustomColor14 NOTIFY customColorsChanged FINAL)
130 Q_PROPERTY(QColor customColor15 READ customColor15 WRITE setCustomColor15 NOTIFY customColorsChanged FINAL)
131 Q_PROPERTY(QColor customColor16 READ customColor16 WRITE setCustomColor16 NOTIFY customColorsChanged FINAL)
132
133 // ── Textures ─────────────────────────────────────────────────────
134 Q_PROPERTY(QVariant audioSpectrum READ audioSpectrumVariant WRITE setAudioSpectrumVariant NOTIFY
135 audioSpectrumChanged FINAL)
136 Q_PROPERTY(
137 QImage wallpaperTexture READ wallpaperTexture WRITE setWallpaperTexture NOTIFY wallpaperTextureChanged FINAL)
138 Q_PROPERTY(bool useWallpaper READ useWallpaper WRITE setUseWallpaper NOTIFY useWallpaperChanged FINAL)
139 Q_PROPERTY(bool useDepthBuffer READ useDepthBuffer WRITE setUseDepthBuffer NOTIFY useDepthBufferChanged FINAL)
140
141 // ── Status ───────────────────────────────────────────────────────
142 Q_PROPERTY(Status status READ status NOTIFY statusChanged FINAL)
143 Q_PROPERTY(QString errorLog READ errorLog NOTIFY errorLogChanged FINAL)
144
145public:
149 enum class Status {
150 Null,
151 Loading,
152 Ready,
153 Error,
154 };
155 Q_ENUM(Status)
156
157
163 static constexpr int kMaxSvgDimension = 2048;
164
171 static constexpr qint64 kMaxSvgPixelBytes = 16LL * 1024 * 1024;
172
173 explicit ShaderEffect(QQuickItem* parent = nullptr);
174 ~ShaderEffect() override;
175
176 // ── Uniform extension ────────────────────────────────────────────
177
187 virtual void setUniformExtension(std::shared_ptr<PhosphorShaders::IUniformExtension> extension);
188 std::shared_ptr<PhosphorShaders::IUniformExtension> uniformExtension() const;
189
190 // ── Shadertoy uniforms ───────────────────────────────────────────
191
192 qreal iTime() const
193 {
194 return m_iTime;
195 }
196 void setITime(qreal time);
197
198 qreal iTimeDelta() const
199 {
200 return m_iTimeDelta;
201 }
202 void setITimeDelta(qreal delta);
203
204 int iFrame() const
205 {
206 return m_iFrame;
207 }
208 void setIFrame(int frame);
209
210 bool isPlaying() const
211 {
212 return m_playing;
213 }
214 void setPlaying(bool playing);
215
216 bool isReversed() const
217 {
218 return m_isReversed;
219 }
224 void setIsReversed(bool reverse);
225
226 QSizeF iResolution() const
227 {
228 return m_iResolution;
229 }
230 void setIResolution(const QSizeF& resolution);
231
232 QPointF iMouse() const
233 {
234 return m_iMouse;
235 }
236 void setIMouse(const QPointF& mouse);
237
238 // ── Shader source ────────────────────────────────────────────────
239
240 QUrl shaderSource() const
241 {
242 return m_shaderSource;
243 }
244 void setShaderSource(const QUrl& source);
245
246 QUrl vertexShaderUrl() const
247 {
248 return m_vertexShaderUrl;
249 }
250 void setVertexShaderUrl(const QUrl& source);
251
252 QVariantMap shaderParams() const
253 {
254 return m_shaderParams;
255 }
304 virtual void setShaderParams(const QVariantMap& params);
305
316 static QImage loadUserTextureFile(const QString& path, int svgMaxDim);
317
340 QQuickItem* sourceItem() const
341 {
342 return m_sourceItem.data();
343 }
344 void setSourceItem(QQuickItem* item);
345
346 // ── Multipass ────────────────────────────────────────────────────
347
348 QString bufferShaderPath() const
349 {
350 return m_bufferShaderPath;
351 }
352 void setBufferShaderPath(const QString& path);
353
354 QStringList bufferShaderPaths() const
355 {
356 return m_bufferShaderPaths;
357 }
358 void setBufferShaderPaths(const QStringList& paths);
359
360 bool bufferFeedback() const
361 {
362 return m_bufferFeedback;
363 }
364 void setBufferFeedback(bool enable);
365
366 qreal bufferScale() const
367 {
368 return m_bufferScale;
369 }
370 void setBufferScale(qreal scale);
371
372 QString bufferWrap() const
373 {
374 return m_bufferWrap;
375 }
376 void setBufferWrap(const QString& wrap);
377
378 QStringList bufferWraps() const
379 {
380 return m_bufferWraps;
381 }
382 void setBufferWraps(const QStringList& wraps);
383
384 QString bufferFilter() const
385 {
386 return m_bufferFilter;
387 }
388 void setBufferFilter(const QString& filter);
389
390 QStringList bufferFilters() const
391 {
392 return m_bufferFilters;
393 }
394 void setBufferFilters(const QStringList& filters);
395
396 // ── Custom parameters (32 float slots in 8 vec4s) ────────────────
397
398 QVector4D customParams1() const
399 {
400 return m_customParams[0];
401 }
402 void setCustomParams1(const QVector4D& params);
403 QVector4D customParams2() const
404 {
405 return m_customParams[1];
406 }
407 void setCustomParams2(const QVector4D& params);
408 QVector4D customParams3() const
409 {
410 return m_customParams[2];
411 }
412 void setCustomParams3(const QVector4D& params);
413 QVector4D customParams4() const
414 {
415 return m_customParams[3];
416 }
417 void setCustomParams4(const QVector4D& params);
418 QVector4D customParams5() const
419 {
420 return m_customParams[4];
421 }
422 void setCustomParams5(const QVector4D& params);
423 QVector4D customParams6() const
424 {
425 return m_customParams[5];
426 }
427 void setCustomParams6(const QVector4D& params);
428 QVector4D customParams7() const
429 {
430 return m_customParams[6];
431 }
432 void setCustomParams7(const QVector4D& params);
433 QVector4D customParams8() const
434 {
435 return m_customParams[7];
436 }
437 void setCustomParams8(const QVector4D& params);
438
439 // ── Custom colors (16 color slots) ───────────────────────────────
440
441 QColor customColor1() const
442 {
443 return m_customColors[0];
444 }
445 void setCustomColor1(const QColor& color);
446 QColor customColor2() const
447 {
448 return m_customColors[1];
449 }
450 void setCustomColor2(const QColor& color);
451 QColor customColor3() const
452 {
453 return m_customColors[2];
454 }
455 void setCustomColor3(const QColor& color);
456 QColor customColor4() const
457 {
458 return m_customColors[3];
459 }
460 void setCustomColor4(const QColor& color);
461 QColor customColor5() const
462 {
463 return m_customColors[4];
464 }
465 void setCustomColor5(const QColor& color);
466 QColor customColor6() const
467 {
468 return m_customColors[5];
469 }
470 void setCustomColor6(const QColor& color);
471 QColor customColor7() const
472 {
473 return m_customColors[6];
474 }
475 void setCustomColor7(const QColor& color);
476 QColor customColor8() const
477 {
478 return m_customColors[7];
479 }
480 void setCustomColor8(const QColor& color);
481 QColor customColor9() const
482 {
483 return m_customColors[8];
484 }
485 void setCustomColor9(const QColor& color);
486 QColor customColor10() const
487 {
488 return m_customColors[9];
489 }
490 void setCustomColor10(const QColor& color);
491 QColor customColor11() const
492 {
493 return m_customColors[10];
494 }
495 void setCustomColor11(const QColor& color);
496 QColor customColor12() const
497 {
498 return m_customColors[11];
499 }
500 void setCustomColor12(const QColor& color);
501 QColor customColor13() const
502 {
503 return m_customColors[12];
504 }
505 void setCustomColor13(const QColor& color);
506 QColor customColor14() const
507 {
508 return m_customColors[13];
509 }
510 void setCustomColor14(const QColor& color);
511 QColor customColor15() const
512 {
513 return m_customColors[14];
514 }
515 void setCustomColor15(const QColor& color);
516 QColor customColor16() const
517 {
518 return m_customColors[15];
519 }
520 void setCustomColor16(const QColor& color);
521
522 // ── Indexed accessors (avoid per-slot function-pointer tables at call sites) ──
527 QVector4D customParamAt(int index) const;
535 void setCustomParamAt(int index, const QVector4D& params);
536
541 QColor customColorAt(int index) const;
546 void setCustomColorAt(int index, const QColor& color);
547
548 // ── Textures ─────────────────────────────────────────────────────
549
550 QVariant audioSpectrumVariant() const;
551 void setAudioSpectrumVariant(const QVariant& spectrum);
553 void setAudioSpectrum(const QVector<float>& spectrum);
554
571 void setUserTexture(int slot, const QImage& image);
573 void setUserTextureWrap(int slot, const QString& wrap);
574
575 QImage wallpaperTexture() const;
576 void setWallpaperTexture(const QImage& image);
577
578 bool useWallpaper() const
579 {
580 return m_useWallpaper;
581 }
582 void setUseWallpaper(bool use);
583
584 bool useDepthBuffer() const
585 {
586 return m_useDepthBuffer;
587 }
588 void setUseDepthBuffer(bool use);
589
590 // ── Shader include paths ─────────────────────────────────────────
591
593 void setShaderIncludePaths(const QStringList& paths);
594 QStringList shaderIncludePaths() const
595 {
596 return m_shaderIncludePaths;
597 }
598
599 // ── Status ───────────────────────────────────────────────────────
600
602 {
603 return m_status.load(std::memory_order_acquire);
604 }
605 QString errorLog() const
606 {
607 return m_errorLog;
608 }
609
610 // ── Actions ──────────────────────────────────────────────────────
611
613 Q_INVOKABLE void reloadShader();
614
615Q_SIGNALS:
650
651protected:
652 QSGNode* updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData* data) override;
653 void geometryChange(const QRectF& newGeometry, const QRectF& oldGeometry) override;
654 void componentComplete() override;
655 void itemChange(ItemChange change, const ItemChangeData& value) override;
656
667
677 {
678 return m_shaderDirty.exchange(false);
679 }
680
693
694 void setError(const QString& error);
695 void setStatus(Status newStatus);
696
697private:
698 // ── Auto-tick (playing=true) plumbing ────────────────────────────
702 void updatePlayingConnection();
705 void onPlayingTick();
706
707 // ── Animation state ──────────────────────────────────────────────
708 // Field order minimises padding: 8-byte (qreal/QSizeF/QPointF) members
709 // grouped together, followed by 4-byte (int), trailing 1-byte bool.
710 // qreal-bool-int interleaving wastes 7 bytes via alignment padding.
711 qreal m_iTime = 0.0;
712 qreal m_iTimeDelta = 0.0;
713 qreal m_playingLastFrameSeconds = 0.0;
714 QSizeF m_iResolution;
715 QPointF m_iMouse;
716 int m_iFrame = 0;
717 bool m_isReversed = false;
718 bool m_playing = false;
719 QMetaObject::Connection m_playingConnection;
720
721 // ── Shader source ────────────────────────────────────────────────
722 QUrl m_shaderSource;
723 QUrl m_vertexShaderUrl;
724 QVariantMap m_shaderParams;
725 QStringList m_shaderIncludePaths;
726
727 // QPointer because the source item is owned by the QML scene, not
728 // the ShaderEffect — a torn-down source must auto-null rather than
729 // leave a dangling pointer that the per-frame textureProvider()
730 // lookup would dereference.
731 QPointer<QQuickItem> m_sourceItem;
735 bool m_warnedSelfSourceItem = false;
736
737 // ── Multipass ────────────────────────────────────────────────────
738 QString m_bufferShaderPath;
739 QStringList m_bufferShaderPaths;
740 bool m_bufferFeedback = false;
741 qreal m_bufferScale = 1.0;
742 QString m_bufferWrap = QStringLiteral("clamp");
743 QStringList m_bufferWraps;
744 QString m_bufferFilter = QStringLiteral("linear");
745 QStringList m_bufferFilters;
746
747 // ── Custom parameters (8 vec4s, initialized to -1.0 "unset" sentinel) ──
748 std::array<QVector4D, 8> m_customParams = {{
749 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
750 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
751 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
752 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
753 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
754 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
755 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
756 QVector4D(-1.0f, -1.0f, -1.0f, -1.0f),
757 }};
758
759 // ── Custom colors (16 colors) ────────────────────────────────────
760 std::array<QColor, 16> m_customColors = {{
761 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
762 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
763 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
764 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
765 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
766 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
767 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
768 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
769 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
770 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
771 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
772 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
773 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
774 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
775 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
776 QColor::fromRgbF(0.0f, 0.0f, 0.0f, 0.0f),
777 }};
778
779 // ── Textures ─────────────────────────────────────────────────────
780 QVector<float> m_audioSpectrum;
781 std::array<QImage, kMaxUserTextureSlots> m_userTextureImages;
782 std::array<QString, kMaxUserTextureSlots> m_userTextureWraps;
788 std::array<QString, kMaxUserTextureSlots> m_userTexturePaths;
795 std::array<int, kMaxUserTextureSlots> m_userTextureSvgSizes = {1024, 1024, 1024, 1024};
805 bool m_userTexturesDirectlyOverridden = false;
806 QImage m_wallpaperTexture;
807 mutable QMutex m_wallpaperTextureMutex;
808 bool m_useWallpaper = false;
809 bool m_useDepthBuffer = false;
810
811 // ── Uniform extension ────────────────────────────────────────────
812 std::shared_ptr<PhosphorShaders::IUniformExtension> m_uniformExtension;
813
814 // ── Status ───────────────────────────────────────────────────────
815 // Atomic because setStatus is called from updatePaintNode (render
816 // thread under threaded render loop) while onPlayingTick reads it on
817 // the GUI thread. A torn read would only matter at status
818 // transitions, but the gate at `m_status != Status::Ready` would
819 // skip-or-tick spuriously around the boundary. Acquire/release
820 // semantics suffice — there's no associated data we need to publish
821 // alongside.
822 std::atomic<Status> m_status{Status::Null};
823 QString m_errorLog;
824
825 // ── Render node tracking ─────────────────────────────────────────
826 ShaderNodeRhi* m_renderNode = nullptr;
827 // QPointer defends against reparent/teardown storms where the window is
828 // destroyed out from under us before windowChanged(nullptr) fires.
829 QPointer<QQuickWindow> m_connectedWindow;
830
831 // ── Thread-safe dirty flags for main -> render thread sync ───────
832 std::atomic<bool> m_shaderDirty{false};
833};
834
835} // namespace PhosphorRendering
QQuickItem that renders a fullscreen fragment shader via Qt RHI.
Definition ShaderEffect.h:58
void reloadShader()
Force reload of shader from source (callable from QML).
QColor customColor4() const
Definition ShaderEffect.h:456
void setCustomParams4(const QVector4D &params)
void setCustomParams6(const QVector4D &params)
QVariant audioSpectrumVariant() const
void setUserTexture(int slot, const QImage &image)
Set a user texture (slots 0-3, bindings 7-10) directly from a QImage, bypassing the path-driven loade...
void setUserTextureWrap(int slot, const QString &wrap)
Set user texture wrap mode (slots 0-3).
void setShaderSource(const QUrl &source)
void setIResolution(const QSizeF &resolution)
QColor customColorAt(int index) const
Read a customColor slot by index.
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
QVariantMap shaderParams() const
Definition ShaderEffect.h:252
void setCustomColor3(const QColor &color)
bool useDepthBuffer() const
Definition ShaderEffect.h:584
void setBufferShaderPath(const QString &path)
void setCustomColor7(const QColor &color)
QVector4D customParams7() const
Definition ShaderEffect.h:428
QVector4D customParams4() const
Definition ShaderEffect.h:413
void setBufferFilters(const QStringList &filters)
QPointF iMouse() const
Definition ShaderEffect.h:232
void setCustomColor2(const QColor &color)
void setBufferFeedback(bool enable)
void setCustomColor11(const QColor &color)
QColor customColor15() const
Definition ShaderEffect.h:511
void setCustomColor10(const QColor &color)
void statusChanged()
Emitted when status() transitions.
qreal bufferScale() const
Definition ShaderEffect.h:366
bool isReversed() const
Definition ShaderEffect.h:216
QUrl shaderSource() const
Definition ShaderEffect.h:240
QColor customColor1() const
Definition ShaderEffect.h:441
void setStatus(Status newStatus)
void setAudioSpectrumVariant(const QVariant &spectrum)
void setCustomColor15(const QColor &color)
bool useWallpaper() const
Definition ShaderEffect.h:578
void setCustomColorAt(int index, const QColor &color)
Write a customColor slot by index.
QColor customColor16() const
Definition ShaderEffect.h:516
void setBufferShaderPaths(const QStringList &paths)
void setPlaying(bool playing)
void setBufferWrap(const QString &wrap)
QUrl vertexShaderUrl() const
Definition ShaderEffect.h:246
void setCustomParams2(const QVector4D &params)
void setCustomColor9(const QColor &color)
QColor customColor13() const
Definition ShaderEffect.h:501
QVector4D customParams3() const
Definition ShaderEffect.h:408
void setCustomParams7(const QVector4D &params)
QVector4D customParams1() const
Definition ShaderEffect.h:398
void setCustomColor4(const QColor &color)
QColor customColor14() const
Definition ShaderEffect.h:506
QColor customColor7() const
Definition ShaderEffect.h:471
void setBufferFilter(const QString &filter)
QSGNode * updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override
QVector4D customParamAt(int index) const
Read a customParams slot by index.
void setIMouse(const QPointF &mouse)
void setCustomParamAt(int index, const QVector4D &params)
Write a customParams slot by index.
QVector4D customParams8() const
Definition ShaderEffect.h:433
QStringList bufferFilters() const
Definition ShaderEffect.h:390
void setCustomColor6(const QColor &color)
void setCustomColor13(const QColor &color)
void setCustomParams5(const QVector4D &params)
bool bufferFeedback() const
Definition ShaderEffect.h:360
QString bufferWrap() const
Definition ShaderEffect.h:372
void setCustomParams3(const QVector4D &params)
bool isPlaying() const
Definition ShaderEffect.h:210
void syncBasePropertiesToNode(ShaderNodeRhi *node)
Sync base properties (time, params, colors, audio, multipass, depth, wallpaper) to a render node.
void setBufferWraps(const QStringList &wraps)
QVector4D customParams5() const
Definition ShaderEffect.h:418
QColor customColor3() const
Definition ShaderEffect.h:451
QString bufferFilter() const
Definition ShaderEffect.h:384
Status status() const
Definition ShaderEffect.h:601
QColor customColor2() const
Definition ShaderEffect.h:446
virtual ShaderNodeRhi * createShaderNode()
Factory hook for the render node updatePaintNode() will create.
QStringList bufferWraps() const
Definition ShaderEffect.h:378
void setCustomColor8(const QColor &color)
QColor customColor8() const
Definition ShaderEffect.h:476
QVector4D customParams2() const
Definition ShaderEffect.h:403
QColor customColor11() const
Definition ShaderEffect.h:491
Status
Auto-tick mode.
Definition ShaderEffect.h:149
QStringList bufferShaderPaths() const
Definition ShaderEffect.h:354
void setCustomColor5(const QColor &color)
int iFrame() const
Definition ShaderEffect.h:204
QVector4D customParams6() const
Definition ShaderEffect.h:423
void setShaderIncludePaths(const QStringList &paths)
Set directories to search for #include directives in shaders.
void itemChange(ItemChange change, const ItemChangeData &value) override
void setAudioSpectrum(const QVector< float > &spectrum)
Direct setter from C++ avoiding QVariantList round-trip.
void setCustomColor16(const QColor &color)
QString errorLog() const
Definition ShaderEffect.h:605
void setCustomColor1(const QColor &color)
void setCustomColor14(const QColor &color)
void setWallpaperTexture(const QImage &image)
void setCustomParams8(const QVector4D &params)
QSizeF iResolution() const
Definition ShaderEffect.h:226
void setITimeDelta(qreal delta)
QColor customColor5() const
Definition ShaderEffect.h:461
QColor customColor6() const
Definition ShaderEffect.h:466
void setIsReversed(bool reverse)
Direction signal forwarded to ShaderNodeRhi → BaseUniforms::iIsReversed.
virtual void setShaderParams(const QVariantMap &params)
Push a parameter map onto the shader.
void setSourceItem(QQuickItem *item)
void setCustomColor12(const QColor &color)
static QImage loadUserTextureFile(const QString &path, int svgMaxDim)
Static helper that loads a user-texture file (PNG/JPG/etc.
QColor customColor12() const
Definition ShaderEffect.h:496
void setError(const QString &error)
void setBufferScale(qreal scale)
void setCustomParams1(const QVector4D &params)
QStringList shaderIncludePaths() const
Definition ShaderEffect.h:594
QColor customColor10() const
Definition ShaderEffect.h:486
QString bufferShaderPath() const
Definition ShaderEffect.h:348
void setVertexShaderUrl(const QUrl &source)
qreal iTimeDelta() const
Definition ShaderEffect.h:198
QQuickItem * sourceItem() const
Live texture-provider source bound to SRB binding 7 (uTexture0).
Definition ShaderEffect.h:340
QColor customColor9() const
Definition ShaderEffect.h:481
bool consumeShaderDirty()
Atomically read-and-clear the shader-dirty flag.
Definition ShaderEffect.h:676
QSGRenderNode for fullscreen-quad shader rendering via Qt RHI (Vulkan / OpenGL)
Definition ShaderNodeRhi.h:114
Interface for appending custom uniform data after the base UBO layout.
Definition IUniformExtension.h:18
Definition ShaderCompiler.h:15
constexpr int kMaxUserTextureSlots
Public mirror of ShaderNodeRhi::kMaxUserTextures (4 user-texture slots at SRB bindings 7....
Definition ShaderEffect.h:41
Definition ShaderEffect.h:28