Gregg Tavares 7 years ago
parent
commit
8eefd5bafb
1 changed files with 3 additions and 2 deletions
  1. 3 2
      threejs/lessons/resources/threejs-primitives.js

+ 3 - 2
threejs/lessons/resources/threejs-primitives.js

@@ -2,6 +2,9 @@
 
 function main() {
 
+  // even on low-res we want hi-res rendering so the lines are small
+  const pixelRatio = 2;
+
   const primitives = {
     BoxBufferGeometry: {
       create() {
@@ -539,8 +542,6 @@ function main() {
     return render;
   }
 
-  const pixelRatio = 2;  // even on low-res we want hi-res rendering
-
   function resizeRendererToDisplaySize(renderer) {
     const canvas = renderer.domElement;
     const width = canvas.clientWidth * pixelRatio;