Skip to main content

Hi

Is there any convenient way to modify the material definiton for the batched 3d models when using cesium 3d tiles writer?

I'm creating b3dm from CityGML and viewing them in the Cesium app in a browser. My problem is that some of the facades look too dark because of the shading according to the position of the sun. I read that setting some of the material settings of the gLTF, so that any shading from light source is flat, should solve the problem and make the building equally bright on each surface.

It would be awesome if one could define these material/appearance settings as parameter values in the cesium 3d tiles writer.

 

Hi @jerez,

 

 

I've been playing around with the AppearanceExtractor and AppearanceSetter, however, I've got mixed results - https://knowledge.safe.com/questions/81028/3dtiles-gltf-reflective-surfaces.html

 

 

One thing to check as well is to make sure all the surfaces contain proper Surface Normals. The GometryValidator should help you fix that if they don't.

 

 

Also in FME 2019.0 Safe have added a CesiumIonConnector transformer which performs a conversion from CityGML to b3bd. I haven't tried it but I suspect you'll get the output your expecting using Cesiums converter.

 

 

It looks like the CesiumIon account is free to use for Personal, Educational or Development work.

Hi @jerez,

 

 

I've been playing around with the AppearanceExtractor and AppearanceSetter, however, I've got mixed results - https://knowledge.safe.com/questions/81028/3dtiles-gltf-reflective-surfaces.html

 

 

One thing to check as well is to make sure all the surfaces contain proper Surface Normals. The GometryValidator should help you fix that if they don't.

 

 

Also in FME 2019.0 Safe have added a CesiumIonConnector transformer which performs a conversion from CityGML to b3bd. I haven't tried it but I suspect you'll get the output your expecting using Cesiums converter.

 

 

It looks like the CesiumIon account is free to use for Personal, Educational or Development work.

Thanks for answering, ill give a try to what you proposed.

in order to do flat shading, the surface normals should be what, zero?

I forgot to mention but i have textures also applied to my buildings. Do you know if this is affecting in any way?


Thanks for answering, ill give a try to what you proposed.

in order to do flat shading, the surface normals should be what, zero?

I forgot to mention but i have textures also applied to my buildings. Do you know if this is affecting in any way?

I'm not sure about the 'flat shading', I would suggest they just have the standard length of 1. I only mention this because in the past I had a number of veeery dark b3dm tile outputs which were almost black. After applying surface normals the appearance looked better. The building still reacted to the light source, however, so you might still see the same problem.

 

For testing and experimenting I would suggest using a single model and write out instead to glTF (2.0) with FME. That will let you see which changed values in FME go into the model.

 

Here's the specification so you can see what each of the properties mean

 

https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials

 

 


Hi @jerez,

 

 

I've been playing around with the AppearanceExtractor and AppearanceSetter, however, I've got mixed results - https://knowledge.safe.com/questions/81028/3dtiles-gltf-reflective-surfaces.html

 

 

One thing to check as well is to make sure all the surfaces contain proper Surface Normals. The GometryValidator should help you fix that if they don't.

 

 

Also in FME 2019.0 Safe have added a CesiumIonConnector transformer which performs a conversion from CityGML to b3bd. I haven't tried it but I suspect you'll get the output your expecting using Cesiums converter.

 

 

It looks like the CesiumIon account is free to use for Personal, Educational or Development work.

I think i've understood the concept of 'flat shading' wrong.

I just want my building models to ignore the sun in Cesium what it comes to shading. My dataset is geographically set to quite north, so the sun does not really shine or light the models for half of the year.

I've been testing with one building, but i have not achieved any progress so far.

Specifically could you explain what you did with AppearanceExtractor and AppearanceSetter?

thanks in advance


I think i've understood the concept of 'flat shading' wrong.

I just want my building models to ignore the sun in Cesium what it comes to shading. My dataset is geographically set to quite north, so the sun does not really shine or light the models for half of the year.

I've been testing with one building, but i have not achieved any progress so far.

Specifically could you explain what you did with AppearanceExtractor and AppearanceSetter?

thanks in advance

Ah I see, interesting problem!

 

 

I wonder perhaps if there's a way to configure the layer as a whole in cesium then to ignore the lighting. I'll have a chat with out WebDev team tomorrow see if they know a way in Cesium.

 

 

For the AppeanceExtractor and Setter (or maybe the AppearenceStyler was what I was using) I was just trying to see which of the surface effectcs changed what in the glTF. I was adjusting the Diffuse, Speculative values of the appearance. I'm not sure though if this works on textured surfaces though.

 

 

I think I was able to effect the 'roughness' factor with one of the Appearence styles but what I really wanted was to set the metallic value to 0.

Ah I see, interesting problem!

 

 

I wonder perhaps if there's a way to configure the layer as a whole in cesium then to ignore the lighting. I'll have a chat with out WebDev team tomorrow see if they know a way in Cesium.

 

 

For the AppeanceExtractor and Setter (or maybe the AppearenceStyler was what I was using) I was just trying to see which of the surface effectcs changed what in the glTF. I was adjusting the Diffuse, Speculative values of the appearance. I'm not sure though if this works on textured surfaces though.

 

 

I think I was able to effect the 'roughness' factor with one of the Appearence styles but what I really wanted was to set the metallic value to 0.

I haven't yet found any way in cesium to switch lighting or shading off. I was able to do some changes by setting x3dmaterial settings in the source citygml file. Yet it didn't have any effect on the shading if the model had textures. Without textures, i was able to "unshade" the model.

i guess it is possible to set shading in cesium to cesium geometries, but for 3d tileset it seems that there is no way. I also tried with the newest version of Cesium which has some new properties that has something to do with lighting, but i didn't get any result.

Please let me know if your team knows any way. Even just brighter model (without manipulating the actual texture images) would be great.


I haven't yet found any way in cesium to switch lighting or shading off. I was able to do some changes by setting x3dmaterial settings in the source citygml file. Yet it didn't have any effect on the shading if the model had textures. Without textures, i was able to "unshade" the model.

i guess it is possible to set shading in cesium to cesium geometries, but for 3d tileset it seems that there is no way. I also tried with the newest version of Cesium which has some new properties that has something to do with lighting, but i didn't get any result.

Please let me know if your team knows any way. Even just brighter model (without manipulating the actual texture images) would be great.

So as you've found they said also that that is a little complicated, which you think would be easy thing to configure....

One thing they did mention is that they configure the clock so that the time of day is always during the data when the scene is first rendered. It should also be possible to configure the date to a Summer day when you have mostly daylight.

 

I think they use this function to simulate the time: https://cesiumjs.org/Cesium/Build/Documentation/Clock.html

 

Does this sound like a solution?

 

 


Reply