Skip to main content

How can I fix the texture that the 3D-tiles writer puts out? When converting from obj(including .png and .mlt) to 3D tiles, the writer makes the texture very dark when they are being viewed in Cesium. There is no problem converting to kmz, the textures is perfect there but we need to use 3D-tiles for its streaming capabilities.

KMZ: KMZ building perfect texture3D-Tiles:

3D-tiles, extremly dark texture 

 

I have read multiple posts on FME forum and on Cesium forum:

including this idea: https://community.safe.com/s/bridea/a0r4Q00000Hbqi5QAB/options-to-choose-and-set-gltf-appearance-settings-in-cesium-3d-tiles-writer

 

https://community.cesium.com/t/how-to-set-lighting-for-cessium-3d-tile/5140

 

https://community.safe.com/s/question/0D54Q00009cNpu2SAC/i-want-to-create-textured-models-to-cesium-3d-tiles-from-obj-files

 

And more posts.

Does anyone have an idea how to fix this issue?

Right now I use this, this helps to fix a transparent issue I faced before.

imageHere is the .mlt from the obj if it helps:

newmtl Solid

Ka 1.0 1.0 1.0

Kd 1.0 1.0 1.0

Ks 0.0 0.0 0.0

d 1.0

Ns 0.0

illum 0

 

newmtl 27

Ka 1.0 1.0 1.0

Kd 1.0 1.0 1.0

Ks 0.0 0.0 0.0

d 1.0

Ns 0.0

illum 0

map_Kd 27.png

 

newmtl 271

Ka 1.0 1.0 1.0

Kd 1.0 1.0 1.0

Ks 0.0 0.0 0.0

d 1.0

Ns 0.0

illum 0

map_Kd 271.png

 

I feel this is a well know format these days so this should not be an issue..

 

Thanks

A

