add new fabric to entity

I have defined a new fabric to combine the Polyline arrow and glow. It works, when I define a line with scene.primitives.add. But how can I add this new fabric to entity?
I've tried a way given in
https://groups.google.com/forum/embed/?place=forum/cesium-dev&showsearch=true&showpopout=true&hideforumtitle=true&fragments=true&parenturl=http%3A%2F%2Fcesiumjs.org%2Fforum.html#!searchin/cesium-dev/fabric/cesium-dev/XZLj0hl5C0c/ac8C1w8mDAAJ
"
var entity = viewer.entities.add({
    polygon: {
        hierarchy: area,
        material: new CustomMaterialProperty({
            type: 'Fade',
            uniforms: {
                fadeInColor: new Cesium.Color(1.0, 0.0, 0.0, 0.5),
                fadeOutColor: new Cesium.Color(0.0, 0.0, 0.0, 0.0),
                maximumDistance: 1,
                repeat: false,
                fadeDirection: {
                    x: true,
                    y: false
                },
                time: new Cesium.Cartesian2(0, 0)
            }
        }),
        outline: true,
        outlineWidth: 10
    },
});
"

But it does not work...

Is anything wrong?

Hi there,

Try the method outlined in this thread: https://groups.google.com/forum/?hl=en#!searchin/cesium-dev/custom$20material|sort:relevance/cesium-dev/1IPjHD7G_NA/v-zs2bsxBgAJ

Hope that helps,

  • Rachel

在 2017年7月6日星期四 UTC+8下午9:38:06,Rachel Hwang写道:

Hi there,

Try the method outlined in this thread: Redirecting to Google Groups

Hope that helps,
- Rachel

On Tuesday, July 4, 2017 at 3:57:46 AM UTC-4, dear...@qq.com wrote:I have defined a new fabric to combine the Polyline arrow and glow. It works, when I define a line with scene.primitives.add. But how can I add this new fabric to entity?

Actually, I found this method a few days ago. But the solution makes me confused...would you please give an example.

my fabric is defined as:
  fabric: {
               uniforms : {
               color : color,
               glowPower:0.5
           },
            source :ArrowGlowSource
            }
And the line is define:
var arcEntity = viewer.entities.add({
   position : property,
       path : {
            resolution : lineParameter.resolution,
            material :>>I FAILED HERE<<,
                 
            width : lineParameter.linewidth,
            leadTime: 1e11,
            trailTime: 1e11
        }
      
    });

Hi there,

I’m sorry you’ve been having trouble. Here’s a complete example of a custom material: https://gist.github.com/mramato/cbeede0339a067d3cf26

Hope that helps,

  • Rachel