Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
21a9169b
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,发现更多精彩内容 >>
提交
21a9169b
编写于
8月 24, 2018
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Removemore lgtm.com warnings
上级
a5a1ccba
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
69 addition
and
79 deletion
+69
-79
examples/canvas_geometry_terrain.html
examples/canvas_geometry_terrain.html
+1
-2
examples/canvas_interactive_voxelpainter.html
examples/canvas_interactive_voxelpainter.html
+0
-2
examples/canvas_lines_sphere.html
examples/canvas_lines_sphere.html
+1
-5
examples/js/postprocessing/SSAOPass.js
examples/js/postprocessing/SSAOPass.js
+57
-24
examples/webgl_buffergeometry_instancing.html
examples/webgl_buffergeometry_instancing.html
+0
-1
examples/webgl_geometries.html
examples/webgl_geometries.html
+1
-1
examples/webgl_geometry_minecraft_ao.html
examples/webgl_geometry_minecraft_ao.html
+0
-1
examples/webgl_lights_pointlights2.html
examples/webgl_lights_pointlights2.html
+1
-1
examples/webgl_lines_sphere.html
examples/webgl_lines_sphere.html
+1
-1
examples/webgl_materials_curvature.html
examples/webgl_materials_curvature.html
+1
-1
examples/webgl_materials_texture_rotation.html
examples/webgl_materials_texture_rotation.html
+0
-2
examples/webgl_octree.html
examples/webgl_octree.html
+1
-18
examples/webgl_points_sprites.html
examples/webgl_points_sprites.html
+1
-1
examples/webgl_postprocessing_nodes.html
examples/webgl_postprocessing_nodes.html
+1
-2
examples/webgl_shaders_tonemapping.html
examples/webgl_shaders_tonemapping.html
+3
-3
examples/webgl_shading_physical.html
examples/webgl_shading_physical.html
+0
-12
examples/webgl_terrain_dynamic.html
examples/webgl_terrain_dynamic.html
+0
-2
未找到文件。
examples/canvas_geometry_terrain.html
浏览文件 @
21a9169b
...
@@ -145,8 +145,7 @@
...
@@ -145,8 +145,7 @@
function
generateTexture
(
data
,
width
,
height
)
{
function
generateTexture
(
data
,
width
,
height
)
{
var
canvas
,
context
,
image
,
imageData
,
var
canvas
,
context
,
image
,
imageData
,
vector3
,
sun
,
shade
;
level
,
diff
,
vector3
,
sun
,
shade
;
vector3
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
vector3
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
...
...
examples/canvas_interactive_voxelpainter.html
浏览文件 @
21a9169b
...
@@ -74,8 +74,6 @@
...
@@ -74,8 +74,6 @@
objects
.
push
(
plane
);
objects
.
push
(
plane
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xff0000
,
wireframe
:
true
}
);
// Lights
// Lights
var
ambientLight
=
new
THREE
.
AmbientLight
(
0x606060
);
var
ambientLight
=
new
THREE
.
AmbientLight
(
0x606060
);
...
...
examples/canvas_lines_sphere.html
浏览文件 @
21a9169b
...
@@ -33,10 +33,6 @@
...
@@ -33,10 +33,6 @@
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
SEPARATION
=
200
,
AMOUNTX
=
10
,
AMOUNTY
=
10
,
camera
,
scene
,
renderer
;
camera
,
scene
,
renderer
;
init
();
init
();
...
@@ -44,7 +40,7 @@
...
@@ -44,7 +40,7 @@
function
init
()
{
function
init
()
{
var
container
,
separation
=
100
,
amountX
=
50
,
amountY
=
50
,
particles
,
particle
;
var
container
,
particle
;
container
=
document
.
createElement
(
'
div
'
);
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
document
.
body
.
appendChild
(
container
);
...
...
examples/js/postprocessing/SSAOPass.js
浏览文件 @
21a9169b
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* - Ambient occlusion clamp (numeric value).
* - Ambient occlusion clamp (numeric value).
* - lumInfluence
* - lumInfluence
* - Pixel luminosity influence in AO calculation (numeric value).
* - Pixel luminosity influence in AO calculation (numeric value).
*
*
* To output to screen set renderToScreens true
* To output to screen set renderToScreens true
*
*
* @author alteredq / http://alteredqualia.com/
* @author alteredq / http://alteredqualia.com/
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
*/
*/
THREE
.
SSAOPass
=
function
(
scene
,
camera
,
width
,
height
)
{
THREE
.
SSAOPass
=
function
(
scene
,
camera
,
width
,
height
)
{
if
(
THREE
.
SSAOShader
===
undefined
)
{
if
(
THREE
.
SSAOShader
===
undefined
)
{
console
.
warn
(
'
THREE.SSAOPass depends on THREE.SSAOShader
'
);
console
.
warn
(
'
THREE.SSAOPass depends on THREE.SSAOShader
'
);
return
new
THREE
.
ShaderPass
();
return
new
THREE
.
ShaderPass
();
...
@@ -46,7 +46,7 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
...
@@ -46,7 +46,7 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
//Depth render target
//Depth render target
this
.
depthRenderTarget
=
new
THREE
.
WebGLRenderTarget
(
this
.
width
,
this
.
height
,
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
}
);
this
.
depthRenderTarget
=
new
THREE
.
WebGLRenderTarget
(
this
.
width
,
this
.
height
,
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
}
);
//this.depthRenderTarget.texture.name = 'SSAOShader.rt';
//this.depthRenderTarget.texture.name = 'SSAOShader.rt';
//Shader uniforms
//Shader uniforms
this
.
uniforms
[
'
tDepth
'
].
value
=
this
.
depthRenderTarget
.
texture
;
this
.
uniforms
[
'
tDepth
'
].
value
=
this
.
depthRenderTarget
.
texture
;
this
.
uniforms
[
'
size
'
].
value
.
set
(
this
.
width
,
this
.
height
);
this
.
uniforms
[
'
size
'
].
value
.
set
(
this
.
width
,
this
.
height
);
...
@@ -59,37 +59,70 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
...
@@ -59,37 +59,70 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
this
.
uniforms
[
'
lumInfluence
'
].
value
=
0.7
;
this
.
uniforms
[
'
lumInfluence
'
].
value
=
0.7
;
//Setters and getters for uniforms
//Setters and getters for uniforms
var
self
=
this
;
Object
.
defineProperties
(
this
,
{
Object
.
defineProperties
(
this
,
{
radius
:
{
radius
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
radius
'
].
value
;
},
get
:
function
()
{
set
:
function
(
value
)
{
this
.
uniforms
[
'
radius
'
].
value
=
value
;
}
return
this
.
uniforms
[
'
radius
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
radius
'
].
value
=
value
;
}
},
},
onlyAO
:
{
onlyAO
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
onlyAO
'
].
value
;
},
get
:
function
()
{
set
:
function
(
value
)
{
this
.
uniforms
[
'
onlyAO
'
].
value
=
value
;
}
return
this
.
uniforms
[
'
onlyAO
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
onlyAO
'
].
value
=
value
;
}
},
},
aoClamp
:
{
aoClamp
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
aoClamp
'
].
value
;
},
get
:
function
()
{
set
:
function
(
value
)
{
this
.
uniforms
[
'
aoClamp
'
].
value
=
value
;
}
return
this
.
uniforms
[
'
aoClamp
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
aoClamp
'
].
value
=
value
;
}
},
},
lumInfluence
:
{
lumInfluence
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
lumInfluence
'
].
value
;
},
get
:
function
()
{
set
:
function
(
value
)
{
this
.
uniforms
[
'
lumInfluence
'
].
value
=
value
;
}
return
this
.
uniforms
[
'
lumInfluence
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
lumInfluence
'
].
value
=
value
;
}
},
},
});
}
);
}
};
THREE
.
SSAOPass
.
prototype
=
Object
.
create
(
THREE
.
ShaderPass
.
prototype
);
THREE
.
SSAOPass
.
prototype
=
Object
.
create
(
THREE
.
ShaderPass
.
prototype
);
/**
/**
* Render using this pass.
* Render using this pass.
*
*
* @method render
* @method render
* @param {WebGLRenderer} renderer
* @param {WebGLRenderer} renderer
* @param {WebGLRenderTarget} writeBuffer Buffer to write output.
* @param {WebGLRenderTarget} writeBuffer Buffer to write output.
...
@@ -97,13 +130,13 @@ THREE.SSAOPass.prototype = Object.create( THREE.ShaderPass.prototype );
...
@@ -97,13 +130,13 @@ THREE.SSAOPass.prototype = Object.create( THREE.ShaderPass.prototype );
* @param {Number} delta Delta time in milliseconds.
* @param {Number} delta Delta time in milliseconds.
* @param {Boolean} maskActive Not used in this pass.
* @param {Boolean} maskActive Not used in this pass.
*/
*/
THREE
.
SSAOPass
.
prototype
.
render
=
function
(
renderer
,
writeBuffer
,
readBuffer
,
delta
,
maskActive
)
{
THREE
.
SSAOPass
.
prototype
.
render
=
function
(
renderer
,
writeBuffer
,
readBuffer
,
delta
,
maskActive
)
{
//Render depth into depthRenderTarget
//Render depth into depthRenderTarget
this
.
scene2
.
overrideMaterial
=
this
.
depthMaterial
;
this
.
scene2
.
overrideMaterial
=
this
.
depthMaterial
;
renderer
.
render
(
this
.
scene2
,
this
.
camera2
,
this
.
depthRenderTarget
,
true
);
renderer
.
render
(
this
.
scene2
,
this
.
camera2
,
this
.
depthRenderTarget
,
true
);
this
.
scene2
.
overrideMaterial
=
null
;
this
.
scene2
.
overrideMaterial
=
null
;
...
@@ -118,8 +151,8 @@ THREE.SSAOPass.prototype.render = function( renderer, writeBuffer, readBuffer, d
...
@@ -118,8 +151,8 @@ THREE.SSAOPass.prototype.render = function( renderer, writeBuffer, readBuffer, d
* @method setScene
* @method setScene
* @param {Scene} scene
* @param {Scene} scene
*/
*/
THREE
.
SSAOPass
.
prototype
.
setScene
=
function
(
scene
)
{
THREE
.
SSAOPass
.
prototype
.
setScene
=
function
(
scene
)
{
this
.
scene2
=
scene
;
this
.
scene2
=
scene
;
};
};
...
@@ -130,7 +163,7 @@ THREE.SSAOPass.prototype.setScene = function(scene) {
...
@@ -130,7 +163,7 @@ THREE.SSAOPass.prototype.setScene = function(scene) {
* @method setCamera
* @method setCamera
* @param {Camera} camera
* @param {Camera} camera
*/
*/
THREE
.
SSAOPass
.
prototype
.
setCamera
=
function
(
camera
)
{
THREE
.
SSAOPass
.
prototype
.
setCamera
=
function
(
camera
)
{
this
.
camera2
=
camera
;
this
.
camera2
=
camera
;
...
@@ -141,12 +174,12 @@ THREE.SSAOPass.prototype.setCamera = function( camera ) {
...
@@ -141,12 +174,12 @@ THREE.SSAOPass.prototype.setCamera = function( camera ) {
/**
/**
* Set resolution of this render pass.
* Set resolution of this render pass.
*
*
* @method setSize
* @method setSize
* @param {Number} width
* @param {Number} width
* @param {Number} height
* @param {Number} height
*/
*/
THREE
.
SSAOPass
.
prototype
.
setSize
=
function
(
width
,
height
)
{
THREE
.
SSAOPass
.
prototype
.
setSize
=
function
(
width
,
height
)
{
this
.
width
=
width
;
this
.
width
=
width
;
this
.
height
=
height
;
this
.
height
=
height
;
...
...
examples/webgl_buffergeometry_instancing.html
浏览文件 @
21a9169b
...
@@ -129,7 +129,6 @@
...
@@ -129,7 +129,6 @@
var
vector
=
new
THREE
.
Vector4
();
var
vector
=
new
THREE
.
Vector4
();
var
triangles
=
1
;
var
instances
=
50000
;
var
instances
=
50000
;
var
positions
=
[];
var
positions
=
[];
...
...
examples/webgl_geometries.html
浏览文件 @
21a9169b
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
scene
=
new
THREE
.
Scene
();
scene
=
new
THREE
.
Scene
();
var
light
,
object
;
var
object
;
var
ambientLight
=
new
THREE
.
AmbientLight
(
0xcccccc
,
0.4
);
var
ambientLight
=
new
THREE
.
AmbientLight
(
0xcccccc
,
0.4
);
scene
.
add
(
ambientLight
);
scene
.
add
(
ambientLight
);
...
...
examples/webgl_geometry_minecraft_ao.html
浏览文件 @
21a9169b
...
@@ -160,7 +160,6 @@
...
@@ -160,7 +160,6 @@
//
//
var
geometry
=
new
THREE
.
Geometry
();
var
geometry
=
new
THREE
.
Geometry
();
var
dummy
=
new
THREE
.
Mesh
();
for
(
var
z
=
0
;
z
<
worldDepth
;
z
++
)
{
for
(
var
z
=
0
;
z
<
worldDepth
;
z
++
)
{
...
...
examples/webgl_lights_pointlights2.html
浏览文件 @
21a9169b
...
@@ -217,7 +217,7 @@
...
@@ -217,7 +217,7 @@
function
render
()
{
function
render
()
{
var
time
=
Date
.
now
()
*
0.00025
;
var
time
=
Date
.
now
()
*
0.00025
;
var
z
=
20
,
d
=
150
;
var
d
=
150
;
light1
.
position
.
x
=
Math
.
sin
(
time
*
0.7
)
*
d
;
light1
.
position
.
x
=
Math
.
sin
(
time
*
0.7
)
*
d
;
light1
.
position
.
z
=
Math
.
cos
(
time
*
0.3
)
*
d
;
light1
.
position
.
z
=
Math
.
cos
(
time
*
0.3
)
*
d
;
...
...
examples/webgl_lines_sphere.html
浏览文件 @
21a9169b
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
scene
=
new
THREE
.
Scene
();
scene
=
new
THREE
.
Scene
();
var
i
,
line
,
vertex1
,
vertex2
,
material
,
p
,
var
i
,
line
,
material
,
p
,
parameters
=
[
[
0.25
,
0xff7700
,
1
,
2
],
[
0.5
,
0xff9900
,
1
,
1
],
[
0.75
,
0xffaa00
,
0.75
,
1
],
[
1
,
0xffaa00
,
0.5
,
1
],
[
1.25
,
0x000833
,
0.8
,
1
],
parameters
=
[
[
0.25
,
0xff7700
,
1
,
2
],
[
0.5
,
0xff9900
,
1
,
1
],
[
0.75
,
0xffaa00
,
0.75
,
1
],
[
1
,
0xffaa00
,
0.5
,
1
],
[
1.25
,
0x000833
,
0.8
,
1
],
[
3.0
,
0xaaaaaa
,
0.75
,
2
],
[
3.5
,
0xffffff
,
0.5
,
1
],
[
4.5
,
0xffffff
,
0.25
,
1
],
[
5.5
,
0xffffff
,
0.125
,
1
]
];
[
3.0
,
0xaaaaaa
,
0.75
,
2
],
[
3.5
,
0xffffff
,
0.5
,
1
],
[
4.5
,
0xffffff
,
0.25
,
1
],
[
5.5
,
0xffffff
,
0.125
,
1
]
];
...
...
examples/webgl_materials_curvature.html
浏览文件 @
21a9169b
...
@@ -338,7 +338,7 @@
...
@@ -338,7 +338,7 @@
topologyFolder
.
add
(
params
,
'
filterConvex
'
);
topologyFolder
.
add
(
params
,
'
filterConvex
'
);
topologyFolder
.
add
(
params
,
'
filterConcave
'
);
topologyFolder
.
add
(
params
,
'
filterConcave
'
);
topologyFolder
.
add
(
params
,
'
filterBoth
'
);
topologyFolder
.
add
(
params
,
'
filterBoth
'
);
topologyFolder
.
open
()
topologyFolder
.
open
()
;
onWindowResize
();
onWindowResize
();
...
...
examples/webgl_materials_texture_rotation.html
浏览文件 @
21a9169b
...
@@ -154,8 +154,6 @@
...
@@ -154,8 +154,6 @@
function
initGui
()
{
function
initGui
()
{
var
drop
;
gui
=
new
dat
.
GUI
();
gui
=
new
dat
.
GUI
();
gui
.
add
(
API
,
'
offsetX
'
,
0.0
,
1.0
).
name
(
'
offset.x
'
).
onChange
(
updateUvTransform
);
gui
.
add
(
API
,
'
offsetX
'
,
0.0
,
1.0
).
name
(
'
offset.x
'
).
onChange
(
updateUvTransform
);
...
...
examples/webgl_octree.html
浏览文件 @
21a9169b
...
@@ -216,10 +216,6 @@
...
@@ -216,10 +216,6 @@
Math
.
random
()
*
radiusMax
-
radiusMaxHalf
Math
.
random
()
*
radiusMax
-
radiusMaxHalf
);
);
// record start time
var
timeStart
=
Date
.
now
();
// search octree from search mesh position with search radius
// search octree from search mesh position with search radius
// optional third parameter: boolean, if should sort results by object when using faces in octree
// optional third parameter: boolean, if should sort results by object when using faces in octree
// optional fourth parameter: vector3, direction of search when using ray (assumes radius is distance/far of ray)
// optional fourth parameter: vector3, direction of search when using ray (assumes radius is distance/far of ray)
...
@@ -228,11 +224,7 @@
...
@@ -228,11 +224,7 @@
direction
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
).
normalize
();
direction
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
).
normalize
();
rayCaster
.
set
(
origin
,
direction
);
rayCaster
.
set
(
origin
,
direction
);
meshesSearch
=
octree
.
search
(
rayCaster
.
ray
.
origin
,
radiusSearch
,
true
,
rayCaster
.
ray
.
direction
);
meshesSearch
=
octree
.
search
(
rayCaster
.
ray
.
origin
,
radiusSearch
,
true
,
rayCaster
.
ray
.
direction
);
var
intersections
=
rayCaster
.
intersectOctreeObjects
(
meshesSearch
);
rayCaster
.
intersectOctreeObjects
(
meshesSearch
);
// record end time
var
timeEnd
=
Date
.
now
();
// set color of all meshes found in search
// set color of all meshes found in search
...
@@ -242,15 +234,6 @@
...
@@ -242,15 +234,6 @@
}
}
/*
// results to console
console.log( 'OCTREE: ', octree );
console.log( '... searched ', meshes.length, ' and found ', meshesSearch.length, ' with intersections ', intersections.length, ' and took ', ( timeEnd - timeStart ), ' ms ' );
*/
}
}
function
render
()
{
function
render
()
{
...
...
examples/webgl_points_sprites.html
浏览文件 @
21a9169b
...
@@ -132,7 +132,7 @@
...
@@ -132,7 +132,7 @@
var
params
=
{
var
params
=
{
texture
:
true
texture
:
true
}
}
;
gui
.
add
(
params
,
'
texture
'
).
onChange
(
function
(
value
)
{
gui
.
add
(
params
,
'
texture
'
).
onChange
(
function
(
value
)
{
...
...
examples/webgl_postprocessing_nodes.html
浏览文件 @
21a9169b
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
gui
=
new
dat
.
GUI
();
gui
=
new
dat
.
GUI
();
var
example
=
gui
.
add
(
param
,
'
example
'
,
{
gui
.
add
(
param
,
'
example
'
,
{
'
basic / color-adjustment
'
:
'
color-adjustment
'
,
'
basic / color-adjustment
'
:
'
color-adjustment
'
,
'
basic / blends
'
:
'
blends
'
,
'
basic / blends
'
:
'
blends
'
,
'
basic / fade
'
:
'
fade
'
,
'
basic / fade
'
:
'
fade
'
,
...
@@ -312,7 +312,6 @@
...
@@ -312,7 +312,6 @@
var
normal
=
new
THREE
.
TextureNode
(
decalNormal
);
var
normal
=
new
THREE
.
TextureNode
(
decalNormal
);
var
normalXY
=
new
THREE
.
SwitchNode
(
normal
,
'
xy
'
);
var
normalXY
=
new
THREE
.
SwitchNode
(
normal
,
'
xy
'
);
var
scale
=
new
THREE
.
FloatNode
(
.
5
);
var
scale
=
new
THREE
.
FloatNode
(
.
5
);
var
flip
=
new
THREE
.
Vector2Node
(
-
1
,
1
);
var
normalXYFlip
=
new
THREE
.
Math1Node
(
var
normalXYFlip
=
new
THREE
.
Math1Node
(
normalXY
,
normalXY
,
...
...
examples/webgl_shaders_tonemapping.html
浏览文件 @
21a9169b
...
@@ -202,11 +202,11 @@
...
@@ -202,11 +202,11 @@
var
textureLoader
=
new
THREE
.
TextureLoader
();
var
textureLoader
=
new
THREE
.
TextureLoader
();
var
earthDiffuse
=
textureLoader
.
load
(
'
textures/planets/earth_atmos_4096.jpg
'
,
function
(
tex
)
{
textureLoader
.
load
(
'
textures/planets/earth_atmos_4096.jpg
'
,
function
(
tex
)
{
earthMat
.
map
=
tex
;
earthMat
.
map
=
tex
;
earthMat
.
needsUpdate
=
true
;
earthMat
.
needsUpdate
=
true
;
}
);
}
);
var
earthSpecular
=
textureLoader
.
load
(
'
textures/planets/earth_specular_2048.jpg
'
,
function
(
tex
)
{
textureLoader
.
load
(
'
textures/planets/earth_specular_2048.jpg
'
,
function
(
tex
)
{
earthMat
.
specularMap
=
tex
;
earthMat
.
specularMap
=
tex
;
earthMat
.
needsUpdate
=
true
;
earthMat
.
needsUpdate
=
true
;
}
);
}
);
...
@@ -235,7 +235,7 @@
...
@@ -235,7 +235,7 @@
depthTest
:
false
depthTest
:
false
}
);
}
);
var
earthClouds
=
textureLoader
.
load
(
'
textures/planets/earth_clouds_2048.png
'
,
function
(
tex
)
{
textureLoader
.
load
(
'
textures/planets/earth_clouds_2048.png
'
,
function
(
tex
)
{
earthCloudsMat
.
map
=
tex
;
earthCloudsMat
.
map
=
tex
;
earthCloudsMat
.
needsUpdate
=
true
;
earthCloudsMat
.
needsUpdate
=
true
;
}
);
}
);
...
...
examples/webgl_shading_physical.html
浏览文件 @
21a9169b
...
@@ -112,18 +112,6 @@
...
@@ -112,18 +112,6 @@
textureLava
.
wrapS
=
textureLava
.
wrapT
=
THREE
.
RepeatWrapping
;
textureLava
.
wrapS
=
textureLava
.
wrapT
=
THREE
.
RepeatWrapping
;
textureLava
.
format
=
THREE
.
RGBFormat
;
textureLava
.
format
=
THREE
.
RGBFormat
;
//
var
path
=
"
textures/cube/SwedishRoyalCastle/
"
;
var
format
=
'
.jpg
'
;
var
urls
=
[
path
+
'
px
'
+
format
,
path
+
'
nx
'
+
format
,
path
+
'
py
'
+
format
,
path
+
'
ny
'
+
format
,
path
+
'
pz
'
+
format
,
path
+
'
nz
'
+
format
];
var
reflectionCube
=
new
THREE
.
CubeTextureLoader
().
load
(
urls
);
// GROUND
// GROUND
var
groundMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
var
groundMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
examples/webgl_terrain_dynamic.html
浏览文件 @
21a9169b
...
@@ -466,8 +466,6 @@
...
@@ -466,8 +466,6 @@
if
(
terrain
.
visible
)
{
if
(
terrain
.
visible
)
{
var
time
=
Date
.
now
()
*
0.001
;
var
fLow
=
0.1
,
fHigh
=
0.8
;
var
fLow
=
0.1
,
fHigh
=
0.8
;
lightVal
=
THREE
.
Math
.
clamp
(
lightVal
+
0.5
*
delta
*
lightDir
,
fLow
,
fHigh
);
lightVal
=
THREE
.
Math
.
clamp
(
lightVal
+
0.5
*
delta
*
lightDir
,
fLow
,
fHigh
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录