提交 f05816df 编写于 作者: W WestLangley

Merge branch 'dev' into dev_pbr_transparency

......@@ -19387,6 +19387,8 @@
shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
shadow.map.texture.name = light.name + ".shadowMap";
shadow.camera.updateProjectionMatrix();
}
_renderer.setRenderTarget( shadow.map );
此差异已折叠。
......@@ -19381,6 +19381,8 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
shadow.map.texture.name = light.name + ".shadowMap";
shadow.camera.updateProjectionMatrix();
}
_renderer.setRenderTarget( shadow.map );
......@@ -75,8 +75,8 @@
<code>
{
'STANDARD': ''
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
</code>
......
......@@ -122,7 +122,7 @@
<h3>[property:Object defines]</h3>
<p>An object of the form:
<code>
{ 'PHYSICAL': '' };
{ 'STANDARD': '' };
</code>
This is used by the [page:WebGLRenderer] for selecting shaders.
......
......@@ -69,8 +69,8 @@
<code>
{
'STANDARD': ''
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
</code>
......
......@@ -97,7 +97,7 @@
<h3>[property:Object defines]</h3>
<p>如下形式的对象:
<code>
{ 'PHYSICAL': '' };
{ 'STANDARD': '' };
</code>
[page:WebGLRenderer]使用它来选择shaders。
</p>
......
......@@ -125,7 +125,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
var vertexShaderChunk2 = [
"#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( PHYSICAL )",
"#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( STANDARD )",
" #ifndef USE_ENVMAP",
" vec3 objectNormal = normalize( normal );",
" #endif",
......
......@@ -726,7 +726,7 @@ THREE.GLTFLoader = ( function () {
materialParams.vertexShader = shader.vertexShader;
materialParams.fragmentShader = fragmentShader;
materialParams.uniforms = uniforms;
materialParams.defines = { 'PHYSICAL': '' }
materialParams.defines = { 'STANDARD': '' }
materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );
materialParams.opacity = 1.0;
......
......@@ -132,7 +132,7 @@ var OutlineEffect = function ( renderer, parameters ) {
var vertexShaderChunk2 = [
"#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( PHYSICAL )",
"#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined( STANDARD )",
" #ifndef USE_ENVMAP",
" vec3 objectNormal = normalize( normal );",
" #endif",
......
......@@ -791,7 +791,7 @@ var GLTFLoader = ( function () {
materialParams.vertexShader = shader.vertexShader;
materialParams.fragmentShader = fragmentShader;
materialParams.uniforms = uniforms;
materialParams.defines = { 'PHYSICAL': '' }
materialParams.defines = { 'STANDARD': '' }
materialParams.color = new Color( 1.0, 1.0, 1.0 );
materialParams.opacity = 1.0;
......
......@@ -33,7 +33,7 @@ StandardNode.prototype.build = function ( builder ) {
var code;
builder.define('PHYSICAL');
builder.define('STANDARD');
var useClearcoat = this.clearcoat || this.clearcoatRoughness || this.clearCoatNormal;
......
......@@ -23,8 +23,8 @@ function MeshPhysicalMaterial( parameters ) {
this.defines = {
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
'STANDARD': '',
'PHYSICAL': ''
};
......@@ -57,8 +57,8 @@ MeshPhysicalMaterial.prototype.copy = function ( source ) {
this.defines = {
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
'STANDARD': '',
'PHYSICAL': ''
};
......
......@@ -59,7 +59,7 @@ function MeshStandardMaterial( parameters ) {
Material.call( this );
this.defines = { 'PHYSICAL': '' };
this.defines = { 'STANDARD': '' };
this.type = 'MeshStandardMaterial';
......@@ -123,7 +123,7 @@ MeshStandardMaterial.prototype.copy = function ( source ) {
Material.prototype.copy.call( this, source );
this.defines = { 'PHYSICAL': '' };
this.defines = { 'STANDARD': '' };
this.color.copy( source.color );
this.roughness = source.roughness;
......
......@@ -396,12 +396,19 @@ export class Vector2 implements Vector {
equals( v: Vector2 ): boolean;
/**
* Sets this vector's x value to be array[offset] and y value to be array[offset + 1].
* Sets this vector's x and y value from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray( array: number[], offset?: number ): this;
/**
* Sets this vector's x and y value from the provided array-like.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray( array: ArrayLike<number>, offset?: number ): this;
/**
* Returns an array [x, y], or copies x and y into the provided array.
* @param array (optional) array to store the vector to. If this is not provided, a new array will be created.
......
......@@ -248,7 +248,19 @@ export class Vector3 implements Vector {
*/
equals( v: Vector3 ): boolean;
fromArray( xyz: number[], offset?: number ): Vector3;
/**
* Sets this vector's x, y and z value from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray( array: number[], offset?: number ): this;
/**
* Sets this vector's x, y and z value from the provided array-lik.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray( array: ArrayLike<number>, offset?: number ): this;
/**
* Returns an array [x, y, z], or copies x, y and z into the provided array.
......@@ -256,7 +268,7 @@ export class Vector3 implements Vector {
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray( xyz?: number[], offset?: number ): number[];
toArray( array?: number[], offset?: number ): number[];
/**
* Copies x, y and z into the provided array-like.
......@@ -264,7 +276,7 @@ export class Vector3 implements Vector {
* @param offset (optional) optional offset into the array.
* @return The provided array-like.
*/
toArray( xyz: ArrayLike<number>, offset?: number ): ArrayLike<number>;
toArray( array: ArrayLike<number>, offset?: number ): ArrayLike<number>;
fromBufferAttribute(
attribute: BufferAttribute,
......
......@@ -174,9 +174,35 @@ export class Vector4 implements Vector {
*/
equals( v: Vector4 ): boolean;
fromArray( xyzw: number[], offset?: number ): this;
/**
* Sets this vector's x, y, z and w value from the provided array.
* @param array the source array.
* @param offset (optional) offset into the array. Default is 0.
*/
fromArray( array: number[], offset?: number ): this;
/**
* Sets this vector's x, y, z and w value from the provided array-like.
* @param array the source array-like.
* @param offset (optional) offset into the array-like. Default is 0.
*/
fromArray( array: ArrayLike<number>, offset?: number ): this;
toArray( xyzw?: number[], offset?: number ): number[];
/**
* Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.
* @param array (optional) array to store the vector to. If this is not provided, a new array will be created.
* @param offset (optional) optional offset into the array.
* @return The created or provided array.
*/
toArray( array?: number[], offset?: number ): number[];
/**
* Copies x, y, z and w into the provided array-like.
* @param array array-like to store the vector to.
* @param offset (optional) optional offset into the array.
* @return The provided array-like.
*/
toArray( array: ArrayLike<number>, offset?: number ): ArrayLike<number>;
fromBufferAttribute(
attribute: BufferAttribute,
......
......@@ -6,7 +6,7 @@ export default /* glsl */`
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_ENVMAP ) && defined( PHYSICAL )
#if defined( USE_ENVMAP ) && defined( STANDARD )
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
......
export default /* glsl */`
#if NUM_CLIPPING_PLANES > 0
#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )
#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )
varying vec3 vViewPosition;
#endif
......
export default /* glsl */`
#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )
#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )
varying vec3 vViewPosition;
#endif
`;
export default /* glsl */`
#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )
#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )
vViewPosition = - mvPosition.xyz;
#endif
`;
......@@ -15,7 +15,7 @@ export default /* glsl */`
#endif
#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
irradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );
......
export default /* glsl */`
#define PHYSICAL_REFLECTION
#define STANDARD
#ifdef PHYSICAL
#define CLEARCOAT
#endif
#ifdef ADVANCED_PHYSICAL
#define REFLECTIVITY
#define CLEARCOAT
#define TRANSPARENCY
......
export default /* glsl */`
#define PHYSICAL
#define STANDARD
varying vec3 vViewPosition;
......
......@@ -140,6 +140,8 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
shadow.map.texture.name = light.name + ".shadowMap";
shadow.camera.updateProjectionMatrix();
}
_renderer.setRenderTarget( shadow.map );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册