Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
ef46e1e4
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,发现更多精彩内容 >>
提交
ef46e1e4
编写于
12月 16, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Clean up.
上级
3492536c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
150 addition
and
154 deletion
+150
-154
examples/jsm/nodes/misc/TextureCubeNode.js
examples/jsm/nodes/misc/TextureCubeNode.js
+0
-2
examples/jsm/nodes/misc/TextureCubeUVNode.js
examples/jsm/nodes/misc/TextureCubeUVNode.js
+110
-112
examples/webgl_materials_envmaps_hdr.html
examples/webgl_materials_envmaps_hdr.html
+20
-20
examples/webgl_materials_envmaps_hdr_nodes.html
examples/webgl_materials_envmaps_hdr_nodes.html
+20
-20
未找到文件。
examples/jsm/nodes/misc/TextureCubeNode.js
浏览文件 @
ef46e1e4
...
...
@@ -4,11 +4,9 @@
import
{
TempNode
}
from
'
../core/TempNode.js
'
;
import
{
FloatNode
}
from
'
../inputs/FloatNode.js
'
;
import
{
ExpressionNode
}
from
'
../core/ExpressionNode.js
'
;
import
{
TextureCubeUVNode
}
from
'
./TextureCubeUVNode.js
'
;
import
{
ReflectNode
}
from
'
../accessors/ReflectNode.js
'
;
import
{
NormalNode
}
from
'
../accessors/NormalNode.js
'
;
import
{
ColorSpaceNode
}
from
'
../utils/ColorSpaceNode.js
'
;
function
TextureCubeNode
(
value
,
uv
,
bias
)
{
...
...
examples/jsm/nodes/misc/TextureCubeUVNode.js
浏览文件 @
ef46e1e4
...
...
@@ -8,11 +8,9 @@ import { StructNode } from '../core/StructNode.js';
import
{
FunctionNode
}
from
'
../core/FunctionNode.js
'
;
import
{
FunctionCallNode
}
from
'
../core/FunctionCallNode.js
'
;
import
{
ExpressionNode
}
from
'
../core/ExpressionNode.js
'
;
import
{
ReflectNode
}
from
'
../accessors/ReflectNode.js
'
;
import
{
FloatNode
}
from
'
../inputs/FloatNode.js
'
;
import
{
OperatorNode
}
from
'
../math/OperatorNode.js
'
;
import
{
MathNode
}
from
'
../math/MathNode.js
'
;
import
{
CondNode
}
from
'
../math/CondNode.js
'
;
import
{
ColorSpaceNode
}
from
'
../utils/ColorSpaceNode.js
'
;
function
TextureCubeUVNode
(
value
,
uv
,
bias
)
{
...
...
@@ -28,13 +26,13 @@ function TextureCubeUVNode( value, uv, bias ) {
TextureCubeUVNode
.
Nodes
=
(
function
()
{
var
TextureCubeUVData
=
new
StructNode
(
`struct TextureCubeUVData {
vec4 tl;
vec4 tr;
vec4 br;
vec4 bl;
vec2 f;
}`
);
`struct TextureCubeUVData {
vec4 tl;
vec4 tr;
vec4 br;
vec4 bl;
vec2 f;
}`
);
var
cubeUV_maxMipLevel
=
new
ConstNode
(
`float cubeUV_maxMipLevel 8.0`
,
true
);
var
cubeUV_minMipLevel
=
new
ConstNode
(
`float cubeUV_minMipLevel 4.0`
,
true
);
...
...
@@ -46,75 +44,75 @@ TextureCubeUVNode.Nodes = ( function () {
// sampling a textureCube (not generally normalized).
var
getFace
=
new
FunctionNode
(
`float getFace(vec3 direction) {
vec3 absDirection = abs(direction);
float face = -1.0;
if (absDirection.x > absDirection.z) {
if (absDirection.x > absDirection.y)
face = direction.x > 0.0 ? 0.0 : 3.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
} else {
if (absDirection.z > absDirection.y)
face = direction.z > 0.0 ? 2.0 : 5.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
}
return face;
}`
);
`float getFace(vec3 direction) {
vec3 absDirection = abs(direction);
float face = -1.0;
if (absDirection.x > absDirection.z) {
if (absDirection.x > absDirection.y)
face = direction.x > 0.0 ? 0.0 : 3.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
} else {
if (absDirection.z > absDirection.y)
face = direction.z > 0.0 ? 2.0 : 5.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
}
return face;
}`
);
getFace
.
useKeywords
=
false
;
var
getUV
=
new
FunctionNode
(
`vec2 getUV(vec3 direction, float face) {
vec2 uv;
if (face == 0.0) {
uv = vec2(-direction.z, direction.y) / abs(direction.x);
} else if (face == 1.0) {
uv = vec2(direction.x, -direction.z) / abs(direction.y);
} else if (face == 2.0) {
uv = direction.xy / abs(direction.z);
} else if (face == 3.0) {
uv = vec2(direction.z, direction.y) / abs(direction.x);
} else if (face == 4.0) {
uv = direction.xz / abs(direction.y);
} else {
uv = vec2(-direction.x, direction.y) / abs(direction.z);
}
return 0.5 * (uv + 1.0);
}`
);
`vec2 getUV(vec3 direction, float face) {
vec2 uv;
if (face == 0.0) {
uv = vec2(-direction.z, direction.y) / abs(direction.x);
} else if (face == 1.0) {
uv = vec2(direction.x, -direction.z) / abs(direction.y);
} else if (face == 2.0) {
uv = direction.xy / abs(direction.z);
} else if (face == 3.0) {
uv = vec2(direction.z, direction.y) / abs(direction.x);
} else if (face == 4.0) {
uv = direction.xz / abs(direction.y);
} else {
uv = vec2(-direction.x, direction.y) / abs(direction.z);
}
return 0.5 * (uv + 1.0);
}`
);
getUV
.
useKeywords
=
false
;
var
bilinearCubeUV
=
new
FunctionNode
(
`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {
float face = getFace(direction);
float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);
mipInt = max(mipInt, cubeUV_minMipLevel);
float faceSize = exp2(mipInt);
float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);
vec2 uv = getUV(direction, face) * (faceSize - 1.0);
vec2 f = fract(uv);
uv += 0.5 - f;
if (face > 2.0) {
uv.y += faceSize;
face -= 3.0;
}
uv.x += face * faceSize;
if(mipInt < cubeUV_maxMipLevel){
uv.y += 2.0 * cubeUV_maxTileSize;
}
uv.y += filterInt * 2.0 * cubeUV_minTileSize;
uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);
uv *= texelSize;
vec4 tl = texture2D(envMap, uv);
uv.x += texelSize;
vec4 tr = texture2D(envMap, uv);
uv.y += texelSize;
vec4 br = texture2D(envMap, uv);
uv.x -= texelSize;
vec4 bl = texture2D(envMap, uv);
return TextureCubeUVData( tl, tr, br, bl, f );
}`
,
[
TextureCubeUVData
,
getFace
,
getUV
,
cubeUV_maxMipLevel
,
cubeUV_minMipLevel
,
cubeUV_maxTileSize
,
cubeUV_minTileSize
]
);
`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {
float face = getFace(direction);
float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);
mipInt = max(mipInt, cubeUV_minMipLevel);
float faceSize = exp2(mipInt);
float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);
vec2 uv = getUV(direction, face) * (faceSize - 1.0);
vec2 f = fract(uv);
uv += 0.5 - f;
if (face > 2.0) {
uv.y += faceSize;
face -= 3.0;
}
uv.x += face * faceSize;
if(mipInt < cubeUV_maxMipLevel){
uv.y += 2.0 * cubeUV_maxTileSize;
}
uv.y += filterInt * 2.0 * cubeUV_minTileSize;
uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);
uv *= texelSize;
vec4 tl = texture2D(envMap, uv);
uv.x += texelSize;
vec4 tr = texture2D(envMap, uv);
uv.y += texelSize;
vec4 br = texture2D(envMap, uv);
uv.x -= texelSize;
vec4 bl = texture2D(envMap, uv);
return TextureCubeUVData( tl, tr, br, bl, f );
}`
,
[
TextureCubeUVData
,
getFace
,
getUV
,
cubeUV_maxMipLevel
,
cubeUV_minMipLevel
,
cubeUV_maxTileSize
,
cubeUV_minTileSize
]
);
bilinearCubeUV
.
useKeywords
=
false
;
// These defines must match with PMREMGenerator
...
...
@@ -138,21 +136,21 @@ TextureCubeUVNode.Nodes = ( function () {
var
defines
=
[
r0
,
v0
,
m0
,
r1
,
v1
,
m1
,
r4
,
v4
,
m4
,
r5
,
v5
,
m5
,
r6
,
v6
,
m6
];
var
roughnessToMip
=
new
FunctionNode
(
`float roughnessToMip(float roughness) {
float mip = 0.0;
if (roughness >= r1) {
mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;
} else if (roughness >= r4) {
mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;
} else if (roughness >= r5) {
mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;
} else if (roughness >= r6) {
mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;
} else {
mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25
}
return mip;
}`
,
defines
);
`float roughnessToMip(float roughness) {
float mip = 0.0;
if (roughness >= r1) {
mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;
} else if (roughness >= r4) {
mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;
} else if (roughness >= r5) {
mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;
} else if (roughness >= r6) {
mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;
} else {
mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25
}
return mip;
}`
,
defines
);
return
{
bilinearCubeUV
:
bilinearCubeUV
,
...
...
@@ -168,27 +166,27 @@ TextureCubeUVNode.prototype.constructor = TextureCubeUVNode;
TextureCubeUVNode
.
prototype
.
nodeType
=
"
TextureCubeUV
"
;
TextureCubeUVNode
.
prototype
.
bilinearCubeUV
=
function
(
builder
,
texture
,
uv
,
mipInt
)
{
var
bilinearCubeUV
=
new
FunctionCallNode
(
TextureCubeUVNode
.
Nodes
.
bilinearCubeUV
,
[
texture
,
uv
,
mipInt
]
);
this
.
colorSpaceTL
=
this
.
colorSpaceTL
||
new
ColorSpaceNode
(
new
ExpressionNode
(
''
,
'
v4
'
)
);
this
.
colorSpaceTL
.
fromDecoding
(
builder
.
getTextureEncodingFromMap
(
this
.
value
.
value
)
);
this
.
colorSpaceTL
.
input
.
parse
(
bilinearCubeUV
.
build
(
builder
)
+
'
.tl
'
);
this
.
colorSpaceTR
=
this
.
colorSpaceTR
||
new
ColorSpaceNode
(
new
ExpressionNode
(
''
,
'
v4
'
)
);
this
.
colorSpaceTR
.
fromDecoding
(
builder
.
getTextureEncodingFromMap
(
this
.
value
.
value
)
);
this
.
colorSpaceTR
.
input
.
parse
(
bilinearCubeUV
.
build
(
builder
)
+
'
.tr
'
);
this
.
colorSpaceBL
=
this
.
colorSpaceBL
||
new
ColorSpaceNode
(
new
ExpressionNode
(
''
,
'
v4
'
)
);
this
.
colorSpaceBL
.
fromDecoding
(
builder
.
getTextureEncodingFromMap
(
this
.
value
.
value
)
);
this
.
colorSpaceBL
.
input
.
parse
(
bilinearCubeUV
.
build
(
builder
)
+
'
.bl
'
);
this
.
colorSpaceBR
=
this
.
colorSpaceBR
||
new
ColorSpaceNode
(
new
ExpressionNode
(
''
,
'
v4
'
)
);
this
.
colorSpaceBR
.
fromDecoding
(
builder
.
getTextureEncodingFromMap
(
this
.
value
.
value
)
);
this
.
colorSpaceBR
.
input
.
parse
(
bilinearCubeUV
.
build
(
builder
)
+
'
.br
'
);
var
f
=
bilinearCubeUV
.
build
(
builder
)
+
'
.f
'
;
// add a custom context for fix incompatibility with the core
// include ColorSpace function only for vertex shader (in fragment shader color space functions is added automatically by core)
// this should be removed in the future
...
...
@@ -197,7 +195,7 @@ TextureCubeUVNode.prototype.bilinearCubeUV = function ( builder, texture, uv, mi
var
context
=
{
include
:
builder
.
isShader
(
'
vertex
'
),
ignoreCache
:
true
};
builder
.
addContext
(
context
);
this
.
colorSpaceTLExp
=
new
ExpressionNode
(
this
.
colorSpaceTL
.
build
(
builder
,
'
v4
'
),
'
v4
'
);
this
.
colorSpaceTRExp
=
new
ExpressionNode
(
this
.
colorSpaceTR
.
build
(
builder
,
'
v4
'
),
'
v4
'
);
this
.
colorSpaceBLExp
=
new
ExpressionNode
(
this
.
colorSpaceBL
.
build
(
builder
,
'
v4
'
),
'
v4
'
);
...
...
@@ -209,15 +207,15 @@ TextureCubeUVNode.prototype.bilinearCubeUV = function ( builder, texture, uv, mi
// --
var
output
=
new
ExpressionNode
(
`mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )`
,
'
v4
'
);
output
.
keywords
[
'
cubeUV_TL
'
]
=
this
.
colorSpaceTLExp
;
output
.
keywords
[
'
cubeUV_TR
'
]
=
this
.
colorSpaceTRExp
;
output
.
keywords
[
'
cubeUV_BL
'
]
=
this
.
colorSpaceBLExp
;
output
.
keywords
[
'
cubeUV_BR
'
]
=
this
.
colorSpaceBRExp
;
output
.
keywords
[
'
cubeUV
'
]
=
bilinearCubeUV
;
var
output
=
new
ExpressionNode
(
`mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )`
,
'
v4
'
);
output
.
keywords
[
'
cubeUV_TL
'
]
=
this
.
colorSpaceTLExp
;
output
.
keywords
[
'
cubeUV_TR
'
]
=
this
.
colorSpaceTRExp
;
output
.
keywords
[
'
cubeUV_BL
'
]
=
this
.
colorSpaceBLExp
;
output
.
keywords
[
'
cubeUV_BR
'
]
=
this
.
colorSpaceBRExp
;
output
.
keywords
[
'
cubeUV
'
]
=
bilinearCubeUV
;
return
output
;
};
TextureCubeUVNode
.
prototype
.
generate
=
function
(
builder
,
output
)
{
...
...
@@ -229,8 +227,8 @@ TextureCubeUVNode.prototype.generate = function ( builder, output ) {
var
mipV
=
new
FunctionCallNode
(
TextureCubeUVNode
.
Nodes
.
roughnessToMip
,
[
bias
]
);
var
mip
=
new
MathNode
(
mipV
,
TextureCubeUVNode
.
Nodes
.
m0
,
TextureCubeUVNode
.
Nodes
.
cubeUV_maxMipLevel
,
MathNode
.
CLAMP
);
var
mipInt
=
new
MathNode
(
mip
,
MathNode
.
FLOOR
);
var
mipF
=
new
MathNode
(
mip
,
MathNode
.
FRACT
);
var
mipInt
=
new
MathNode
(
mip
,
MathNode
.
FLOOR
);
var
mipF
=
new
MathNode
(
mip
,
MathNode
.
FRACT
);
var
color0
=
this
.
bilinearCubeUV
(
builder
,
this
.
value
,
uv
,
mipInt
);
var
color1
=
this
.
bilinearCubeUV
(
builder
,
this
.
value
,
uv
,
new
OperatorNode
(
...
...
@@ -241,16 +239,16 @@ TextureCubeUVNode.prototype.generate = function ( builder, output ) {
var
color1Mix
=
new
MathNode
(
color0
,
color1
,
mipF
,
MathNode
.
MIX
);
/*
/*
// TODO: Optimize this in the future
var cond = new CondNode(
mipF,
new FloatNode( 0 ).setReadonly( true ),
CondNode.EQUAL,
var cond = new CondNode(
mipF,
new FloatNode( 0 ).setReadonly( true ),
CondNode.EQUAL,
color0, // if
color1Mix
// else
);
*/
color1Mix
// else
);
*/
return
builder
.
format
(
color1Mix
.
build
(
builder
),
'
v4
'
,
output
);
...
...
examples/webgl_materials_envmaps_hdr.html
浏览文件 @
ef46e1e4
...
...
@@ -47,31 +47,31 @@
var
envScene
=
new
THREE
.
Scene
();
var
geometry
=
new
THREE
.
BoxBufferGeometry
();
geometry
.
deleteAttribute
(
'
uv
'
);
var
roomMaterial
=
new
THREE
.
MeshStandardMaterial
({
metalness
:
0
,
side
:
THREE
.
BackSide
}
);
var
room
=
new
THREE
.
Mesh
(
geometry
,
roomMaterial
);
room
.
scale
.
setScalar
(
10
);
envScene
.
add
(
room
);
geometry
.
deleteAttribute
(
'
uv
'
);
var
roomMaterial
=
new
THREE
.
MeshStandardMaterial
(
{
metalness
:
0
,
side
:
THREE
.
BackSide
}
);
var
room
=
new
THREE
.
Mesh
(
geometry
,
roomMaterial
);
room
.
scale
.
setScalar
(
10
);
envScene
.
add
(
room
);
var
mainLight
=
new
THREE
.
PointLight
(
0xffffff
,
50
,
0
,
2
);
envScene
.
add
(
mainLight
);
var
mainLight
=
new
THREE
.
PointLight
(
0xffffff
,
50
,
0
,
2
);
envScene
.
add
(
mainLight
);
var
lightMaterial
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x000000
,
emissive
:
0xffffff
,
emissiveIntensity
:
10
}
);
var
light1
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light1
.
position
.
set
(
-
5
,
2
,
0
);
light1
.
scale
.
set
(
0.1
,
1
,
1
);
envScene
.
add
(
light1
);
var
light1
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light1
.
position
.
set
(
-
5
,
2
,
0
);
light1
.
scale
.
set
(
0.1
,
1
,
1
);
envScene
.
add
(
light1
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
0
,
5
,
0
);
light2
.
scale
.
set
(
1
,
0.1
,
1
);
envScene
.
add
(
light2
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
0
,
5
,
0
);
light2
.
scale
.
set
(
1
,
0.1
,
1
);
envScene
.
add
(
light2
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
2
,
1
,
5
);
light2
.
scale
.
set
(
1.5
,
2
,
0.1
);
envScene
.
add
(
light2
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
2
,
1
,
5
);
light2
.
scale
.
set
(
1.5
,
2
,
0.1
);
envScene
.
add
(
light2
);
return
envScene
;
...
...
@@ -118,7 +118,7 @@
pmremGenerator
.
dispose
();
}
}
;
var
envScene
=
getEnvScene
();
generatedCubeRenderTarget
=
pmremGenerator
.
fromScene
(
envScene
,
0.04
);
...
...
examples/webgl_materials_envmaps_hdr_nodes.html
浏览文件 @
ef46e1e4
...
...
@@ -51,31 +51,31 @@
var
envScene
=
new
THREE
.
Scene
();
var
geometry
=
new
THREE
.
BoxBufferGeometry
();
geometry
.
deleteAttribute
(
'
uv
'
);
var
roomMaterial
=
new
THREE
.
MeshStandardMaterial
({
metalness
:
0
,
side
:
THREE
.
BackSide
}
);
var
room
=
new
THREE
.
Mesh
(
geometry
,
roomMaterial
);
room
.
scale
.
setScalar
(
10
);
envScene
.
add
(
room
);
geometry
.
deleteAttribute
(
'
uv
'
);
var
roomMaterial
=
new
THREE
.
MeshStandardMaterial
(
{
metalness
:
0
,
side
:
THREE
.
BackSide
}
);
var
room
=
new
THREE
.
Mesh
(
geometry
,
roomMaterial
);
room
.
scale
.
setScalar
(
10
);
envScene
.
add
(
room
);
var
mainLight
=
new
THREE
.
PointLight
(
0xffffff
,
50
,
0
,
2
);
envScene
.
add
(
mainLight
);
var
mainLight
=
new
THREE
.
PointLight
(
0xffffff
,
50
,
0
,
2
);
envScene
.
add
(
mainLight
);
var
lightMaterial
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x000000
,
emissive
:
0xffffff
,
emissiveIntensity
:
10
}
);
var
light1
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light1
.
position
.
set
(
-
5
,
2
,
0
);
light1
.
scale
.
set
(
0.1
,
1
,
1
);
envScene
.
add
(
light1
);
var
light1
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light1
.
position
.
set
(
-
5
,
2
,
0
);
light1
.
scale
.
set
(
0.1
,
1
,
1
);
envScene
.
add
(
light1
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
0
,
5
,
0
);
light2
.
scale
.
set
(
1
,
0.1
,
1
);
envScene
.
add
(
light2
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
0
,
5
,
0
);
light2
.
scale
.
set
(
1
,
0.1
,
1
);
envScene
.
add
(
light2
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
2
,
1
,
5
);
light2
.
scale
.
set
(
1.5
,
2
,
0.1
);
envScene
.
add
(
light2
);
var
light2
=
new
THREE
.
Mesh
(
geometry
,
lightMaterial
);
light2
.
position
.
set
(
2
,
1
,
5
);
light2
.
scale
.
set
(
1.5
,
2
,
0.1
);
envScene
.
add
(
light2
);
return
envScene
;
...
...
@@ -130,7 +130,7 @@
pmremGenerator
.
dispose
();
}
}
;
var
envScene
=
getEnvScene
();
generatedCubeRenderTarget
=
pmremGenerator
.
fromScene
(
envScene
,
0.04
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录