code

WebGPU samples
webgpu.github.io/webgpu-samples

3D three.js render
Enhance shader lighting
const isMobile = Math.min(window.screen.width, window.screen.height) < 768 || navigator.userAgent.indexOf("Mobi") > -1;
Detecting mobile browsers

Lenis
Smooth scroll
const hFOV = 2 * Math.atan( Math.tan( camera.fov * Math.PI / 180 / 2 ) * camera.aspect ) * 180 / Math.PI; // degrees
horizontal field-of-view
function fovHorizontalToVertical(fovHorizontal, aspect) {
const fovHorizontalRad = (fovHorizontal * Math.PI) / 180;
const fovVerticalRad = 2 * Math.atan(Math.tan(fovHorizontalRad / 2) / aspect);
const fovVertical = (fovVerticalRad * 180) / Math.PI;
return fovVertical;
}
const fovHorizontal = 50;
const aspect = window.innerWidth / window.innerHeight;
const fovVertical = fovHorizontalToVertical(fovHorizontal, aspect);
camera.fov = fovVertical;
camera.updateProjectionMatrix();