This commit is contained in:
2022-03-22 19:58:11 -05:00
parent 3182e27111
commit 5e763f8960

View File

@@ -46,39 +46,6 @@ function runThree({ canvas, text, zoom = 1, scale = 1, width, height }: runThree
//create mesh from text
const material = new THREE.MeshNormalMaterial();
// const material = new THREE.ShaderMaterial({
// uniforms: {
// 'tDiffuse': {
// value: null
// },
// 'resolution': {
// value: null
// },
// 'pixelSize': {
// value: 100
// }
// },
// vertexShader:
// /* glsl */
// `
// varying highp vec2 vUv;
// void main() {
// vUv = uv;
// gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
// }`,
// fragmentShader:
// /* glsl */
// `
// uniform sampler2D tDiffuse;
// uniform float pixelSize;
// uniform vec2 resolution;
// varying highp vec2 vUv;
// void main(){
// vec2 dxy = pixelSize / resolution;
// vec2 coord = dxy * floor( vUv / dxy );
// gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
// }`
// });
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
@@ -97,7 +64,12 @@ function runThree({ canvas, text, zoom = 1, scale = 1, width, height }: runThree
width = height * aspect;
}
console.log(width! * scale, height! * scale)
if (!width || !height) {
//should never run
return;
}
console.log(width * scale, height * scale)
canvas.width = width! * scale;
canvas.height = height! * scale;