Browse Source

added doc

Emmett Lalish 5 years ago
parent
commit
69b48f1128
2 changed files with 9 additions and 1 deletions
  1. 8 0
      src/renderers/WebGLRenderer.d.ts
  2. 1 1
      src/renderers/WebGLRenderer.js

+ 8 - 0
src/renderers/WebGLRenderer.d.ts

@@ -397,6 +397,14 @@ export class WebGLRenderer implements Renderer {
 		activeCubeFaceIndex?: number
 	): void;
 
+	/**
+	 * Copies a region of the currently bound framebuffer into the selected mipmap level of the selected texture.
+	 * This region is defined by the size of the texture's mip level and starts at the input position.
+	 * 
+	 * @param position Specifies the pixel offset from which to copy out of the framebuffer.
+	 * @param texture Specifies the destination texture.
+	 * @param level Specifies the destination mipmap level of the texture.
+	 */
 	copyFramebufferToTexture( position: Vector2, texture: Texture, level: number ): void;
 
 	/**

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -2719,7 +2719,7 @@ function WebGLRenderer( parameters ) {
 
 	this.copyFramebufferToTexture = function ( position, texture, level ) {
 
-		var levelScale = Math.pow( 2, -1.0 * level );
+		var levelScale = Math.pow( 2, - level );
 		var width = texture.image.width * levelScale;
 		var height = texture.image.height * levelScale;
 		var glFormat = utils.convert( texture.format );