Change color of highlighted entity vs 3DTileset feature

I have implemented the highlighting for 3D tilesets and entities. The color used for the highlighting is Cesium.Color.RED, but it appears different when appliet to an entity (brighter)
and when applied to a 3DTile feature (darker)

image
image

Sandcastle here

What am I missing?

Hi @mioruggieroguida,

It looks like the entity is not lit by the sun, so its appearance stays the same regardless of the time of day. On the other hand, the OSM buildings are lit by the sun, so they will look darker because of the shadows. That would explain the color difference between the two.

Hi @janine,

Not sure I understand what you mean. It also happens for buildings next to the entity shown.

Hi @mioruggieroguida,

What I mean is that the entity is lit differently than the buildings around it. The buildings around it are rendered with a physically-based lighting model, as defined by the glTF 2.0 spec. They have a more metallic material, so they appear grayer. They are also affected by the direction of the sun.

To illustrate this, I have a gif where I angled the camera / light such that it would light the buildings more brightly. When highlighted, the brighter buildings are closer in color to the entity.
color

On the other hand, the entity is not shaded by the sun, and does not use PBR. So it will naturally display color differently. Does that make more sense?

Got it now. Thanks for the explanation.

Is there a way to either use PBR for entities or flat colors for OSM features? I would rather have both behave in the same way. Thanks!

@janine @Kevin_Ring @omar Is there a way to disable physics-based rendering for the OSM building tileset?
Merely changing the position of the sun as shown in OSM buildings lightning does not work.
Alternatively, could you give an example of how to apply the material of OSM buildings to a Cesium Entity, such that the entity would display the same color/shadow behavior as an OSM building?