-
Notifications
You must be signed in to change notification settings - Fork 959
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiple render targets example (v2) (#5313)
Co-authored-by: Connor Fitzgerald <[email protected]>
- Loading branch information
1 parent
9ed7169
commit 0fe2034
Showing
8 changed files
with
622 additions
and
0 deletions.
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
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,21 @@ | ||
# multiple_render_targets | ||
|
||
This example demonstrates how to use fragment shader to output to two color attachments of a renderpass simultaneously. | ||
|
||
The program generates a black and white ball-shaped texture from scratch and uses the fragment shader to draw it to two | ||
separate texture targets. The first texture target receives a red version of the texture and the second target receives | ||
a green version. | ||
|
||
Once the colored shapes have been drawn to two separate textures, they | ||
will be displayed on the screen by rendering each one of them to their own viewports that split the screen in half. | ||
|
||
|
||
## To Run | ||
|
||
``` | ||
cargo run --bin wgpu-examples multiple_render_targets | ||
``` | ||
|
||
## Screenshots | ||
|
||
![Multi render target](./screenshot.png) |
Oops, something went wrong.