Hi,
Following Visualize Mesh Features and Metadata – Cesium, I can get metadata of single building such as FeatureID, Height. Based on this information, I tried to change color(or material) of single building hit by line traced. When simply using Set Material function, entire tile’s color changed even not hit buildings. Is it possible to change single building’s material in tileset?
Hi @netcus11,
We actually have a sample level where we have implemented this behavior! Check out Level 14 in the Cesium for Unreal Samples, which highlights the parts of models that you click on. Feel free to borrow the materials / Blueprints for your own apps.
Let us know if you have any follow-up questions!
Thank you! I checked Cesium for Unreal Samples Level14, and it works!
But I have another issue.
Collided buildings are highlighted, but some buildings are not. It seems that in each b3dm file, only the first building that collides is judged to be collided and change material. The building right behind the colored building does not even get collided. Is it possible to change material of all collided buildings?
Hi @netcus11,
I believe this is a limitation of the ML_CesiumHighlightFeatureID in the sample. It is set up to only highlight a single feature ID, specified by the SelectedFeatureID material parameter, which is a simple scalar.
In order to highlight multiple features in a single tile, this will need to work differently. I don’t know of any easy and fully-general solution here, though.
If you only ever need to highlight at most four features per tile, you might consider making the SelectedFeatureID a Vector instead of a Scalar, and check each feature ID after all four components of the vector.
If more are needed, it could get a lot more complicated. You could probably use a 1D texture to store all of the features IDs.