提交 cace4146 编写于 作者: D Don McCurdy

Add lights to duck example for good measure.

上级 17a7749b
......@@ -310,8 +310,7 @@ THREE.GLTF2Loader = ( function () {
var light = lights[ lightId ];
var lightNode;
var lightParams = light[ light.type ];
var color = new THREE.Color().fromArray( lightParams.color );
var color = new THREE.Color().fromArray( light.color );
switch ( light.type ) {
......@@ -337,6 +336,7 @@ THREE.GLTF2Loader = ( function () {
if ( lightNode ) {
lightNode.name = light.name || ( 'light_' + lightId );
this.lights[ lightId ] = lightNode;
}
......
......@@ -141,11 +141,47 @@
"type" : "perspective"
}
],
"extensions" : {
"KHR_lights" : {
"lights" : [
{
"color" : [
1.0,
1.0,
1.0
],
"name" : "directionalLightShape1",
"type" : "directional"
},
{
"color" : [
1.0,
1.0,
1.0
],
"name" : "Lamp",
"quadraticAttenuation" : 0.03333335240683057,
"type" : "point"
},
{
"color" : [
0.0,
0.0,
0.0
],
"name" : "Ambient_Scene",
"type" : "ambient"
}
]
}
},
"extensionsRequired" : [
"KHR_materials_common"
"KHR_materials_common",
"KHR_lights"
],
"extensionsUsed" : [
"KHR_materials_common"
"KHR_materials_common",
"KHR_lights"
],
"images" : [
{
......@@ -266,6 +302,23 @@
]
},
{
"extensions" : {
"KHR_lights" : {
"light" : 0
}
},
"name" : "Correction_directionalLight1",
"rotation" : [
-0.7071067690849304,
-0.0,
0.0,
0.7071067690849304
]
},
{
"children" : [
4
],
"name" : "directionalLight1",
"rotation" : [
0.14142043888568878,
......@@ -285,6 +338,23 @@
]
},
{
"extensions" : {
"KHR_lights" : {
"light" : 1
}
},
"name" : "Correction_Lamp",
"rotation" : [
-0.7071067690849304,
-0.0,
0.0,
0.7071067690849304
]
},
{
"children" : [
6
],
"name" : "Lamp",
"rotation" : [
0.16907575726509094,
......@@ -325,12 +395,17 @@
"scene" : 0,
"scenes" : [
{
"extensions" : {
"KHR_lights" : {
"light" : 2
}
},
"name" : "Scene",
"nodes" : [
4,
3,
6,
5,
3,
8,
7,
1
]
}
......
......@@ -437,8 +437,8 @@
addLights:true,
addGround:true,
shadows:true,
// TODO: 'glTF-MaterialsCommon', 'glTF-techniqueWebGL'
extensions: ['glTF', 'glTF-Embedded', 'glTF-pbrSpecularGlossiness', 'glTF-Binary']
// TODO: 'glTF-techniqueWebGL'
extensions: ['glTF', 'glTF-Embedded', 'glTF-MaterialsCommon', 'glTF-pbrSpecularGlossiness', 'glTF-Binary']
},
{
name : "Monster", url : "./models/gltf/Monster/%s/Monster.gltf",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册