Skip to content

How to get compiled shaders from three.js

Patrick Schroen edited this page Apr 4, 2024 · 3 revisions
renderer.compile(mesh, camera);

const program = renderer.properties.get(mesh.material).currentProgram;

console.log(renderer.getContext().getShaderSource(program.vertexShader));
console.log(renderer.getContext().getShaderSource(program.fragmentShader));
Clone this wiki locally