Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
17affe6f
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
17affe6f
编写于
8月 22, 2019
作者:
M
Mr.doob
提交者:
GitHub
8月 22, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17318 from arobertson0/descriptive-defines-2
Matching js material class names with glsl defines
上级
1e3c38c3
9e2f57d0
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
22 addition
and
28 deletion
+22
-28
docs/api/en/materials/MeshPhysicalMaterial.html
docs/api/en/materials/MeshPhysicalMaterial.html
+1
-1
docs/api/en/materials/MeshStandardMaterial.html
docs/api/en/materials/MeshStandardMaterial.html
+1
-1
docs/api/zh/materials/MeshPhysicalMaterial.html
docs/api/zh/materials/MeshPhysicalMaterial.html
+1
-1
docs/api/zh/materials/MeshStandardMaterial.html
docs/api/zh/materials/MeshStandardMaterial.html
+1
-1
examples/js/effects/OutlineEffect.js
examples/js/effects/OutlineEffect.js
+1
-1
examples/js/loaders/GLTFLoader.js
examples/js/loaders/GLTFLoader.js
+1
-1
examples/jsm/effects/OutlineEffect.js
examples/jsm/effects/OutlineEffect.js
+1
-1
examples/jsm/loaders/GLTFLoader.js
examples/jsm/loaders/GLTFLoader.js
+1
-1
examples/jsm/nodes/materials/nodes/StandardNode.js
examples/jsm/nodes/materials/nodes/StandardNode.js
+1
-1
src/materials/MeshPhysicalMaterial.js
src/materials/MeshPhysicalMaterial.js
+4
-4
src/materials/MeshStandardMaterial.js
src/materials/MeshStandardMaterial.js
+2
-2
src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js
src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js
+1
-1
src/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js
...shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js
+1
-1
src/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js
...s/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js
+1
-1
src/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js
...derers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js
+1
-1
src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js
...enderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js
+1
-1
src/renderers/shaders/ShaderLib/meshphysical_frag.glsl.js
src/renderers/shaders/ShaderLib/meshphysical_frag.glsl.js
+1
-7
src/renderers/shaders/ShaderLib/meshphysical_vert.glsl.js
src/renderers/shaders/ShaderLib/meshphysical_vert.glsl.js
+1
-1
未找到文件。
docs/api/en/materials/MeshPhysicalMaterial.html
浏览文件 @
17affe6f
...
@@ -75,8 +75,8 @@
...
@@ -75,8 +75,8 @@
<code>
<code>
{
{
'STANDARD': ''
'PHYSICAL': '',
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
};
</code>
</code>
...
...
docs/api/en/materials/MeshStandardMaterial.html
浏览文件 @
17affe6f
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
<h3>
[property:Object defines]
</h3>
<h3>
[property:Object defines]
</h3>
<p>
An object of the form:
<p>
An object of the form:
<code>
<code>
{ '
PHYSICAL
': '' };
{ '
STANDARD
': '' };
</code>
</code>
This is used by the [page:WebGLRenderer] for selecting shaders.
This is used by the [page:WebGLRenderer] for selecting shaders.
...
...
docs/api/zh/materials/MeshPhysicalMaterial.html
浏览文件 @
17affe6f
...
@@ -69,8 +69,8 @@
...
@@ -69,8 +69,8 @@
<code>
<code>
{
{
'STANDARD': ''
'PHYSICAL': '',
'PHYSICAL': '',
'ADVANCED_PHYSICAL': ''
};
};
</code>
</code>
...
...
docs/api/zh/materials/MeshStandardMaterial.html
浏览文件 @
17affe6f
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
<h3>
[property:Object defines]
</h3>
<h3>
[property:Object defines]
</h3>
<p>
如下形式的对象:
<p>
如下形式的对象:
<code>
<code>
{ '
PHYSICAL
': '' };
{ '
STANDARD
': '' };
</code>
</code>
[page:WebGLRenderer]使用它来选择shaders。
[page:WebGLRenderer]使用它来选择shaders。
</p>
</p>
...
...
examples/js/effects/OutlineEffect.js
浏览文件 @
17affe6f
...
@@ -125,7 +125,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
...
@@ -125,7 +125,7 @@ THREE.OutlineEffect = function ( renderer, parameters ) {
var
vertexShaderChunk2
=
[
var
vertexShaderChunk2
=
[
"
#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined(
PHYSICAL
)
"
,
"
#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined(
STANDARD
)
"
,
"
#ifndef USE_ENVMAP
"
,
"
#ifndef USE_ENVMAP
"
,
"
vec3 objectNormal = normalize( normal );
"
,
"
vec3 objectNormal = normalize( normal );
"
,
"
#endif
"
,
"
#endif
"
,
...
...
examples/js/loaders/GLTFLoader.js
浏览文件 @
17affe6f
...
@@ -726,7 +726,7 @@ THREE.GLTFLoader = ( function () {
...
@@ -726,7 +726,7 @@ THREE.GLTFLoader = ( function () {
materialParams
.
vertexShader
=
shader
.
vertexShader
;
materialParams
.
vertexShader
=
shader
.
vertexShader
;
materialParams
.
fragmentShader
=
fragmentShader
;
materialParams
.
fragmentShader
=
fragmentShader
;
materialParams
.
uniforms
=
uniforms
;
materialParams
.
uniforms
=
uniforms
;
materialParams
.
defines
=
{
'
PHYSICAL
'
:
''
}
materialParams
.
defines
=
{
'
STANDARD
'
:
''
}
materialParams
.
color
=
new
THREE
.
Color
(
1.0
,
1.0
,
1.0
);
materialParams
.
color
=
new
THREE
.
Color
(
1.0
,
1.0
,
1.0
);
materialParams
.
opacity
=
1.0
;
materialParams
.
opacity
=
1.0
;
...
...
examples/jsm/effects/OutlineEffect.js
浏览文件 @
17affe6f
...
@@ -132,7 +132,7 @@ var OutlineEffect = function ( renderer, parameters ) {
...
@@ -132,7 +132,7 @@ var OutlineEffect = function ( renderer, parameters ) {
var
vertexShaderChunk2
=
[
var
vertexShaderChunk2
=
[
"
#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined(
PHYSICAL
)
"
,
"
#if ! defined( LAMBERT ) && ! defined( PHONG ) && ! defined( TOON ) && ! defined(
STANDARD
)
"
,
"
#ifndef USE_ENVMAP
"
,
"
#ifndef USE_ENVMAP
"
,
"
vec3 objectNormal = normalize( normal );
"
,
"
vec3 objectNormal = normalize( normal );
"
,
"
#endif
"
,
"
#endif
"
,
...
...
examples/jsm/loaders/GLTFLoader.js
浏览文件 @
17affe6f
...
@@ -791,7 +791,7 @@ var GLTFLoader = ( function () {
...
@@ -791,7 +791,7 @@ var GLTFLoader = ( function () {
materialParams
.
vertexShader
=
shader
.
vertexShader
;
materialParams
.
vertexShader
=
shader
.
vertexShader
;
materialParams
.
fragmentShader
=
fragmentShader
;
materialParams
.
fragmentShader
=
fragmentShader
;
materialParams
.
uniforms
=
uniforms
;
materialParams
.
uniforms
=
uniforms
;
materialParams
.
defines
=
{
'
PHYSICAL
'
:
''
}
materialParams
.
defines
=
{
'
STANDARD
'
:
''
}
materialParams
.
color
=
new
Color
(
1.0
,
1.0
,
1.0
);
materialParams
.
color
=
new
Color
(
1.0
,
1.0
,
1.0
);
materialParams
.
opacity
=
1.0
;
materialParams
.
opacity
=
1.0
;
...
...
examples/jsm/nodes/materials/nodes/StandardNode.js
浏览文件 @
17affe6f
...
@@ -33,7 +33,7 @@ StandardNode.prototype.build = function ( builder ) {
...
@@ -33,7 +33,7 @@ StandardNode.prototype.build = function ( builder ) {
var
code
;
var
code
;
builder
.
define
(
'
PHYSICAL
'
);
builder
.
define
(
'
STANDARD
'
);
var
useClearcoat
=
this
.
clearcoat
||
this
.
clearcoatRoughness
||
this
.
clearCoatNormal
;
var
useClearcoat
=
this
.
clearcoat
||
this
.
clearcoatRoughness
||
this
.
clearCoatNormal
;
...
...
src/materials/MeshPhysicalMaterial.js
浏览文件 @
17affe6f
...
@@ -23,8 +23,8 @@ function MeshPhysicalMaterial( parameters ) {
...
@@ -23,8 +23,8 @@ function MeshPhysicalMaterial( parameters ) {
this
.
defines
=
{
this
.
defines
=
{
'
PHYSICAL
'
:
''
,
'
STANDARD
'
:
''
,
'
ADVANCED_
PHYSICAL
'
:
''
'
PHYSICAL
'
:
''
};
};
...
@@ -55,8 +55,8 @@ MeshPhysicalMaterial.prototype.copy = function ( source ) {
...
@@ -55,8 +55,8 @@ MeshPhysicalMaterial.prototype.copy = function ( source ) {
this
.
defines
=
{
this
.
defines
=
{
'
PHYSICAL
'
:
''
,
'
STANDARD
'
:
''
,
'
ADVANCED_
PHYSICAL
'
:
''
'
PHYSICAL
'
:
''
};
};
...
...
src/materials/MeshStandardMaterial.js
浏览文件 @
17affe6f
...
@@ -59,7 +59,7 @@ function MeshStandardMaterial( parameters ) {
...
@@ -59,7 +59,7 @@ function MeshStandardMaterial( parameters ) {
Material
.
call
(
this
);
Material
.
call
(
this
);
this
.
defines
=
{
'
PHYSICAL
'
:
''
};
this
.
defines
=
{
'
STANDARD
'
:
''
};
this
.
type
=
'
MeshStandardMaterial
'
;
this
.
type
=
'
MeshStandardMaterial
'
;
...
@@ -123,7 +123,7 @@ MeshStandardMaterial.prototype.copy = function ( source ) {
...
@@ -123,7 +123,7 @@ MeshStandardMaterial.prototype.copy = function ( source ) {
Material
.
prototype
.
copy
.
call
(
this
,
source
);
Material
.
prototype
.
copy
.
call
(
this
,
source
);
this
.
defines
=
{
'
PHYSICAL
'
:
''
};
this
.
defines
=
{
'
STANDARD
'
:
''
};
this
.
color
.
copy
(
source
.
color
);
this
.
color
.
copy
(
source
.
color
);
this
.
roughness
=
source
.
roughness
;
this
.
roughness
=
source
.
roughness
;
...
...
src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js
浏览文件 @
17affe6f
...
@@ -6,7 +6,7 @@ export default /* glsl */`
...
@@ -6,7 +6,7 @@ export default /* glsl */`
reflectedLight.indirectDiffuse *= ambientOcclusion;
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_ENVMAP ) && defined(
PHYSICAL
)
#if defined( USE_ENVMAP ) && defined(
STANDARD
)
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
...
...
src/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js
浏览文件 @
17affe6f
export
default
/* glsl */
`
export
default
/* glsl */
`
#if NUM_CLIPPING_PLANES > 0
#if NUM_CLIPPING_PLANES > 0
#if ! defined(
PHYSICAL
) && ! defined( PHONG ) && ! defined( MATCAP )
#if ! defined(
STANDARD
) && ! defined( PHONG ) && ! defined( MATCAP )
varying vec3 vViewPosition;
varying vec3 vViewPosition;
#endif
#endif
...
...
src/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js
浏览文件 @
17affe6f
export
default
/* glsl */
`
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;
varying vec3 vViewPosition;
#endif
#endif
`
;
`
;
src/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js
浏览文件 @
17affe6f
export
default
/* glsl */
`
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;
vViewPosition = - mvPosition.xyz;
#endif
#endif
`
;
`
;
src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js
浏览文件 @
17affe6f
...
@@ -15,7 +15,7 @@ export default /* glsl */`
...
@@ -15,7 +15,7 @@ export default /* glsl */`
#endif
#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 );
irradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );
...
...
src/renderers/shaders/ShaderLib/meshphysical_frag.glsl.js
浏览文件 @
17affe6f
export
default
/* glsl */
`
export
default
/* glsl */
`
#define
PHYSICAL_REFLECTION
#define
STANDARD
#ifdef PHYSICAL
#ifdef PHYSICAL
#define CLEARCOAT
#endif
#ifdef ADVANCED_PHYSICAL
#define REFLECTIVITY
#define REFLECTIVITY
#define CLEARCOAT
#define CLEARCOAT
#endif
#endif
...
...
src/renderers/shaders/ShaderLib/meshphysical_vert.glsl.js
浏览文件 @
17affe6f
export
default
/* glsl */
`
export
default
/* glsl */
`
#define
PHYSICAL
#define
STANDARD
varying vec3 vViewPosition;
varying vec3 vViewPosition;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录