Emmett Lalish %!s(int64=5) %!d(string=hai) anos
pai
achega
750744ecb1
Modificáronse 2 ficheiros con 14 adicións e 4 borrados
  1. 13 3
      src/renderers/WebGLRenderer.d.ts
  2. 1 1
      src/renderers/WebGLRenderer.js

+ 13 - 3
src/renderers/WebGLRenderer.d.ts

@@ -399,13 +399,23 @@ export class WebGLRenderer implements Renderer {
 
 
 	/**
 	/**
 	 * Copies a region of the currently bound framebuffer into the selected mipmap level of the selected texture.
 	 * 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.
-	 * 
+	 * This region is defined by the size of the destination texture's mip level, offset by the input position.
+	 *
 	 * @param position Specifies the pixel offset from which to copy out of the framebuffer.
 	 * @param position Specifies the pixel offset from which to copy out of the framebuffer.
 	 * @param texture Specifies the destination texture.
 	 * @param texture Specifies the destination texture.
 	 * @param level Specifies the destination mipmap level of the texture.
 	 * @param level Specifies the destination mipmap level of the texture.
 	 */
 	 */
-	copyFramebufferToTexture( position: Vector2, texture: Texture, level: number ): void;
+	copyFramebufferToTexture( position: Vector2, texture: Texture, level?: number ): void;
+
+	/**
+	 * Copies srcTexture to the specified level of dstTexture, offset by the input position.
+	 *
+	 * @param position Specifies the pixel offset into the dstTexture where the copy will occur.
+	 * @param srcTexture Specifies the source texture.
+	 * @param dstTexture Specifies the destination texture.
+	 * @param level Specifies the destination mipmap level of the texture.
+	 */
+	copyTextureToTexture( position: Vector2, srcTexture: Texture, dstTexture: Texture, level?: number ): void;
 
 
 	/**
 	/**
 	 * @deprecated
 	 * @deprecated

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -2719,7 +2719,7 @@ function WebGLRenderer( parameters ) {
 
 
 	this.copyFramebufferToTexture = function ( position, texture, level ) {
 	this.copyFramebufferToTexture = function ( position, texture, level ) {
 
 
-		level = level || 0;
+		if ( level === undefined ) level = 0;
 
 
 		var levelScale = Math.pow( 2, - level );
 		var levelScale = Math.pow( 2, - level );
 		var width = Math.floor( texture.image.width * levelScale );
 		var width = Math.floor( texture.image.width * levelScale );