فهرست منبع

Properly propagate texture names and allow them to be set from WebGLRenderTarget

Ben Houston 8 سال پیش
والد
کامیت
4f53d93791
2فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 2 0
      src/renderers/WebGLRenderTarget.js
  2. 3 0
      src/textures/Texture.js

+ 2 - 0
src/renderers/WebGLRenderTarget.js

@@ -37,6 +37,8 @@ function WebGLRenderTarget( width, height, options ) {
 	this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
 	this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
 	this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;
 	this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;
 
 
+	this.texture.name = options.name !== undefined ? options.name : "";
+
 }
 }
 
 
 Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
 Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {

+ 3 - 0
src/textures/Texture.js

@@ -79,6 +79,9 @@ Texture.prototype = {
 
 
 	copy: function ( source ) {
 	copy: function ( source ) {
 
 
+
+		this.name = source.name + " (Copy)";
+
 		this.image = source.image;
 		this.image = source.image;
 		this.mipmaps = source.mipmaps.slice( 0 );
 		this.mipmaps = source.mipmaps.slice( 0 );