Dynamically setting the ImageMaterialPropertyrepeat property

I’m creating an entity with a polygon with a ImageMaterialProperty. I want to set the repeat property based upon the polygons rendered screen size. Does anyone have an example of how to do this or something similar?

I could do a per frame distance calculation for each of these polygons to determine when to increase or decrease the repeat values, but that could get expensive.

Write another version of the ImageMaterialProperty? Shader?

Here are some things that would be helpful:

Is there a way for me to get a willBeRenderedCallback to let me know if the polygon is even visible? This would allow me to a least filter the distance calculations to the visible polygons.

If the distanceDisplayCondition could return a callback with the distance as an option(or does that work already). If the distanceDisplayCondition is defined then the renderer is already doing the distance calculations, so why not take advantage of the renderer.

Can anyone else think of a better way? Using a CallbackProperty for repeat?



If I’m understanding you correctly, this has come up on the forum in the past. I threw together this example a long time ago and it amazingly still works: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=2d4f6bf833f4dfedf89e33bcc5dac564

You should be able use the class in that example as-is in your own application and supply whatever image you want.

I checked out the demo, and that looks really good, thanks!