Custom polyline arrow material

I use polyline with PolylineArrowType material, and I want to customize it a little bit.
I want it to have arrows at the middle of each segment instead of one arrow at the end of whole polyline.
This is not a hard task, but I stucked with the cesium source code.
It seems that Shaders/Materials/PolylineArrowMaterial.glsl defines only alpha and color of the line, and the arrow image itself is somewhere else.
I can’t find, where it is, so any help would be appreciated.

There is no option to move the location of the arrow. You were right to look in PolylineArrowMaterial.glsl; however, it does not use a texture. It determines the color based on the texture coordinates. You would need to modify the shader source to place the arrow in the middle. If you want to modify the source, I can guide you. Contributions are always welcome.

Regards,

Dan

I would like to make some contributions. Where should I look to find code about placing arrows on the polyline?

You can modify PolylineArrowMaterial.glsl to change the placement of the arrow head. How to color a fragment is based on the texture coordinates. You could add a uniform in the range [0.0, 1.0] to offset the s texture coordinate (which would move the arrow head along the length of the line. The position of the arrow head is computed from ‘base’, which is the s coordinate of the start of the arrow head, and ‘center’, which is the (s, t) coordinate of the tip of the arrow head. Use the new uniform to offset these positions. You would also need to modify the conditional in the if-statement to check that st.s < base and st.s > center.x.