提交 545a6e10 编写于 作者: M Mr.doob

Updated builds.

上级 0a555031
......@@ -13980,7 +13980,6 @@ THREE.MeshPhongMaterial = function ( parameters ) {
this.shininess = 30;
this.metal = false;
this.perPixel = true;
this.wrapAround = false;
this.wrapRGB = new THREE.Vector3( 1, 1, 1 );
......@@ -17432,28 +17431,6 @@ THREE.ShaderChunk = {
lights_phong_pars_vertex: [
"#ifndef PHONG_PER_PIXEL",
"#if MAX_POINT_LIGHTS > 0",
"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];",
"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];",
"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];",
"#endif",
"#if MAX_SPOT_LIGHTS > 0",
"uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];",
"uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];",
"varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];",
"#endif",
"#endif",
"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )",
"varying vec3 vWorldPosition;",
......@@ -17465,44 +17442,6 @@ THREE.ShaderChunk = {
lights_phong_vertex: [
"#ifndef PHONG_PER_PIXEL",
"#if MAX_POINT_LIGHTS > 0",
"for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );",
"vec3 lVector = lPosition.xyz - mvPosition.xyz;",
"float lDistance = 1.0;",
"if ( pointLightDistance[ i ] > 0.0 )",
"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );",
"vPointLight[ i ] = vec4( lVector, lDistance );",
"}",
"#endif",
"#if MAX_SPOT_LIGHTS > 0",
"for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {",
"vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );",
"vec3 lVector = lPosition.xyz - mvPosition.xyz;",
"float lDistance = 1.0;",
"if ( spotLightDistance[ i ] > 0.0 )",
"lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );",
"vSpotLight[ i ] = vec4( lVector, lDistance );",
"}",
"#endif",
"#endif",
"#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP )",
"vWorldPosition = worldPosition.xyz;",
......@@ -17534,16 +17473,8 @@ THREE.ShaderChunk = {
"uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];",
"#ifdef PHONG_PER_PIXEL",
"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];",
"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];",
"#else",
"varying vec4 vPointLight[ MAX_POINT_LIGHTS ];",
"#endif",
"uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];",
"uniform float pointLightDistance[ MAX_POINT_LIGHTS ];",
"#endif",
......@@ -17555,15 +17486,7 @@ THREE.ShaderChunk = {
"uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];",
"uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];",
"#ifdef PHONG_PER_PIXEL",
"uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];",
"#else",
"varying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];",
"#endif",
"uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];",
"#endif",
......@@ -17612,23 +17535,14 @@ THREE.ShaderChunk = {
"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
"#ifdef PHONG_PER_PIXEL",
"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );",
"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
"float lDistance = 1.0;",
"if ( pointLightDistance[ i ] > 0.0 )",
"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );",
"lVector = normalize( lVector );",
"#else",
"vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );",
"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
"vec3 lVector = normalize( vPointLight[ i ].xyz );",
"float lDistance = vPointLight[ i ].w;",
"float lDistance = 1.0;",
"if ( pointLightDistance[ i ] > 0.0 )",
"lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );",
"#endif",
"lVector = normalize( lVector );",
// diffuse
......@@ -17673,23 +17587,14 @@ THREE.ShaderChunk = {
"for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {",
"#ifdef PHONG_PER_PIXEL",
"vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );",
"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
"float lDistance = 1.0;",
"if ( spotLightDistance[ i ] > 0.0 )",
"lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );",
"lVector = normalize( lVector );",
"#else",
"vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );",
"vec3 lVector = lPosition.xyz + vViewPosition.xyz;",
"vec3 lVector = normalize( vSpotLight[ i ].xyz );",
"float lDistance = vSpotLight[ i ].w;",
"float lDistance = 1.0;",
"if ( spotLightDistance[ i ] > 0.0 )",
"lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );",
"#endif",
"lVector = normalize( lVector );",
"float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );",
......@@ -24106,7 +24011,6 @@ THREE.WebGLRenderer = function ( parameters ) {
alphaTest: material.alphaTest,
metal: material.metal,
perPixel: material.perPixel,
wrapAround: material.wrapAround,
doubleSided: material.side === THREE.DoubleSide,
flipSided: material.side === THREE.BackSide
......@@ -25473,7 +25377,6 @@ THREE.WebGLRenderer = function ( parameters ) {
parameters.morphTargets ? "#define USE_MORPHTARGETS" : "",
parameters.morphNormals ? "#define USE_MORPHNORMALS" : "",
parameters.perPixel ? "#define PHONG_PER_PIXEL" : "",
parameters.wrapAround ? "#define WRAP_AROUND" : "",
parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
parameters.flipSided ? "#define FLIP_SIDED" : "",
......@@ -25572,7 +25475,6 @@ THREE.WebGLRenderer = function ( parameters ) {
parameters.vertexColors ? "#define USE_COLOR" : "",
parameters.metal ? "#define METAL" : "",
parameters.perPixel ? "#define PHONG_PER_PIXEL" : "",
parameters.wrapAround ? "#define WRAP_AROUND" : "",
parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
parameters.flipSided ? "#define FLIP_SIDED" : "",
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册