# Why the GroundPrimitive's fragment shader didn't work?

**URL:** https://community.cesium.com/t/why-the-groundprimitives-fragment-shader-didnt-work/9430
**Category:** CesiumJS
**Created:** [April 24, 2020, 7:48am UTC](https://community.cesium.com/t/why-the-groundprimitives-fragment-shader-didnt-work/9430 "2020-04-24T07:48:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![venus](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/venus/32/2195_2.png) [@venus](https://community.cesium.com/u/venus)
#### Post date: [April 24, 2020, 7:48am UTC](https://community.cesium.com/t/why-the-groundprimitives-fragment-shader-didnt-work/9430/1 "2020-04-24T07:48:27Z")

</div>

```auto
    Cesium.Ion.defaultAccessToken = 'YOUR TOKEN';

    var worldTerrain = Cesium.createWorldTerrain({
        requestWaterMask: true,
        requestVertexNormals: true
    });

    var viewer = new Cesium.Viewer('cesiumContainer', {
        terrainProvider: worldTerrain
    });
    var rectangleInstance = new Cesium.GeometryInstance({
        geometry: new Cesium.RectangleGeometry({
            rectangle: Cesium.Rectangle.fromDegrees(-179, -89, 180, 89),
            vertexFormat: Cesium.VertexFormat.ALL,
        }),
        id: 'rectangle',
    });
    viewer.scene.primitives.add(new Cesium.GroundPrimitive({
        geometryInstances: rectangleInstance,
        // classificationType: ClassificationType.TERRAIN,
        appearance: new Cesium.EllipsoidSurfaceAppearance({
            aboveGround: true,
            fragmentShaderSource: `
                void main() {
                    gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); // <= look at here
                }
            `
        }),
    }));

```

Result:

 ![image](https://global.discourse-cdn.com/cesium/original/2X/b/bf6292180afccbd64e3f5c2b87420389d5cd5e59.jpeg)

the color should be yellow, but it isn’t.

When I modify `GroundPrimitive` to `Primitive`, it looks good.

How to resolve this problem? Thanks in advanced

---

<div class="post-metadata">

### Author: ![guangc68](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/guangc68/32/2272_2.png) [@guangc68](https://community.cesium.com/u/guangc68)
#### Post date: [July 16, 2020, 1:42pm UTC](https://community.cesium.com/t/why-the-groundprimitives-fragment-shader-didnt-work/9430/2 "2020-07-16T13:42:48Z")

</div>

> [@venus](#):
>
> ```auto
> var rectangleInstance = new Cesium.GeometryInstance({
> geometry: new Cesium.RectangleGeometry({
> rectangle: Cesium.Rectangle.fromDegrees(-179, -89, 180, 89),
> vertexFormat: Cesium.VertexFormat.ALL,
> }),
> id: 'rectangle',
> });
> viewer.scene.primitives.add(new Cesium.GroundPrimitive({
> geometryInstances: rectangleInstance,
> // classificationType: ClassificationType.TERRAIN,
> appearance: new Cesium.EllipsoidSurfaceAppearance({
> aboveGround: true,
> fragmentShaderSource: `
> void main() {
> gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); // <= look at here
> }
> `
> }),
> }));
> 
> ```

hello，have you slove this problem
