-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
rendergraph #13599
Closed
Closed
rendergraph #13599
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
280fcf7
using rendergraph for allshader waveforms, with rendergraph::Geometry…
d3a69bb
waveformrenderbeat with rendergraph, various fixes, use same shaders …
c2fffea
preroll/postroll using rendergraph
4ad583c
node iterator, fixed examples
1dc16a5
fix teardown order
8014163
mark range with dynamic nodes
9a01213
make linked list handling part of rendergraph::Node
9eb2938
towards digits renderer as node
1e4d04b
draw playpos with rendergraph
058f5ec
reuse materialshaders
8032b38
keep track of material that modified the shader uniforms, fix scenegraph
3dcf907
digitsrenderer with rendergraph
507a465
draw marks with rendergraph
a0df59e
removed pimpl from rendergraph opengl
18fa2c4
removed pimpl from rendergraph scenegraph
1967817
cleanup and moved common rendergraph files to common/rendergraph
88013d4
remove nodebase, use encapsulation for scenegraph Node
b8bcb19
reorganized the code, with a public common API that is derived from t…
319ffb0
Update src/rendergraph/common/rendergraph/material/patternmaterial.h
m0dB 390dd0e
Update src/rendergraph/common/rendergraph/material/rgbamaterial.cpp
m0dB afdc0ed
Update res/shaders/rendergraph/unicolor.frag
m0dB dff3a31
Update src/rendergraph/opengl/backend/shadercache.h
m0dB c713d6a
Update src/rendergraph/common/rendergraph/attribute.h
m0dB 6ebc9d5
removed accidental commit
2a4a7d1
removed backend:: namespace, minor changes based on reviews
c5444fc
added comment to explain return value of remove node functions
ec3f816
use a generic Material::compare
86e5f09
added some DEBUG_ASSERTs and some vector.reserve calls
bc32a9c
use string literal
eeae3ea
use qshader to load qsb files for opengl Qt >= 6.6
0a691ad
avoid adding entire src dir to include paths
9c607c1
updated READMEs
2f8e548
improved/added asserts
c6cdb34
moved opengl node as baseclass for waveform renderers to derived clas…
92cd753
fix typo
8e5128f
moved rendergraph::OpenGLNode to derived
07d1f6a
moved vertexupdaters
b24e9ba
ported waveformrendererrgb to rendergraph, hurray!
b817d6c
removed class Attribute and use BaseGeometry::Attribute to reduce del…
0e870dd
comment
941f0cc
put rendergraph_sg and rendergraph_gl in different namespaces
1f10725
remove generated file
ca5f780
also use rendergraph::Engine in scenegraph to initialize and resize n…
bf7ed15
wip
1e57aae
let matrix be handled by qt scenegraph or by the opengl engine, remov…
8011f61
remove treenode
6b2442d
add nodeinterface for unique_ptr ownership methods
1a38137
reduce delta with feat/qml-scrolling-waveform-with-sg-and-rendergraph
cf17f15
reduce delta with feat/qml-scrolling-waveform-with-sg-and-rendergraph
5220b39
reduced delta with feat/qml-scrolling-waveform-with-sg-and-rendergraph
b8f2268
some cleanup
3c76b1b
merge changes from acolombier, clear and set owned by parent flag, mo…
2de8ded
missing file
d12d463
typo
c2d6c44
various cleanup, acting on review
8b25d13
improved attributeset from niko
a57b823
cleanup and comments
c7a3c7a
use std::erase
f409455
reduce delta with qml-rendergraph-fixes
709f8ca
Move back local classes in the private namespace
acolombier 42a53d1
Round texture coordinate to prevent glitch
acolombier 51bf675
Merge pull request #10 from acolombier/rendergraph-reduce-delta
m0dB ebc1108
minor changes to fix compilation
b27ab9a
improve alignment of markers, avoid images that are half empty
368776d
draw rounded to pixel
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
set(shaders | ||
endoftrack.frag | ||
endoftrack.vert | ||
pattern.frag | ||
pattern.vert | ||
rgb.frag | ||
rgb.vert | ||
rgba.frag | ||
rgba.vert | ||
texture.frag | ||
texture.vert | ||
unicolor.frag | ||
unicolor.vert | ||
) | ||
|
||
qt6_add_shaders(rendergraph_sg "shaders-qsb" | ||
BATCHABLE | ||
PRECOMPILE | ||
OPTIMIZED | ||
PREFIX | ||
/shaders/rendergraph | ||
FILES | ||
${shaders} | ||
) | ||
|
||
if(USE_QSHADER_FOR_GL) | ||
message(STATUS "Adding qsb shaders to rendergraph_gl") | ||
qt6_add_shaders(rendergraph_gl "shaders-qsb" | ||
BATCHABLE | ||
PRECOMPILE | ||
OPTIMIZED | ||
PREFIX | ||
/shaders/rendergraph | ||
FILES | ||
${shaders} | ||
) | ||
else() | ||
message(STATUS "Adding gl shaders to rendergraph_gl") | ||
include(generated_shaders_gl.cmake) | ||
|
||
qt_add_resources(rendergraph_gl "shaders-gl" | ||
PREFIX | ||
/shaders/rendergraph | ||
FILES | ||
${generated_shaders_gl} | ||
) | ||
endif() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
The CMakeLists.txt in this folder generates qsb shader bundles from the spirv shaders. | ||
|
||
The qsb files can be used by QML / Qt scene graph QSGShader. Since Qt >= 6.6 we can load the qsb files and extract the glsl shaders | ||
programmatically with QShader and use the with QOpenGLShader. For Qt < 6.6 the files have to generated manually with the script: | ||
|
||
generate_shaders_gl.pl | ||
|
||
(Make sure qsb and spirv commands are in your path. E.g: | ||
export PATH=$PATH:~/VulkanSDK/1.3.283.0/macOS/bin:~/Qt/6.7.2/macos/bin | ||
) | ||
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#version 440 | ||
|
||
layout(location = 0) in float vGradient; | ||
layout(location = 0) out vec4 fragColor; | ||
|
||
layout(std140, binding = 0) uniform buf { | ||
vec4 color; | ||
} | ||
ubuf; | ||
|
||
void main() { | ||
float minAlpha = 0.5 * ubuf.color.w; | ||
float maxAlpha = 0.83 * ubuf.color.w; | ||
float alpha = mix(minAlpha, maxAlpha, max(0.0, vGradient)); | ||
// premultiple alpha | ||
fragColor = vec4(ubuf.color.xyz * alpha, alpha); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#version 120 | ||
//// GENERATED - EDITS WILL BE OVERWRITTEN | ||
|
||
struct buf | ||
{ | ||
vec4 color; | ||
}; | ||
|
||
uniform buf ubuf; | ||
|
||
varying float vGradient; | ||
|
||
void main() | ||
{ | ||
float minAlpha = 0.5 * ubuf.color.w; | ||
float maxAlpha = 0.829999983310699462890625 * ubuf.color.w; | ||
float alpha = mix(minAlpha, maxAlpha, max(0.0, vGradient)); | ||
gl_FragData[0] = vec4(ubuf.color.xyz * alpha, alpha); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#version 440 | ||
|
||
layout(location = 0) in vec4 position; | ||
layout(location = 1) in float gradient; | ||
layout(location = 0) out float vGradient; | ||
|
||
void main() { | ||
vGradient = gradient; | ||
gl_Position = position; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#version 120 | ||
//// GENERATED - EDITS WILL BE OVERWRITTEN | ||
|
||
varying float vGradient; | ||
attribute float gradient; | ||
attribute vec4 position; | ||
|
||
void main() | ||
{ | ||
vGradient = gradient; | ||
gl_Position = position; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/perl | ||
|
||
my @files = (glob("*.vert"),glob("*.frag")); | ||
|
||
open(GENERATED,">generated_shaders_gl.cmake"); | ||
print(GENERATED "set(generated_shaders_gl\n"); | ||
for $file (@files) | ||
{ | ||
system("qsb","--glsl","120",$file,"-o","/tmp/$$-$file.qsb"); | ||
open(INFILE,"qsb --dump /tmp/$$-$file.qsb|"); | ||
open(OUTFILE,">$file.gl"); | ||
$ok = 0; | ||
$comment_added = 0; | ||
print "Generating $file.gl from $file\n"; | ||
while (<INFILE>) | ||
{ | ||
if ($in_shader_block == 2) | ||
{ | ||
if (m/^\*\*/) | ||
{ | ||
$in_shader_block = 0; | ||
$ok = 1; | ||
} | ||
else | ||
{ | ||
if (!$comment_added) | ||
{ | ||
if (!m/^#/) | ||
{ | ||
print(OUTFILE "//// GENERATED - EDITS WILL BE OVERWRITTEN\n"); | ||
$comment_added = 1; | ||
} | ||
} | ||
print OUTFILE "$_"; | ||
} | ||
} | ||
elsif ($in_shader_block == 1) | ||
{ | ||
chomp($_); | ||
if ($_ eq "Contents:") | ||
{ | ||
$in_shader_block = 2; | ||
} | ||
} | ||
else | ||
{ | ||
chomp($_); | ||
if ($_ eq "Shader 1: GLSL 120 [Standard]") | ||
{ | ||
$in_shader_block = 1; | ||
} | ||
} | ||
} | ||
close INFILE; | ||
close OUTFILE; | ||
if($ok) | ||
{ | ||
print(GENERATED " $file.gl\n"); | ||
} | ||
else | ||
{ | ||
print STDERR "Failed to generated $file.gl"; | ||
unlink("$file.gl") | ||
} | ||
unlink("/tmp/$$-$file.qsb"); | ||
} | ||
print(GENERATED ")\n"); | ||
close GENERATED; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
set(generated_shaders_gl | ||
endoftrack.vert.gl | ||
pattern.vert.gl | ||
rgb.vert.gl | ||
rgba.vert.gl | ||
texture.vert.gl | ||
unicolor.vert.gl | ||
endoftrack.frag.gl | ||
pattern.frag.gl | ||
rgb.frag.gl | ||
rgba.frag.gl | ||
texture.frag.gl | ||
unicolor.frag.gl | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#version 440 | ||
|
||
layout(binding = 1) uniform sampler2D texture1; | ||
layout(location = 0) in vec2 vTexcoord; | ||
layout(location = 0) out vec4 fragColor; | ||
|
||
void main() { | ||
fragColor = texture(texture1, fract(vTexcoord)); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#version 120 | ||
//// GENERATED - EDITS WILL BE OVERWRITTEN | ||
|
||
uniform sampler2D texture1; | ||
|
||
varying vec2 vTexcoord; | ||
|
||
void main() | ||
{ | ||
gl_FragData[0] = texture2D(texture1, fract(vTexcoord)); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#version 440 | ||
|
||
layout(std140, binding = 0) uniform buf { | ||
mat4 matrix; | ||
} | ||
ubuf; | ||
|
||
layout(location = 0) in vec4 position; | ||
layout(location = 1) in vec2 texcoord; | ||
layout(location = 0) out vec2 vTexcoord; | ||
|
||
void main() { | ||
vTexcoord = texcoord; | ||
gl_Position = ubuf.matrix * position; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#version 120 | ||
//// GENERATED - EDITS WILL BE OVERWRITTEN | ||
|
||
struct buf | ||
{ | ||
mat4 matrix; | ||
}; | ||
|
||
uniform buf ubuf; | ||
|
||
varying vec2 vTexcoord; | ||
attribute vec2 texcoord; | ||
attribute vec4 position; | ||
|
||
void main() | ||
{ | ||
vTexcoord = texcoord; | ||
gl_Position = ubuf.matrix * position; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#version 440 | ||
|
||
layout(location = 0) in vec3 vColor; | ||
layout(location = 0) out vec4 fragColor; | ||
|
||
void main() { | ||
fragColor = vec4(vColor, 1.0); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#version 120 | ||
//// GENERATED - EDITS WILL BE OVERWRITTEN | ||
|
||
varying vec3 vColor; | ||
|
||
void main() | ||
{ | ||
gl_FragData[0] = vec4(vColor, 1.0); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#version 440 | ||
|
||
layout(std140, binding = 0) uniform buf { | ||
mat4 matrix; | ||
} | ||
ubuf; | ||
|
||
layout(location = 0) in vec4 position; | ||
layout(location = 1) in vec3 color; | ||
layout(location = 0) out vec3 vColor; | ||
|
||
void main() { | ||
vColor = color; | ||
gl_Position = ubuf.matrix * position; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#version 120 | ||
//// GENERATED - EDITS WILL BE OVERWRITTEN | ||
|
||
struct buf | ||
{ | ||
mat4 matrix; | ||
}; | ||
|
||
uniform buf ubuf; | ||
|
||
varying vec3 vColor; | ||
attribute vec3 color; | ||
attribute vec4 position; | ||
|
||
void main() | ||
{ | ||
vColor = color; | ||
gl_Position = ubuf.matrix * position; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#version 440 | ||
|
||
layout(location = 0) in vec4 vColor; | ||
layout(location = 0) out vec4 fragColor; | ||
|
||
void main() { | ||
fragColor = vec4(vColor.xyz * vColor.w, vColor.w); // premultiple alpha | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#version 120 | ||
//// GENERATED - EDITS WILL BE OVERWRITTEN | ||
|
||
varying vec4 vColor; | ||
|
||
void main() | ||
{ | ||
gl_FragData[0] = vec4(vColor.xyz * vColor.w, vColor.w); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#version 440 | ||
|
||
layout(std140, binding = 0) uniform buf { | ||
mat4 matrix; | ||
} | ||
ubuf; | ||
|
||
layout(location = 0) in vec4 position; | ||
layout(location = 1) in vec4 color; | ||
layout(location = 0) out vec4 vColor; | ||
|
||
void main() { | ||
vColor = color; | ||
gl_Position = ubuf.matrix * position; | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove sourunding ( )? Can we give additional hints how to obtain these files? Homebrew?