skyShader = ({
vert: `
${uniformsGlsl.glsl}
out vec3 vPosition;
void main() {
vPosition = position;
gl_Position = vec4(position, 1.0);
}`,
frag: `
${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>
}
`
})