Hello @albnas​, thanks for posting! Does the OBJ/Cesium output look as expected in the FME Data Inspector? If so, it may be worth checking what time you are viewing the model in Cesium, as I think Cesium defaults to local time for sun model (eg. if you're looking at data far away from your location, you may just have to adjust the time to daytime, it may be night time). Please feel free to reach out with an update if this does not help resolve the issue! Also, it might be helpful if you can share a logfile? Happy to help, Kailin.


Hello @kailinatsafe​ , thanks for replying. I'm familiar with cesiumjs. In this case, the local time and daytime/ night time is not the cause. It seems to be the 3D-tiles writer in FME that changes metallicfactor to 1 when it should be 0. MetallicFactor lies under prbMetallicRoughness within materials propertie (glb/gltf), I'm sure you know. It would be well appreciated if you guys at FME exposed the metallicFactor in the writer so the user could set the desired value(more people are requesting this feature).

 

I'm now using a temporary workaround that the guys from Cesium helped with.

Check this thread for more information: https://community.cesium.com/t/3d-tiles-get-very-dark-textures/26323/17


Hello @kailinatsafe​ , thanks for replying. I'm familiar with cesiumjs. In this case, the local time and daytime/ night time is not the cause. It seems to be the 3D-tiles writer in FME that changes metallicfactor to 1 when it should be 0. MetallicFactor lies under prbMetallicRoughness within materials propertie (glb/gltf), I'm sure you know. It would be well appreciated if you guys at FME exposed the metallicFactor in the writer so the user could set the desired value(more people are requesting this feature).

 

I'm now using a temporary workaround that the guys from Cesium helped with.

Check this thread for more information: https://community.cesium.com/t/3d-tiles-get-very-dark-textures/26323/17

Hey thanks @albnas​, I'll take a look at the Cesium help thread, appreciate you sharing! If cesium support helped you make a workaround, I might suggest using that method as it will likely suit your data best.

 

Otherwise, it looks like you're already using the RGBBrightnessContrastAdjuster, which is what was suggested on another thread. If you're not happy with the results of the current workaround, you could also try Dmitri's suggestion here (eg. AppearanceExtractor/AppearanceStyler/AppearanceSetter), but there's a note about using this method with many textures.

 

I suspect the illumination information is not being read into FME and therefore not translated or resulting to a default value on output, as I don't believe we support illumination models as of yet. A logfile might help confirm this. Also, I think KML/KMZ uses a normal color model which is why we don't see these issues. Best, Kailin.


Hey thanks @albnas​, I'll take a look at the Cesium help thread, appreciate you sharing! If cesium support helped you make a workaround, I might suggest using that method as it will likely suit your data best.

 

Otherwise, it looks like you're already using the RGBBrightnessContrastAdjuster, which is what was suggested on another thread. If you're not happy with the results of the current workaround, you could also try Dmitri's suggestion here (eg. AppearanceExtractor/AppearanceStyler/AppearanceSetter), but there's a note about using this method with many textures.

 

I suspect the illumination information is not being read into FME and therefore not translated or resulting to a default value on output, as I don't believe we support illumination models as of yet. A logfile might help confirm this. Also, I think KML/KMZ uses a normal color model which is why we don't see these issues. Best, Kailin.

Hey @kailinatsafe​ I will take a look at Dmitri's suggestion, I'll also try to provide a logfile for you guys. Do you have any plans for implementing support for illumination models in the near future?

Thanks.


Hey thanks @albnas​, I'll take a look at the Cesium help thread, appreciate you sharing! If cesium support helped you make a workaround, I might suggest using that method as it will likely suit your data best.

 

Otherwise, it looks like you're already using the RGBBrightnessContrastAdjuster, which is what was suggested on another thread. If you're not happy with the results of the current workaround, you could also try Dmitri's suggestion here (eg. AppearanceExtractor/AppearanceStyler/AppearanceSetter), but there's a note about using this method with many textures.

 

I suspect the illumination information is not being read into FME and therefore not translated or resulting to a default value on output, as I don't believe we support illumination models as of yet. A logfile might help confirm this. Also, I think KML/KMZ uses a normal color model which is why we don't see these issues. Best, Kailin.

Hello @albnas​, thanks for responding! We do have an open ticket for adding illumination model support to FME - FMEENGINE-15899 - but unfortunately no timeline adopted as of yet. On an aside, I haven't seen an FME idea for this as of yet, perhaps you could create one and share it here for others to stumble upon? Best, Kailin.


Hey @kailinatsafe​ , It seems like Dimitri's suggestion should work but I have tried it and everything gets rejected in the AppearanceSetter. May I ask if you could provid an example workspace with propper configuration?

 

Thanks.


Hey @kailinatsafe​ , It seems like Dimitri's suggestion should work but I have tried it and everything gets rejected in the AppearanceSetter. May I ask if you could provid an example workspace with propper configuration?

 

Thanks.

Hi @albnas​ ,

 

I am attaching the template that creates three identical objects, and sets different specular color and shininess on them. Here is how the output looks like in Cesium:

 

CesiumQuestionYou can also check this link:

https://ion.cesium.com/stories/viewer/?id=0ebacd2f-d9fd-4d01-9be4-c3d52a18b7af

 

If you have questions about the necessary settings in AppearanceSetter, feel free to talk to me.

 

Dmitri


Hi @albnas​ ,

 

I am attaching the template that creates three identical objects, and sets different specular color and shininess on them. Here is how the output looks like in Cesium:

 

CesiumQuestionYou can also check this link:

https://ion.cesium.com/stories/viewer/?id=0ebacd2f-d9fd-4d01-9be4-c3d52a18b7af

 

If you have questions about the necessary settings in AppearanceSetter, feel free to talk to me.

 

Dmitri

Hi @dmitribagh​ ,

Thanks for taking the time to reply!

I've tried your approach but I can't get it to work. Would it be possible for me to mail you 5 buildings or so, for you to take a look at and see if you can manage to modify the texturest?

 

I would prefere to fix the materials in FME rather than in cmd with the cesium teams workaround.

 

Thanks


Hi @albnas​ ,

 

I am attaching the template that creates three identical objects, and sets different specular color and shininess on them. Here is how the output looks like in Cesium:

 

CesiumQuestionYou can also check this link:

https://ion.cesium.com/stories/viewer/?id=0ebacd2f-d9fd-4d01-9be4-c3d52a18b7af

 

If you have questions about the necessary settings in AppearanceSetter, feel free to talk to me.

 

Dmitri

Hi @albnas​ 

Absolutely, feel free to send me your dataset. If the problem really connected to specular color/shininess, it should be easy to fix. If this is something different, I can investigate.

 

dmitri@safe.com

 

Dmitri


Hi @albnas​ ,

 

I am attaching the template that creates three identical objects, and sets different specular color and shininess on them. Here is how the output looks like in Cesium:

 

CesiumQuestionYou can also check this link:

https://ion.cesium.com/stories/viewer/?id=0ebacd2f-d9fd-4d01-9be4-c3d52a18b7af

 

If you have questions about the necessary settings in AppearanceSetter, feel free to talk to me.

 

Dmitri

Hi @dmitribagh​ 

I have sent you an e-mail now. Thanks for the help.


Hi @albnas​ ,

 

I am attaching the template that creates three identical objects, and sets different specular color and shininess on them. Here is how the output looks like in Cesium:

 

CesiumQuestionYou can also check this link:

https://ion.cesium.com/stories/viewer/?id=0ebacd2f-d9fd-4d01-9be4-c3d52a18b7af

 

If you have questions about the necessary settings in AppearanceSetter, feel free to talk to me.

 

Dmitri

Hi @albnas​ 

I sent you the workspace, but here is the copy. Yes, the problem was in specular color. We can either remove it entirely (slightly darker output) or set it to 1. I don't see shininess playing a role here, but maybe it needs colors, not textures to be shown more prominently.

CesiumDmitri


Reply