This is an extensive documentation for Svader, a JavaScript library that allows developers to render GPU-accelerated graphics in web applications. Here's a summary of the key points:
WebGL vs. WebGPU
Svader Features
resolution
, scale
, and time
.Svader Parameters
parameters
property is an array of objects with the following properties:
label
: The name of the parameter to be used for debugging.binding
: An integer matching the variable in the shader code.value
: The value of the parameter or a string specifying a built-in value. If not a built-in value, it should be an ArrayBuffer
/ArrayBufferView
.storage
: Optional, defaults to false
. Whether the parameter is a storage variable rather than a uniform variable.Svader Built-in Values
"resolution"
: A vec2f
of the canvas width and height in physical device pixels."scale"
: An f32
of the ratio between CSS pixels and physical device pixels, i.e., zoom level."time"
: An f32
of the current time in seconds."offset"
: A vec2f
to be added to the @builtin(position)
of the fragment shader.Svader Usage
parameters
property to pass parameters to the renderer.resolution
, scale
, and time
.Overall, Svader provides a powerful toolset for developers to render GPU-accelerated graphics in web applications. By understanding its features, parameters, and built-in values, developers can optimize their application's performance and create engaging user experiences.
Earn money with open source contributions by completing bounties
Defang takes you from Docker Compose to production-ready deployments in your favorite cloud in minutes.
Tabageos: JavaScript Game Library Documentation - Learn how to make games with ease.