提交 bfd9631b 编写于 作者: W WestLangley

Clean up formatting

上级 afcad785
......@@ -13,8 +13,7 @@
* The arrangement of the faces is fixed, as assuming this arrangement, the sampling function has been written.
*/
THREE.PMREMCubeUVPacker = function( cubeTextureLods, numLods ) {
THREE.PMREMCubeUVPacker = function ( cubeTextureLods, numLods ) {
this.cubeLods = cubeTextureLods;
this.numLods = numLods;
......
......@@ -11,7 +11,7 @@
* by this class.
*/
THREE.PMREMGenerator = function( sourceTexture, samplesPerLevel, resolution ) {
THREE.PMREMGenerator = function ( sourceTexture, samplesPerLevel, resolution ) {
this.sourceTexture = sourceTexture;
this.resolution = ( resolution !== undefined ) ? resolution : 256; // NODE: 256 is currently hard coded in the glsl code for performance reasons
......@@ -52,7 +52,7 @@ THREE.PMREMGenerator = function( sourceTexture, samplesPerLevel, resolution ) {
this.camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0.0, 1000 );
this.shader = this.getShader();
this.shader.defines['SAMPLES_PER_LEVEL'] = this.samplesPerLevel;
this.shader.defines[ 'SAMPLES_PER_LEVEL' ] = this.samplesPerLevel;
this.planeMesh = new THREE.Mesh( new THREE.PlaneGeometry( 2, 2, 0 ), this.shader );
this.planeMesh.material.side = THREE.DoubleSide;
this.scene = new THREE.Scene();
......@@ -66,7 +66,7 @@ THREE.PMREMGenerator = function( sourceTexture, samplesPerLevel, resolution ) {
THREE.PMREMGenerator.prototype = {
constructor : THREE.PMREMGenerator,
constructor: THREE.PMREMGenerator,
/*
* Prashant Sharma / spidersharma03: More thought and work is needed here.
......@@ -81,7 +81,7 @@ THREE.PMREMGenerator.prototype = {
* This method requires the most amount of thinking I guess. Here is a paper which we could try to implement in future::
* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html
*/
update: function( renderer ) {
update: function ( renderer ) {
this.shader.uniforms[ 'envMap' ].value = this.sourceTexture;
this.shader.envMap = this.sourceTexture;
......@@ -101,7 +101,7 @@ THREE.PMREMGenerator.prototype = {
var r = i / ( this.numLods - 1 );
this.shader.uniforms[ 'roughness' ].value = r * 0.9; // see comment above, pragmatic choice
this.shader.uniforms[ 'queryScale' ].value.x = ( i == 0 ) ? -1 : 1;
this.shader.uniforms[ 'queryScale' ].value.x = ( i == 0 ) ? - 1 : 1;
var size = this.cubeLods[ i ].width;
this.shader.uniforms[ 'mapSize' ].value = size;
this.renderToCubeMapTarget( renderer, this.cubeLods[ i ] );
......@@ -118,17 +118,17 @@ THREE.PMREMGenerator.prototype = {
},
renderToCubeMapTarget: function( renderer, renderTarget ) {
renderToCubeMapTarget: function ( renderer, renderTarget ) {
for ( var i = 0; i < 6; i ++ ) {
this.renderToCubeMapTargetFace( renderer, renderTarget, i )
this.renderToCubeMapTargetFace( renderer, renderTarget, i );
}
},
renderToCubeMapTargetFace: function( renderer, renderTarget, faceIndex ) {
renderToCubeMapTargetFace: function ( renderer, renderTarget, faceIndex ) {
renderTarget.activeCubeFace = faceIndex;
this.shader.uniforms[ 'faceIndex' ].value = faceIndex;
......@@ -136,7 +136,7 @@ THREE.PMREMGenerator.prototype = {
},
getShader: function() {
getShader: function () {
return new THREE.ShaderMaterial( {
......@@ -258,12 +258,14 @@ THREE.PMREMGenerator.prototype = {
//rgbColor = testColorMap( roughness ).rgb;\n\
gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );\n\
}",
blending: THREE.CustomBlending,
blendSrc: THREE.OneFactor,
blendDst: THREE.ZeroFactor,
blendSrcAlpha: THREE.OneFactor,
blendDstAlpha: THREE.ZeroFactor,
blendEquation: THREE.AddEquation
} );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册