未验证 提交 17affe6f 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #17318 from arobertson0/descriptive-defines-2

Matching js material class names with glsl defines
......@@ -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': ''
};
......@@ -55,8 +55,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;
......
......@@ -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
#endif
......
export default /* glsl */`
#define PHYSICAL
#define STANDARD
varying vec3 vViewPosition;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册