| Crates.io | truck-platform |
| lib.rs | truck-platform |
| version | 0.6.0 |
| created_at | 2020-12-28 07:36:42.489182+00 |
| updated_at | 2024-09-20 13:59:11.545033+00 |
| description | graphic utility library based on wgpu |
| homepage | https://github.com/ricosjp/truck |
| repository | https://github.com/ricosjp/truck |
| max_upload_size | |
| id | 328152 |
| size | 197,727 |
Graphic utility library based on wgpu.
A sample of creating a render object by implementing "Rendered" in a new structure.
One can use xyr WGSL shader in the following way:
The rule of shaders:
vec4<f32> main_image(coord: vec2<f32>, env: Environment);
coord is the fragment coordinate. The origin is the lower left.env has the environment information. The declaration of struct is the following:struct Environment {
resolution: vec2<f32>; // the resolution of the image
mouse: vec4<f32>; // the mouse information behaving the same as `iMouse` in Shadertoy.
time: f32; // the number of seconds since the application started.
};
Also, see the sample newton-cuberoot.wgsl, default shader, in examples.