Public
Edited
Feb 25, 2023
2 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
skyShader = ({
vert: /*glsl*/ `
${uniformsGlsl.glsl}

out vec3 vPosition;
void main() {
vPosition = position;
gl_Position = vec4(position, 1.0);
}`,
frag: /*glsl*/ `
${definesGlsl.glsl}
${uniformsGlsl.glsl}
${packingGlsl.glsl}
${functionsGlsl.glsl}
${helpersGlsl.glsl}
${cameraGlsl.glsl}
${skyRenderGlsl.glsl}

float checker(vec3 rd) {
vec2 uv = vec2(0.);
uv.x = atan(rd.x, rd.z) / (2. * PI) + 0.5;
uv.y = asin(rd.y) / PI + .5;
float cx = floor(iRepetition * uv.x);
float cy = floor(iRepetition * uv.y);
float result = mod(cx + cy, 2.0);
return sign(result);
}

void main() {
vec3 ro, rd;
getCameraRay(gl_FragCoord.xy, ro, rd);
renderSky(gl_FragColor, ro, rd);

// gl_FragColor = vec4(vec3(checker(rd) * .05), 1.);

#include <tonemapping_fragment>
}
`
})
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
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
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