fragmentcolor 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,9 +31,10 @@ async function start() {
31
31
  const renderer = new Renderer();
32
32
  const target = await renderer.createTarget(canvas);
33
33
 
34
- // You can pass the shader as a source string, file path, or URL:
35
- const circle = new Shader("./path/to/circle.wgsl");
36
- const triangle = new Shader("https://fragmentcolor.org/shaders/triangle.wgsl");
34
+ // You can pass the shader as a source string, a registry slug, or an
35
+ // https URL pointing at a .wgsl file.
36
+ const circle = await Shader.fetch("./path/to/circle.wgsl");
37
+ const triangle = await Shader.fetch("https://fragmentcolor.org/shaders/sdf2d/circle.wgsl");
37
38
  const shader = new Shader(`
38
39
  struct VertexOutput {
39
40
  @builtin(position) coords: vec4<f32>,
@@ -79,7 +80,7 @@ async function start() {
79
80
  rpass.addShader(shader);
80
81
  renderer.render(rpass, target);
81
82
 
82
- // Finally, you can render an array of passes in order — no extra type needed.
83
+ // Finally, you can render an array of passes in order. No extra type needed.
83
84
  const passes = [rpass, new Pass("GUI pass")];
84
85
  renderer.render(passes, target);
85
86