mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 03:38:11 +08:00
shaders-rt: explain fullscreen_vertex coordinates with a drawing
This commit is contained in:
@@ -3,6 +3,21 @@ use spirv_std::spirv;
|
|||||||
|
|
||||||
/// webgpu NDC is like OpenGL: (-1.0 .. 1.0, -1.0 .. 1.0, 0.0 .. 1.0)
|
/// webgpu NDC is like OpenGL: (-1.0 .. 1.0, -1.0 .. 1.0, 0.0 .. 1.0)
|
||||||
/// https://www.w3.org/TR/webgpu/#coordinate-systems
|
/// https://www.w3.org/TR/webgpu/#coordinate-systems
|
||||||
|
///
|
||||||
|
/// So to make a fullscreen triangle around a box at (-1..1):
|
||||||
|
///
|
||||||
|
/// ```norun
|
||||||
|
/// 3 +
|
||||||
|
/// |\
|
||||||
|
/// 2 | \
|
||||||
|
/// | \
|
||||||
|
/// 1 +-----+
|
||||||
|
/// | |\
|
||||||
|
/// 0 | 0 | \
|
||||||
|
/// | | \
|
||||||
|
/// -1 +-----+-----+
|
||||||
|
/// -1 0 1 2 3
|
||||||
|
/// ```
|
||||||
const FULLSCREEN_VERTICES: [Vec2; 3] = [Vec2::new(-1., -1.), Vec2::new(-1., 3.), Vec2::new(3., -1.)];
|
const FULLSCREEN_VERTICES: [Vec2; 3] = [Vec2::new(-1., -1.), Vec2::new(-1., 3.), Vec2::new(3., -1.)];
|
||||||
|
|
||||||
#[spirv(vertex)]
|
#[spirv(vertex)]
|
||||||
|
|||||||
Reference in New Issue
Block a user