Published
Edited
Nov 8, 2020
2 forks
Insert cell
Insert cell
Insert cell
Insert cell
// =====================================
// write your own fragment shader below
// =====================================
fragShaderSource = `
precision highp float; // 声明float的精度
// JS与shader单向通信的变量
uniform vec2 u_size; // 当前画布的尺寸

void main() {
vec2 rg_size = gl_FragCoord.xy / u_size; // x,y分量限制在[0,1]
gl_FragColor = vec4(
0.0,
rg_size.x,
rg_size.y,
1.0
);
}
`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more