提交 ccd108de 编写于 作者: M Marius Kintel

#7245 coding style

上级 1f6e5915
...@@ -12,12 +12,7 @@ THREE.WebGLRenderTarget = function ( width, height, options ) { ...@@ -12,12 +12,7 @@ THREE.WebGLRenderTarget = function ( width, height, options ) {
options = options || {}; options = options || {};
this.texture = new THREE.Texture(undefined, undefined, this.texture = new THREE.Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter !== undefined ? options.minFilter : THREE.LinearFilter, options.format, options.type, options.anisotropy );
options.wrapS, options.wrapT,
options.magFilter,
options.minFilter !== undefined ? options.minFilter : THREE.LinearFilter,
options.format, options.type,
options.anisotropy);
this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
...@@ -70,27 +65,107 @@ THREE.WebGLRenderTarget.prototype = { ...@@ -70,27 +65,107 @@ THREE.WebGLRenderTarget.prototype = {
this.dispatchEvent( { type: 'dispose' } ); this.dispatchEvent( { type: 'dispose' } );
}, },
get wrapS() { return this.texture.wrapS; }, get wrapS() {
set wrapS(wrapS) { this.texture.wrapS = wrapS; },
get wrapT() { return this.texture.wrapT; }, return this.texture.wrapS;
set wrapT(wrapT) { this.texture.wrapT = wrapT; },
get magFilter() { return this.texture.magFilter; }, },
set magFilter(magFilter) { this.texture.magFilter = magFilter; }, set wrapS( wrapS ) {
get minFilter() { return this.texture.minFilter; },
set minFilter(minFilter) { this.texture.minFilter = minFilter; }, this.texture.wrapS = wrapS;
get anisotropy() { return this.texture.anisotropy; },
set anisotropy(anisotropy) { this.texture.anisotropy = anisotropy; }, },
get offset() { return this.texture.offset; }, get wrapT() {
set offset(offset) { this.texture.offset = offset; },
get repeat() { return this.texture.repeat; }, return this.texture.wrapT;
set repeat(repeat) { this.texture.repeat = repeat; },
get format() { return this.texture.format; }, },
set format(format) { this.texture.format = format; }, set wrapT( wrapT ) {
get type() { return this.texture.type; },
set type(type) { this.texture.type = type; }, this.texture.wrapT = wrapT;
get generateMipmaps() { return this.texture.generateMipmaps; },
set generateMipmaps(generateMipmaps) { this.texture.generateMipmaps = generateMipmaps; } },
get magFilter() {
return this.texture.magFilter;
},
set magFilter( magFilter ) {
this.texture.magFilter = magFilter;
},
get minFilter() {
return this.texture.minFilter;
},
set minFilter( minFilter ) {
this.texture.minFilter = minFilter;
},
get anisotropy() {
return this.texture.anisotropy;
},
set anisotropy( anisotropy ) {
this.texture.anisotropy = anisotropy;
},
get offset() {
return this.texture.offset;
},
set offset( offset ) {
this.texture.offset = offset;
},
get repeat() {
return this.texture.repeat;
},
set repeat( repeat ) {
this.texture.repeat = repeat;
},
get format() {
return this.texture.format;
},
set format( format ) {
this.texture.format = format;
},
get type() {
return this.texture.type;
},
set type( type ) {
this.texture.type = type;
},
get generateMipmaps() {
return this.texture.generateMipmaps;
},
set generateMipmaps( generateMipmaps ) {
this.texture.generateMipmaps = generateMipmaps;
}
}; };
......
...@@ -32,9 +32,9 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -32,9 +32,9 @@ THREE.WebGLRenderer = function ( parameters ) {
var lights = []; var lights = [];
var opaqueObjects = []; var opaqueObjects = [];
var opaqueObjectsLastIndex = -1; var opaqueObjectsLastIndex = - 1;
var transparentObjects = []; var transparentObjects = [];
var transparentObjectsLastIndex = -1; var transparentObjectsLastIndex = - 1;
var morphInfluences = new Float32Array( 8 ); var morphInfluences = new Float32Array( 8 );
...@@ -603,6 +603,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -603,6 +603,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( programInfo !== undefined ) { if ( programInfo !== undefined ) {
programCache.releaseProgram( programInfo ); programCache.releaseProgram( programInfo );
} }
} }
...@@ -1093,8 +1094,8 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -1093,8 +1094,8 @@ THREE.WebGLRenderer = function ( parameters ) {
lights.length = 0; lights.length = 0;
opaqueObjectsLastIndex = -1; opaqueObjectsLastIndex = - 1;
transparentObjectsLastIndex = -1; transparentObjectsLastIndex = - 1;
sprites.length = 0; sprites.length = 0;
lensFlares.length = 0; lensFlares.length = 0;
...@@ -1158,16 +1159,17 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -1158,16 +1159,17 @@ THREE.WebGLRenderer = function ( parameters ) {
lensFlarePlugin.render( scene, camera, _currentWidth, _currentHeight ); lensFlarePlugin.render( scene, camera, _currentWidth, _currentHeight );
// Generate mipmap if we're using any kind of mipmap filtering // Generate mipmap if we're using any kind of mipmap filtering
if ( renderTarget ) { if ( renderTarget ) {
var texture = renderTarget.texture; var texture = renderTarget.texture;
var isTargetPowerOfTwo = THREE.Math.isPowerOfTwo( renderTarget.width ) && THREE.Math.isPowerOfTwo( renderTarget.height ); var isTargetPowerOfTwo = THREE.Math.isPowerOfTwo( renderTarget.width ) && THREE.Math.isPowerOfTwo( renderTarget.height );
if ( texture.generateMipmaps && if ( texture.generateMipmaps && isTargetPowerOfTwo && texture.minFilter !== THREE.NearestFilter && texture.minFilter !== THREE.LinearFilter ) {
isTargetPowerOfTwo &&
texture.minFilter !== THREE.NearestFilter &&
texture.minFilter !== THREE.LinearFilter ) {
updateRenderTargetMipmap( renderTarget ); updateRenderTargetMipmap( renderTarget );
} }
} }
// Ensure depth buffer writing is enabled so it can be cleared on next render // Ensure depth buffer writing is enabled so it can be cleared on next render
...@@ -1335,17 +1337,17 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -1335,17 +1337,17 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( object instanceof THREE.ImmediateRenderObject ) { if ( object instanceof THREE.ImmediateRenderObject ) {
setMaterial( material ); setMaterial( material );
var program = setProgram( camera, lights, fog, material, object ); var program = setProgram( camera, lights, fog, material, object );
_currentGeometryProgram = ''; _currentGeometryProgram = '';
object.render( function ( object ) { object.render( function ( object ) {
_this.renderBufferImmediate( object, program, material ); _this.renderBufferImmediate( object, program, material );
} ); } );
} else { } else {
...@@ -1991,7 +1993,7 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -1991,7 +1993,7 @@ THREE.WebGLRenderer = function ( parameters ) {
uniforms.shadowDarkness.value[ j ] = - light.shadowDarkness; uniforms.shadowDarkness.value[ j ] = - light.shadowDarkness;
} else { } else {
uniforms.shadowDarkness.value[ j ] = light.shadowDarkness; uniforms.shadowDarkness.value[ j ] = light.shadowDarkness;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册