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

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

Separated the meanings of PHYSICAL
......@@ -73,7 +73,12 @@
<h3>[property:Object defines]</h3>
<p>An object of the form:
<code>
{ 'PHYSICAL': '' };
{
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
</code>
This is used by the [page:WebGLRenderer] for selecting shaders.
......
......@@ -122,7 +122,7 @@
<h3>[property:Object defines]</h3>
<p>An object of the form:
<code>
{ 'STANDARD': '' };
{ 'PHYSICAL': '' };
</code>
This is used by the [page:WebGLRenderer] for selecting shaders.
......
......@@ -67,7 +67,12 @@
<h3>[property:Object defines]</h3>
<p> 如下形式的对象:
<code>
{ 'PHYSICAL': '' };
{
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
</code>
[page:WebGLRenderer]使用它来选择shaders。
</p>
......
......@@ -97,7 +97,7 @@
<h3>[property:Object defines]</h3>
<p>如下形式的对象:
<code>
{ 'STANDARD': '' };
{ 'PHYSICAL': '' };
</code>
[page:WebGLRenderer]使用它来选择shaders。
</p>
......
......@@ -726,7 +726,7 @@ THREE.GLTFLoader = ( function () {
materialParams.vertexShader = shader.vertexShader;
materialParams.fragmentShader = fragmentShader;
materialParams.uniforms = uniforms;
materialParams.defines = { 'STANDARD': '' };
materialParams.defines = { 'PHYSICAL': '' }
materialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );
materialParams.opacity = 1.0;
......
......@@ -791,7 +791,7 @@ var GLTFLoader = ( function () {
materialParams.vertexShader = shader.vertexShader;
materialParams.fragmentShader = fragmentShader;
materialParams.uniforms = uniforms;
materialParams.defines = { 'STANDARD': '' };
materialParams.defines = { 'PHYSICAL': '' }
materialParams.color = new Color( 1.0, 1.0, 1.0 );
materialParams.opacity = 1.0;
......
......@@ -33,7 +33,15 @@ StandardNode.prototype.build = function ( builder ) {
var code;
builder.define( this.clearcoat || this.clearcoatRoughness || this.clearcoatNormal ? 'PHYSICAL' : 'STANDARD' );
builder.define('PHYSICAL');
var useClearcoat = this.clearcoat || this.clearcoatRoughness || this.clearCoatNormal;
if( useClearcoat ){
builder.define( 'CLEARCOAT' );
}
builder.requires.lights = true;
......@@ -137,8 +145,6 @@ StandardNode.prototype.build = function ( builder ) {
gamma: true
};
var useClearcoat = ! builder.isDefined( 'STANDARD' );
// analyze all nodes to reuse generate codes
if ( this.mask ) this.mask.analyze( builder );
......
......@@ -38,17 +38,10 @@
#endif
`;
var envmapParsReplace = `
#define BOX_PROJECTED_ENV_MAP
#if defined( USE_ENVMAP ) || defined( PHYSICAL )
uniform float reflectivity;
uniform float envMapIntensity;
#endif
var envmapPhysicalParsReplace = `
#if defined( USE_ENVMAP )
#ifdef USE_ENVMAP
#define BOX_PROJECTED_ENV_MAP
#ifdef BOX_PROJECTED_ENV_MAP
......@@ -75,41 +68,10 @@
#endif
#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )
varying vec3 vWorldPosition;
#endif
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform int maxMipLevel;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )
#ifdef ENVMAP_MODE_REFRACTION
uniform float refractionRatio;
#else
varying vec3 vReflect;
#endif
#endif
`;
var envmapPhysicalParsReplace = `
#if defined( USE_ENVMAP ) && defined( PHYSICAL )
vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {
vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );
#ifdef ENVMAP_TYPE_CUBE
......@@ -349,11 +311,6 @@
worldposReplace
);
shader.fragmentShader = shader.fragmentShader.replace(
'#include <envmap_pars_fragment>',
envmapParsReplace
);
shader.fragmentShader = shader.fragmentShader.replace(
'#include <envmap_physical_pars_fragment>',
envmapPhysicalParsReplace
......
......@@ -21,7 +21,12 @@ function MeshPhysicalMaterial( parameters ) {
MeshStandardMaterial.call( this );
this.defines = { 'PHYSICAL': '' };
this.defines = {
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
this.type = 'MeshPhysicalMaterial';
......@@ -48,7 +53,12 @@ MeshPhysicalMaterial.prototype.copy = function ( source ) {
MeshStandardMaterial.prototype.copy.call( this, source );
this.defines = { 'PHYSICAL': '' };
this.defines = {
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
this.reflectivity = source.reflectivity;
......
......@@ -59,7 +59,7 @@ function MeshStandardMaterial( parameters ) {
Material.call( this );
this.defines = { 'STANDARD': '' };
this.defines = { 'PHYSICAL': '' };
this.type = 'MeshStandardMaterial';
......@@ -123,7 +123,7 @@ MeshStandardMaterial.prototype.copy = function ( source ) {
Material.prototype.copy.call( this, source );
this.defines = { 'STANDARD': '' };
this.defines = { 'PHYSICAL': '' };
this.color.copy( source.color );
this.roughness = source.roughness;
......
......@@ -35,6 +35,7 @@ export let ShaderChunk: {
encodings_pars_fragment: string;
encodings_fragment: string;
envmap_fragment: string;
envmap_common_pars_fragment: string
envmap_pars_fragment: string;
envmap_pars_vertex: string;
envmap_vertex: string;
......@@ -48,6 +49,7 @@ export let ShaderChunk: {
lightmap_pars_fragment: string;
lights_lambert_vertex: string;
lights_pars_begin: string;
envmap_physical_pars_fragment: string;
lights_pars_map: string;
lights_phong_fragment: string;
lights_phong_pars_fragment: string;
......
......@@ -25,6 +25,7 @@ import emissivemap_pars_fragment from './ShaderChunk/emissivemap_pars_fragment.g
import encodings_fragment from './ShaderChunk/encodings_fragment.glsl.js';
import encodings_pars_fragment from './ShaderChunk/encodings_pars_fragment.glsl.js';
import envmap_fragment from './ShaderChunk/envmap_fragment.glsl.js';
import envmap_common_pars_fragment from './ShaderChunk/envmap_common_pars_fragment.glsl.js';
import envmap_pars_fragment from './ShaderChunk/envmap_pars_fragment.glsl.js';
import envmap_pars_vertex from './ShaderChunk/envmap_pars_vertex.glsl.js';
import envmap_vertex from './ShaderChunk/envmap_vertex.glsl.js';
......@@ -150,6 +151,7 @@ export var ShaderChunk = {
encodings_fragment: encodings_fragment,
encodings_pars_fragment: encodings_pars_fragment,
envmap_fragment: envmap_fragment,
envmap_common_pars_fragment: envmap_common_pars_fragment,
envmap_pars_fragment: envmap_pars_fragment,
envmap_pars_vertex: envmap_pars_vertex,
envmap_physical_pars_fragment: envmap_physical_pars_fragment,
......
export default /* glsl */`
#ifdef PHYSICAL
#ifdef CLEARCOAT
vec3 clearcoatNormal = geometryNormal;
......
......@@ -39,7 +39,7 @@ struct GeometricContext {
vec3 position;
vec3 normal;
vec3 viewDir;
#ifdef PHYSICAL
#ifdef CLEARCOAT
vec3 clearcoatNormal;
#endif
};
......
export default /* glsl */`
#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
uniform int maxMipLevel;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif
`;
export default /* glsl */`
#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( PHONG )
#ifdef ENV_WORLDPOS
vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );
......
export default /* glsl */`
#if defined( USE_ENVMAP ) || defined( PHYSICAL )
#ifdef USE_ENVMAP
uniform float reflectivity;
uniform float envMapIntensity;
#endif
#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )
#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( PHONG ) )
varying vec3 vWorldPosition;
#endif
#define ENV_WORLDPOS
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform int maxMipLevel;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
uniform float refractionRatio;
#else
varying vec3 vReflect;
......
export default /* glsl */`
#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( PHONG )
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
#else
......
export default /* glsl */`
#if defined( USE_ENVMAP ) && defined( PHYSICAL )
#if defined( USE_ENVMAP )
#ifdef ENVMAP_MODE_REFRACTION
uniform float refractionRatio;
#endif
vec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {
......
export default /* glsl */`
#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( PHONG )
#ifdef ENV_WORLDPOS
vWorldPosition = worldPosition.xyz;
......
......@@ -20,7 +20,7 @@ geometry.position = - vViewPosition;
geometry.normal = normal;
geometry.viewDir = normalize( vViewPosition );
#ifdef PHYSICAL
#ifdef CLEARCOAT
geometry.clearcoatNormal = clearcoatNormal;
......
......@@ -27,7 +27,7 @@ export default /* glsl */`
radiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, Material_BlinnShininessExponent( material ), maxMipLevel );
#ifdef PHYSICAL
#ifdef CLEARCOAT
clearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, Material_Clearcoat_BlinnShininessExponent( material ), maxMipLevel );
......
......@@ -2,14 +2,26 @@ export default /* glsl */`
PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );
#ifdef STANDARD
material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );
#else
#ifdef REFLECTIVITY
material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );
#else
material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );
#endif
#ifdef CLEARCOAT
material.clearcoat = saturate( clearcoat ); // Burley clearcoat model
material.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );
#endif
#ifdef USE_SHEEN
material.sheenColor = sheen;
#endif
`;
......@@ -5,14 +5,13 @@ struct PhysicalMaterial {
float specularRoughness;
vec3 specularColor;
#ifdef PHYSICAL
float clearcoat;
float clearcoatRoughness;
#endif
#ifdef USE_SHEEN
vec3 sheenColor;
#endif
#ifdef CLEARCOAT
float clearcoat;
float clearcoatRoughness;
#endif
#ifdef USE_SHEEN
vec3 sheenColor;
#endif
};
......@@ -80,7 +79,7 @@ void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricC
#endif
#ifdef PHYSICAL
#ifdef CLEARCOAT
float ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
......@@ -123,7 +122,7 @@ void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricCo
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
#ifdef PHYSICAL
#ifdef CLEARCOAT
float ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
......
export default /* glsl */`
#ifdef USE_NORMALMAP
#ifdef OBJECTSPACE_NORMALMAP
#ifdef OBJECTSPACE_NORMALMAP
normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals
normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals
#ifdef FLIP_SIDED
#ifdef FLIP_SIDED
normal = - normal;
normal = - normal;
#endif
#ifdef DOUBLE_SIDED
#endif
normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );
#ifdef DOUBLE_SIDED
#endif
normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );
normal = normalize( normalMatrix * normal );
#endif
#else // tangent-space normal map
normal = normalize( normalMatrix * normal );
#ifdef USE_TANGENT
#elif defined( TANGENTSPACE_NORMALMAP )
mat3 vTBN = mat3( tangent, bitangent, normal );
vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
mapN.xy = normalScale * mapN.xy;
normal = normalize( vTBN * mapN );
#ifdef USE_TANGENT
#else
mat3 vTBN = mat3( tangent, bitangent, normal );
vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
mapN.xy = normalScale * mapN.xy;
normal = normalize( vTBN * mapN );
normal = perturbNormal2Arb( -vViewPosition, normal, normalScale, normalMap );
#else
#endif
normal = perturbNormal2Arb( -vViewPosition, normal, normalScale, normalMap );
#endif
......
......@@ -4,14 +4,15 @@ export default /* glsl */`
uniform sampler2D normalMap;
uniform vec2 normalScale;
#ifdef OBJECTSPACE_NORMALMAP
#endif
#ifdef OBJECTSPACE_NORMALMAP
uniform mat3 normalMatrix;
uniform mat3 normalMatrix;
#endif
#endif
#if ( defined ( USE_NORMALMAP ) && !defined ( OBJECTSPACE_NORMALMAP )) || defined ( USE_CLEARCOAT_NORMALMAP )
#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
// Per-Pixel Tangent Space Normal Mapping
// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html
......
......@@ -16,6 +16,7 @@ uniform float opacity;
#include <alphamap_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
......
......@@ -23,6 +23,7 @@ varying vec3 vIndirectFront;
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
......
......@@ -18,6 +18,7 @@ uniform float opacity;
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
......
export default /* glsl */`
#define PHYSICAL
#define PHYSICAL_REFLECTION
#ifdef PHYSICAL
#define CLEARCOAT
#endif
#ifdef ADVANCED_PHYSICAL
#define REFLECTIVITY
#define CLEARCOAT
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
......@@ -7,11 +18,13 @@ uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef PHYSICAL
#ifdef REFLECTIVITY
uniform float reflectivity;
#endif
#ifdef CLEARCOAT
uniform float clearcoat;
uniform float clearcoatRoughness;
#endif
#ifdef USE_SHEEN
uniform vec3 sheen;
#endif
......@@ -44,7 +57,7 @@ varying vec3 vViewPosition;
#include <emissivemap_pars_fragment>
#include <bsdfs>
#include <cube_uv_reflection_fragment>
#include <envmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
......
......@@ -3,7 +3,7 @@ export default /* glsl */`
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) ) || defined( USE_CLEARCOAT_NORMALMAP )
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
varying vec3 vViewPosition;
......
export default /* glsl */`
#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) ) || defined( USE_CLEARCOAT_NORMALMAP )
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
varying vec3 vViewPosition;
......@@ -58,7 +58,7 @@ void main() {
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) ) || defined( USE_CLEARCOAT_NORMALMAP )
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
vViewPosition = - mvPosition.xyz;
......
......@@ -120,7 +120,7 @@ function generateExtensions( extensions, parameters, rendererExtensions ) {
extensions = extensions || {};
var chunks = [
( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || ( parameters.normalMap && ! parameters.objectSpaceNormalMap ) || parameters.clearcoatNormalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '',
( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '',
( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ? '#extension GL_EXT_frag_depth : enable' : '',
( extensions.drawBuffers ) && rendererExtensions.get( 'WEBGL_draw_buffers' ) ? '#extension GL_EXT_draw_buffers : require' : '',
( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ? '#extension GL_EXT_shader_texture_lod : enable' : ''
......@@ -391,6 +391,8 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters,
parameters.bumpMap ? '#define USE_BUMPMAP' : '',
parameters.normalMap ? '#define USE_NORMALMAP' : '',
( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '',
( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '',
parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',
parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',
parameters.specularMap ? '#define USE_SPECULARMAP' : '',
......@@ -509,6 +511,7 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters,
parameters.bumpMap ? '#define USE_BUMPMAP' : '',
parameters.normalMap ? '#define USE_NORMALMAP' : '',
( parameters.normalMap && parameters.objectSpaceNormalMap ) ? '#define OBJECTSPACE_NORMALMAP' : '',
( parameters.normalMap && parameters.tangentSpaceNormalMap ) ? '#define TANGENTSPACE_NORMALMAP' : '',
parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',
parameters.specularMap ? '#define USE_SPECULARMAP' : '',
parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
......
......@@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
import { BackSide, DoubleSide, CubeUVRefractionMapping, CubeUVReflectionMapping, GammaEncoding, LinearEncoding, ObjectSpaceNormalMap } from '../../constants.js';
import { BackSide, DoubleSide, CubeUVRefractionMapping, CubeUVReflectionMapping, GammaEncoding, LinearEncoding, ObjectSpaceNormalMap, TangentSpaceNormalMap } from '../../constants.js';
import { WebGLProgram } from './WebGLProgram.js';
function WebGLPrograms( renderer, extensions, capabilities ) {
......@@ -29,7 +29,7 @@ function WebGLPrograms( renderer, extensions, capabilities ) {
var parameterNames = [
"precision", "supportsVertexTextures", "map", "mapEncoding", "matcap", "matcapEncoding", "envMap", "envMapMode", "envMapEncoding",
"lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "clearcoatNormalMap", "displacementMap", "specularMap",
"lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "objectSpaceNormalMap", "tangentSpaceNormalMap", "clearcoatNormalMap", "displacementMap", "specularMap",
"roughnessMap", "metalnessMap", "gradientMap",
"alphaMap", "combine", "vertexColors", "vertexTangents", "fog", "useFog", "fogExp2",
"flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning",
......@@ -154,6 +154,7 @@ function WebGLPrograms( renderer, extensions, capabilities ) {
bumpMap: !! material.bumpMap,
normalMap: !! material.normalMap,
objectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap,
tangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap,
clearcoatNormalMap: !! material.clearcoatNormalMap,
displacementMap: !! material.displacementMap,
roughnessMap: !! material.roughnessMap,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册