-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
As of 2023-11 the examples have multiple issues that don't make them work very well as examples and demos of how to use the API. This tracking issue works towards improving the examples.
Too Test-ey
Previously, before we had the wicked test suite we have today, we often used examples as a dumping ground for new features, so they can get tested. We should remove the extra features from the various examples and move tests for those features into proper tests.
-
cube
usesPolygonMode::Line
-
hello_compute
shouldn't have tests. These should be tests in the test suite. -
hello_synchronization
shouldn't have tests either. -
mipmap
uses timestamp queries and pipeline statistics queries. -
shadow
usesdepth-clip-control
for actually no reason. -
srgb_blend
usespolygon-mode-line
also for no reason. -
texture-arrays
is basically just a test.
Not Flashy Enough
A lot of our examples are particular flashy. These you could classify as "demos" more than examples, but they're important, particularly on the web to show of "hey look at this project is so cool"
-
water
- Make RODS optional so that it can run on WebGL2. This can introduce an extra copy, which shows the benefit of RODS
- Expand the land shown
- Add a skybox
- Maybe a little ship bobbing up and down.
- Port https://github.com/gfx-rs/gfx-ocean to wgpu
- Other ideas?
WebGL2
-
bunnymark
renders nothing on WebGL2 -
skybox
doesn't work on M1 + Firefox Fixes for Skybox and All Examples #4780 -
water
is our most flashy example, but requires RODS, which WebGL2 doesn't support. - A lot of the non-framework examples don't run on WebGL2, just as they never make a canvas. We should add a helper function which makes a hidden canvas and creates a surface on the Web.
Non-Framework Examples
We have multiple examples that don't use the framework and communicate the results back to the user in special ways, either web-specific or through the console.
The Webpage for the examples should have a standard way of communicating this information, and the examples should have helper functions that make it easy to show on the webpage or in the console.
Other Issues
-
bunnymark
has upside-down logo. -
bunnymark
's screenshot looks terrible and includes special code in the example itself for testing and generating that screenshot. We should move any special casing to the test. -
hello-triangle
should use a standard array instead of a bitmasking situation to store its vertices. -
uniform-values
should use the standard framework, and how to integrate async into that framework. - Examples don't take into account delta-t at all, just tick once per frame.
- We need to delay creating a window until after we receive Resumed in the event loop. We should use the canvas in the webpage to make a surface on the web before we make a
winit
window.