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 @@
function
generateTexture
(
data
,
width
,
height
)
{
var
canvas
,
context
,
image
,
imageData
,
level
,
diff
,
vector3
,
sun
,
shade
;
var
canvas
,
context
,
image
,
imageData
,
vector3
,
sun
,
shade
;
vector3
=
new
THREE
.
Vector3
(
0
,
0
,
0
);
...
...
examples/canvas_interactive_voxelpainter.html
浏览文件 @
21a9169b
...
...
@@ -74,8 +74,6 @@
objects
.
push
(
plane
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xff0000
,
wireframe
:
true
}
);
// Lights
var
ambientLight
=
new
THREE
.
AmbientLight
(
0x606060
);
...
...
examples/canvas_lines_sphere.html
浏览文件 @
21a9169b
...
...
@@ -33,10 +33,6 @@
windowHalfX
=
window
.
innerWidth
/
2
,
windowHalfY
=
window
.
innerHeight
/
2
,
SEPARATION
=
200
,
AMOUNTX
=
10
,
AMOUNTY
=
10
,
camera
,
scene
,
renderer
;
init
();
...
...
@@ -44,7 +40,7 @@
function
init
()
{
var
container
,
separation
=
100
,
amountX
=
50
,
amountY
=
50
,
particles
,
particle
;
var
container
,
particle
;
container
=
document
.
createElement
(
'
div
'
);
document
.
body
.
appendChild
(
container
);
...
...
examples/js/postprocessing/SSAOPass.js
浏览文件 @
21a9169b
...
...
@@ -21,7 +21,7 @@
*/
THREE
.
SSAOPass
=
function
(
scene
,
camera
,
width
,
height
)
{
if
(
THREE
.
SSAOShader
===
undefined
)
{
if
(
THREE
.
SSAOShader
===
undefined
)
{
console
.
warn
(
'
THREE.SSAOPass depends on THREE.SSAOShader
'
);
return
new
THREE
.
ShaderPass
();
...
...
@@ -59,31 +59,64 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
this
.
uniforms
[
'
lumInfluence
'
].
value
=
0.7
;
//Setters and getters for uniforms
var
self
=
this
;
Object
.
defineProperties
(
this
,
{
Object
.
defineProperties
(
this
,
{
radius
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
radius
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
radius
'
].
value
=
value
;
}
get
:
function
()
{
return
this
.
uniforms
[
'
radius
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
radius
'
].
value
=
value
;
}
},
onlyAO
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
onlyAO
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
onlyAO
'
].
value
=
value
;
}
get
:
function
()
{
return
this
.
uniforms
[
'
onlyAO
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
onlyAO
'
].
value
=
value
;
}
},
aoClamp
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
aoClamp
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
aoClamp
'
].
value
=
value
;
}
get
:
function
()
{
return
this
.
uniforms
[
'
aoClamp
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
aoClamp
'
].
value
=
value
;
}
},
lumInfluence
:
{
get
:
function
()
{
return
this
.
uniforms
[
'
lumInfluence
'
].
value
;
},
set
:
function
(
value
)
{
this
.
uniforms
[
'
lumInfluence
'
].
value
=
value
;
}
get
:
function
()
{
return
this
.
uniforms
[
'
lumInfluence
'
].
value
;
},
set
:
function
(
value
)
{
});
}
this
.
uniforms
[
'
lumInfluence
'
].
value
=
value
;
}
},
}
);
};
THREE
.
SSAOPass
.
prototype
=
Object
.
create
(
THREE
.
ShaderPass
.
prototype
);
...
...
@@ -97,7 +130,7 @@ THREE.SSAOPass.prototype = Object.create( THREE.ShaderPass.prototype );
* @param {Number} delta Delta time in milliseconds.
* @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
this
.
scene2
.
overrideMaterial
=
this
.
depthMaterial
;
...
...
@@ -118,7 +151,7 @@ THREE.SSAOPass.prototype.render = function( renderer, writeBuffer, readBuffer, d
* @method setScene
* @param {Scene} scene
*/
THREE
.
SSAOPass
.
prototype
.
setScene
=
function
(
scene
)
{
THREE
.
SSAOPass
.
prototype
.
setScene
=
function
(
scene
)
{
this
.
scene2
=
scene
;
...
...
@@ -130,7 +163,7 @@ THREE.SSAOPass.prototype.setScene = function(scene) {
* @method setCamera
* @param {Camera} camera
*/
THREE
.
SSAOPass
.
prototype
.
setCamera
=
function
(
camera
)
{
THREE
.
SSAOPass
.
prototype
.
setCamera
=
function
(
camera
)
{
this
.
camera2
=
camera
;
...
...
@@ -146,7 +179,7 @@ THREE.SSAOPass.prototype.setCamera = function( camera ) {
* @param {Number} width
* @param {Number} height
*/
THREE
.
SSAOPass
.
prototype
.
setSize
=
function
(
width
,
height
)
{
THREE
.
SSAOPass
.
prototype
.
setSize
=
function
(
width
,
height
)
{
this
.
width
=
width
;
this
.
height
=
height
;
...
...
examples/webgl_buffergeometry_instancing.html
浏览文件 @
21a9169b
...
...
@@ -129,7 +129,6 @@
var
vector
=
new
THREE
.
Vector4
();
var
triangles
=
1
;
var
instances
=
50000
;
var
positions
=
[];
...
...
examples/webgl_geometries.html
浏览文件 @
21a9169b
...
...
@@ -53,7 +53,7 @@
scene
=
new
THREE
.
Scene
();
var
light
,
object
;
var
object
;
var
ambientLight
=
new
THREE
.
AmbientLight
(
0xcccccc
,
0.4
);
scene
.
add
(
ambientLight
);
...
...
examples/webgl_geometry_minecraft_ao.html
浏览文件 @
21a9169b
...
...
@@ -160,7 +160,6 @@
//
var
geometry
=
new
THREE
.
Geometry
();
var
dummy
=
new
THREE
.
Mesh
();
for
(
var
z
=
0
;
z
<
worldDepth
;
z
++
)
{
...
...
examples/webgl_lights_pointlights2.html
浏览文件 @
21a9169b
...
...
@@ -217,7 +217,7 @@
function
render
()
{
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
.
z
=
Math
.
cos
(
time
*
0.3
)
*
d
;
...
...
examples/webgl_lines_sphere.html
浏览文件 @
21a9169b
...
...
@@ -74,7 +74,7 @@
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
],
[
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 @@
topologyFolder
.
add
(
params
,
'
filterConvex
'
);
topologyFolder
.
add
(
params
,
'
filterConcave
'
);
topologyFolder
.
add
(
params
,
'
filterBoth
'
);
topologyFolder
.
open
()
topologyFolder
.
open
()
;
onWindowResize
();
...
...
examples/webgl_materials_texture_rotation.html
浏览文件 @
21a9169b
...
...
@@ -154,8 +154,6 @@
function
initGui
()
{
var
drop
;
gui
=
new
dat
.
GUI
();
gui
.
add
(
API
,
'
offsetX
'
,
0.0
,
1.0
).
name
(
'
offset.x
'
).
onChange
(
updateUvTransform
);
...
...
examples/webgl_octree.html
浏览文件 @
21a9169b
...
...
@@ -216,10 +216,6 @@
Math
.
random
()
*
radiusMax
-
radiusMaxHalf
);
// record start time
var
timeStart
=
Date
.
now
();
// 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 fourth parameter: vector3, direction of search when using ray (assumes radius is distance/far of ray)
...
...
@@ -228,11 +224,7 @@
direction
.
set
(
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
,
Math
.
random
()
*
2
-
1
).
normalize
();
rayCaster
.
set
(
origin
,
direction
);
meshesSearch
=
octree
.
search
(
rayCaster
.
ray
.
origin
,
radiusSearch
,
true
,
rayCaster
.
ray
.
direction
);
var
intersections
=
rayCaster
.
intersectOctreeObjects
(
meshesSearch
);
// record end time
var
timeEnd
=
Date
.
now
();
rayCaster
.
intersectOctreeObjects
(
meshesSearch
);
// set color of all meshes found in search
...
...
@@ -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
()
{
...
...
examples/webgl_points_sprites.html
浏览文件 @
21a9169b
...
...
@@ -132,7 +132,7 @@
var
params
=
{
texture
:
true
}
}
;
gui
.
add
(
params
,
'
texture
'
).
onChange
(
function
(
value
)
{
...
...
examples/webgl_postprocessing_nodes.html
浏览文件 @
21a9169b
...
...
@@ -65,7 +65,7 @@
gui
=
new
dat
.
GUI
();
var
example
=
gui
.
add
(
param
,
'
example
'
,
{
gui
.
add
(
param
,
'
example
'
,
{
'
basic / color-adjustment
'
:
'
color-adjustment
'
,
'
basic / blends
'
:
'
blends
'
,
'
basic / fade
'
:
'
fade
'
,
...
...
@@ -312,7 +312,6 @@
var
normal
=
new
THREE
.
TextureNode
(
decalNormal
);
var
normalXY
=
new
THREE
.
SwitchNode
(
normal
,
'
xy
'
);
var
scale
=
new
THREE
.
FloatNode
(
.
5
);
var
flip
=
new
THREE
.
Vector2Node
(
-
1
,
1
);
var
normalXYFlip
=
new
THREE
.
Math1Node
(
normalXY
,
...
...
examples/webgl_shaders_tonemapping.html
浏览文件 @
21a9169b
...
...
@@ -202,11 +202,11 @@
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
.
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
.
needsUpdate
=
true
;
}
);
...
...
@@ -235,7 +235,7 @@
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
.
needsUpdate
=
true
;
}
);
...
...
examples/webgl_shading_physical.html
浏览文件 @
21a9169b
...
...
@@ -112,18 +112,6 @@
textureLava
.
wrapS
=
textureLava
.
wrapT
=
THREE
.
RepeatWrapping
;
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
var
groundMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
examples/webgl_terrain_dynamic.html
浏览文件 @
21a9169b
...
...
@@ -466,8 +466,6 @@
if
(
terrain
.
visible
)
{
var
time
=
Date
.
now
()
*
0.001
;
var
fLow
=
0.1
,
fHigh
=
0.8
;
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录