How to set lighting for cessium 3d-tile

I use 3d-tiles branch load my 3d model, which from osgb convert to b3dm , loading no problem,but when I rotate the model, when I go to a certain angle, the whole model is black, I have turned off the shadow of the scene, there is no sun effect, but still not normal. I hope you give me some guidance and help, thanks!



​like this

It could be that the model doesn’t have any ambient lighting and so looks very dark when facing away from the sun. Could you post your b3dm’s?

FYI, the ambient light source created by gltf-pipeline is only 20% intensity, so converted models have 1/5 of the ambient light they’re supposed to have. This seems like a bug to me, but I haven’t gotten around to raising it for discussion yet. Here’s the line that does it:
https://github.com/AnalyticalGraphicsInc/gltf-pipeline/blob/5d67b171d206107a72050f7055324b9954f7c0b1/lib/processModelMaterialsCommon.js#L421

I actually just noticed this yesterday as well.

I not use gltf-pipeline to convert gltf, my data conversion process is osgb->collada(use osgconv)collada->gltf (use COLLADA2GLTF-1.0) , and I never use gltf-pipeline , now I need use it? Thanks

You don’t need to use gltf-pipeline. However you may want to edit the gltf’s materials to add more ambient color. I think your model would look best without any normals and just flat lighting - however I’d need to see the dae to give better advice there.

在 2017年2月10日星期五 UTC+8下午3:18:04,yangb...@gmail.com写道:

I use 3d-tiles branch load my 3d model, which from osgb convert to b3dm , loading no problem,but when I rotate the model, when I go to a certain angle, the whole model is black, I have turned off the shadow of the scene, there is no sun effect, but still not normal. I hope you give me some guidance and help, thanks!

杨老师您好,能不能给说一下OSGB->B3DM的工具,真心感谢!

You may need to increase the ambient lighting or edit the shader (assuming this is a glTF 1 model inside the b3dm). Could you upload the b3dm so I can see?

在 2017年2月10日星期五 UTC+8下午3:18:04,yangb...@gmail.com写道:

I use 3d-tiles branch load my 3d model, which from osgb convert to b3dm , loading no problem,but when I rotate the model, when I go to a certain angle, the whole model is black, I have turned off the shadow of the scene, there is no sun effect, but still not normal. I hope you give me some guidance and help, thanks!

Can you tell me a tool to convert osgb to b3dm?Thank you!

I’m not aware of any tools, sorry…

Hi I have quite the same problem,

I generate 3d tiles, with following pipeline:

obj-> gltf -> b3dm

obj and gltf looks lighted properly and b3dm are completely black.

Here is the obj mtl

newmtl BUILDING_DEFAULT_0
Ns 92.156863
Ka 0.5019608 0.4509804 0.27450982
Kd 0.5019608 0.4509804 0.27450982
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1
illum 2

for gltf -> b3dm I use gltf-pipeline what can I do with that, any work around to get lighting work the same way as with gltf?

Can't attach b3dm via groups interface.

Hey Dmitry, could you upload the obj/gltf/b3dm files to google drive or dropbox?

Here are the gltf and b3dm https://drive.google.com/open?id=1cG_ngUksx0iXr-xclCEE_FvzIy2PD7Ut

Unfortunately you are running into this bug: https://github.com/AnalyticalGraphicsInc/cesium/issues/5838

Since the glTF doesn’t have normals it is not getting shaded correctly. Eventually we plan on auto-generating normals when they are missing, but in the meantime you may need to add normals to your obj file, if possible.

Ah, ok, thanks. Adding normals shouldn’t be hard.

The shading bug was fixed in https://github.com/AnalyticalGraphicsInc/cesium/issues/5838 and will be in the Cesium 1.45. You no longer need to add normals to the model.

That’s great,
thanks for the update and fix!