Browse Source

Revert "renderer.context to renderer.getContext"

This reverts commit bb5ceed66c1a6826f0d94e39cba28afa7e3b4be1.
Gregg Tavares 5 years ago
parent
commit
debc8ed458

+ 6 - 6
threejs/lessons/threejs-indexed-textures.md

@@ -109,12 +109,12 @@ class GPUPickHelper {
     // set the view offset to represent just a single pixel under the mouse
     const pixelRatio = renderer.getPixelRatio();
     camera.setViewOffset(
-        renderer.getContext().drawingBufferWidth,   // full width
-        renderer.getContext().drawingBufferHeight,  // full top
-        cssPosition.x * pixelRatio | 0,             // rect x
-        cssPosition.y * pixelRatio | 0,             // rect y
-        1,                                          // rect width
-        1,                                          // rect height
+        renderer.context.drawingBufferWidth,   // full width
+        renderer.context.drawingBufferHeight,  // full top
+        cssPosition.x * pixelRatio | 0,        // rect x
+        cssPosition.y * pixelRatio | 0,        // rect y
+        1,                                     // rect width
+        1,                                     // rect height
     );
     // render the scene
     renderer.setRenderTarget(pickingTexture);

+ 6 - 6
threejs/lessons/threejs-picking.md

@@ -360,12 +360,12 @@ Then let's change the `PickHelper` into a `GPUPickHelper`. It will use a `WebGLR
 +    // set the view offset to represent just a single pixel under the mouse
 +    const pixelRatio = renderer.getPixelRatio();
 +    camera.setViewOffset(
-+        renderer.getContext().drawingBufferWidth,   // full width
-+        renderer.getContext().drawingBufferHeight,  // full top
-+        cssPosition.x * pixelRatio | 0,             // rect x
-+        cssPosition.y * pixelRatio | 0,             // rect y
-+        1,                                          // rect width
-+        1,                                          // rect height
++        renderer.context.drawingBufferWidth,   // full width
++        renderer.context.drawingBufferHeight,  // full top
++        cssPosition.x * pixelRatio | 0,        // rect x
++        cssPosition.y * pixelRatio | 0,        // rect y
++        1,                                     // rect width
++        1,                                     // rect height
 +    );
 +    // render the scene
 +    renderer.setRenderTarget(pickingTexture)

+ 6 - 6
threejs/threejs-indexed-textures-picking-and-highlighting.html

@@ -313,12 +313,12 @@ function main() {
       // set the view offset to represent just a single pixel under the mouse
       const pixelRatio = renderer.getPixelRatio();
       camera.setViewOffset(
-          renderer.getContext().drawingBufferWidth,   // full width
-          renderer.getContext().drawingBufferHeight,  // full top
-          cssPosition.x * pixelRatio | 0,             // rect x
-          cssPosition.y * pixelRatio | 0,             // rect y
-          1,                                          // rect width
-          1,                                          // rect height
+          renderer.context.drawingBufferWidth,   // full width
+          renderer.context.drawingBufferHeight,  // full top
+          cssPosition.x * pixelRatio | 0,        // rect x
+          cssPosition.y * pixelRatio | 0,        // rect y
+          1,                                     // rect width
+          1,                                     // rect height
       );
       // render the scene
       renderer.setRenderTarget(pickingTexture);

+ 6 - 6
threejs/threejs-indexed-textures-picking-debounced.html

@@ -313,12 +313,12 @@ function main() {
       // set the view offset to represent just a single pixel under the mouse
       const pixelRatio = renderer.getPixelRatio();
       camera.setViewOffset(
-          renderer.getContext().drawingBufferWidth,   // full width
-          renderer.getContext().drawingBufferHeight,  // full top
-          cssPosition.x * pixelRatio | 0,             // rect x
-          cssPosition.y * pixelRatio | 0,             // rect y
-          1,                                          // rect width
-          1,                                          // rect height
+          renderer.context.drawingBufferWidth,   // full width
+          renderer.context.drawingBufferHeight,  // full top
+          cssPosition.x * pixelRatio | 0,        // rect x
+          cssPosition.y * pixelRatio | 0,        // rect y
+          1,                                     // rect width
+          1,                                     // rect height
       );
       // render the scene
       renderer.setRenderTarget(pickingTexture);

+ 6 - 6
threejs/threejs-indexed-textures-picking.html

@@ -244,12 +244,12 @@ function main() {
       // set the view offset to represent just a single pixel under the mouse
       const pixelRatio = renderer.getPixelRatio();
       camera.setViewOffset(
-          renderer.getContext().drawingBufferWidth,   // full width
-          renderer.getContext().drawingBufferHeight,  // full top
-          cssPosition.x * pixelRatio | 0,             // rect x
-          cssPosition.y * pixelRatio | 0,             // rect y
-          1,                                          // rect width
-          1,                                          // rect height
+          renderer.context.drawingBufferWidth,   // full width
+          renderer.context.drawingBufferHeight,  // full top
+          cssPosition.x * pixelRatio | 0,        // rect x
+          cssPosition.y * pixelRatio | 0,        // rect y
+          1,                                     // rect width
+          1,                                     // rect height
       );
       // render the scene
       renderer.setRenderTarget(pickingTexture);

+ 6 - 6
threejs/threejs-indexed-textures-random-colors.html

@@ -293,12 +293,12 @@ function main() {
       // set the view offset to represent just a single pixel under the mouse
       const pixelRatio = renderer.getPixelRatio();
       camera.setViewOffset(
-          renderer.getContext().drawingBufferWidth,   // full width
-          renderer.getContext().drawingBufferHeight,  // full top
-          cssPosition.x * pixelRatio | 0,             // rect x
-          cssPosition.y * pixelRatio | 0,             // rect y
-          1,                                          // rect width
-          1,                                          // rect height
+          renderer.context.drawingBufferWidth,   // full width
+          renderer.context.drawingBufferHeight,  // full top
+          cssPosition.x * pixelRatio | 0,        // rect x
+          cssPosition.y * pixelRatio | 0,        // rect y
+          1,                                     // rect width
+          1,                                     // rect height
       );
       // render the scene
       renderer.setRenderTarget(pickingTexture);

+ 6 - 6
threejs/threejs-picking-gpu.html

@@ -143,12 +143,12 @@ function main() {
       // set the view offset to represent just a single pixel under the mouse
       const pixelRatio = renderer.getPixelRatio();
       camera.setViewOffset(
-          renderer.getContext().drawingBufferWidth,   // full width
-          renderer.getContext().drawingBufferHeight,  // full top
-          cssPosition.x * pixelRatio | 0,             // rect x
-          cssPosition.y * pixelRatio | 0,             // rect y
-          1,                                          // rect width
-          1,                                          // rect height
+          renderer.context.drawingBufferWidth,   // full width
+          renderer.context.drawingBufferHeight,  // full top
+          cssPosition.x * pixelRatio | 0,        // rect x
+          cssPosition.y * pixelRatio | 0,        // rect y
+          1,                                     // rect width
+          1,                                     // rect height
       );
       // render the scene
       renderer.setRenderTarget(pickingTexture);