-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support Multipass shaders (buffer A ...) #30
Open
Vipitis
wants to merge
59
commits into
main
Choose a base branch
from
wip-multipass
base: main
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
Changes from 3 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
786f8a2
Initial texture channel refactor
Vipitis c49f43d
small clarification on .snapshot usage
Vipitis 5414d0d
keep base channels working
Vipitis d4c943a
consider renderpasses in main
Vipitis a07c201
add renderpass classe stubs
Vipitis 5242c70
refactor some code to the channel classes
Vipitis e667479
start move to ImagePass for main image code and channels
Vipitis 451f9f4
start draw_buffer function
Vipitis 18c0990
split up _prepare_render
Vipitis 71d97d4
initialize buffers with zero
Vipitis f182699
move prepare_render function to passes
Vipitis 60e8a3a
static buffer pass working?
Vipitis e5b67fe
put passes into it's own file
Vipitis 2bcbac8
naive update textures function
Vipitis e10aa81
fix color and orientation
Vipitis 8529aeb
fix type annotations
Vipitis 8e2b577
only update dynamic channels
Vipitis cfc388f
refactor duplicate code to method
Vipitis 040d9e9
add row padding, resizing still broken
Vipitis 57df916
fix detected channels in common
Vipitis 24b523f
add buffer resizing
Vipitis ecc8775
fix channel order
Vipitis 299e5f7
reuse texture for performance
Vipitis bdd6d18
fix resize
Vipitis 50515a6
fix vflip buffers
Vipitis 26f7841
cleanup
Vipitis 71ca014
use rgba32float for buffers
Vipitis 682398d
add logic for device features
Vipitis 74c4c76
increase CI verbosity
Vipitis 6f81212
dynamic input headers
Vipitis 8b7e10b
cleanup redundant logic
Vipitis 96ac7dd
add buffers test from api
Vipitis 4027a7f
add test for buffers
Vipitis 7bacf78
fix empty buffer case
Vipitis 964e40d
omit test due to caching issue
Vipitis 1aa5ce0
fix lint
Vipitis 6957cc3
update ruff
Vipitis 00c0ee2
initialize inputs_complete
Vipitis 253c5e1
fix lint
Vipitis 46833c7
fix wgsl buffer vertex code
Vipitis 589ce4e
avoid duplicated glsl vertex code
Vipitis 8e2089a
address comments
Vipitis 26295e7
expand buffers test
Vipitis 4db5990
use texture view
Vipitis c4d3140
Add more type hints
Vipitis 4606609
readd buffer resizing
Vipitis fde4501
typo in link
Vipitis b2ee401
update deps
Vipitis 634b7e2
use perferred format
Vipitis 039ece8
fix missing buffer pass
Vipitis 2c36068
fix example
Vipitis a16ee5f
fix gamma
Vipitis 452013f
submit the command buffers once
Vipitis 5b5befd
add simple profiling
Vipitis 1ce5500
make profiling optional
Vipitis 47e561c
fix profiling for fewer passes
Vipitis f67a247
refactor glsl vertex
Vipitis 7544126
refactor wgsl vertex and fragment
Vipitis 91d364e
simplify GLSL uniforms
Vipitis 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,14 @@ build-backend = "setuptools.build_meta" | |
name = "wgpu-shadertoy" | ||
dynamic = ["version", "readme"] | ||
dependencies = [ | ||
"wgpu>=0.16.0,<0.17.0", | ||
"wgpu>=0.16.0,<0.19.0", | ||
"requests", | ||
"numpy", | ||
"Pillow", | ||
] | ||
description = "Shadertoy implementation based on wgpu-py" | ||
license = {file = "LICENSE"} | ||
requires-python = ">=3.8.0" | ||
requires-python = ">=3.9.0" | ||
authors = [ | ||
{name = "Jan Kels", email = "[email protected]"}, | ||
] | ||
|
@@ -29,7 +29,6 @@ Repository = "https://github.com/pygfx/shadertoy" | |
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"numpy", | ||
"pytest", | ||
"ruff", | ||
"imageio", | ||
|
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
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.
Can also set to
None
to have it select the preferred format. Less code, unless you needself._format
. Note that the format is also accessible intexture.format
on the texture obtained viaget_current_texture()
.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.
hm, I had a look and the only other solution I can think of is to make it a property of the
ImageRenderPass
, as it's needed to create the render pipeline. The awful part is that at init time for the Image class, the canvas(_present_context
) might not be accessible via the parent instance ofShadertoy
.It could be returned by this method instead of passed via an attribute. It could be useful to have available when translating the snapshot back into RGB.