# GroundPrimitive materials examples with Cesium 1.46

**URL:** https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178
**Category:** CesiumJS
**Created:** [July 17, 2018, 8:58pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178 "2018-07-17T20:58:53Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kkrogh](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@kkrogh](https://community.cesium.com/u/kkrogh)
#### Post date: [July 17, 2018, 8:58pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178/1 "2018-07-17T20:58:53Z")

</div>

1. A concise explanation of the problem you're experiencing.

I'm unable to get GroundPrimitive to work with other materials. I can get GroundPrimitive to work with a solid color Cesium 1.43. But, the GroundPrimitive is showing up underneath my 3D tile data with Cesium 1.47. According to the following link, this functionality should have been added with 1.46. Are there any examples showing how to use this new feature?  
[https://github.com/AnalyticalGraphicsInc/cesium/issues/5025](https://github.com/AnalyticalGraphicsInc/cesium/issues/5025)

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

&nbsp;&nbsp;&nbsp;&nbsp;rectangle = scene.primitives.add(new Cesium.GroundPrimitive({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;geometryInstances : new Cesium.GeometryInstance({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;geometry : new Cesium.RectangleGeometry({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rectangle : Cesium.Rectangle.fromDegrees(-76.12, 39.44, -76.10, 39.58),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX\_FORMAT  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;appearance : new Cesium.EllipsoidSurfaceAppearance({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aboveGround : true,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;material: Cesium.Material.fromType('Checkerboard')  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})  
&nbsp;&nbsp;&nbsp;&nbsp;}));

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I'd like to add some texture to our 3D tile data for some image processing tests. The texture needs to be clamped to the 3D tile data.

4. The Cesium version you're using, your operating system and browser.

1.43/1.47, Windows 7, Chrome 67

---

<div class="post-metadata">

### Author: ![kkrogh](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@kkrogh](https://community.cesium.com/u/kkrogh)
#### Post date: [July 17, 2018, 10:52pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178/2 "2018-07-17T22:52:54Z")

</div>

Another observation is that the clamping works with 1.47 when using world terrain, just not my 3D tile data.

---

<div class="post-metadata">

### Author: ![gary](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gary/32/2224_2.png) [@gary](https://community.cesium.com/u/gary)
#### Post date: [July 18, 2018, 2:34pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178/3 "2018-07-18T14:34:22Z")

</div>

We’re still working on adding support for materials on GroundPrimitives on 3D Tilesets: [https://github.com/AnalyticalGraphicsInc/cesium/issues/6636](https://github.com/AnalyticalGraphicsInc/cesium/issues/6636)

If just color is sufficient though, you can get the GroundPrimitive to show on top of the 3D Tileset by setting its classificationType on construction. See the documentation here: [https://cesiumjs.org/Cesium/Build/Documentation/GroundPrimitive.html](https://cesiumjs.org/Cesium/Build/Documentation/GroundPrimitive.html)

If materials on GroundPrimitives aren’t working even just for terrain though, it could be that your system doesn’t support the WebGL extensions that the feature depends on. What does [webglreport.com](http://webglreport.com) say? You should just be able to copy-paste all the text from the page straight into a reply.

---

<div class="post-metadata">

### Author: ![kkrogh](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@kkrogh](https://community.cesium.com/u/kkrogh)
#### Post date: [July 18, 2018, 4:48pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178/4 "2018-07-18T16:48:57Z")

</div>

Thanks for the reply and the link to the issue. I guess I'll stop trying to get it to work for now. Do you have an anticipated version where you will support this feature?

Ah, thanks for the hint at classificationType. I wasn't setting it, and the rectangle would show up on the terrain and the 3D tile with 1.43 but only the terrain with 1.47. After setting it to 3D tile explicitly it shows up where I want it to.

GroundPrimitives seem to work great with world terrain, but I am stuck in an offline environment with 3D tiles.

Aside, is there a way to view documentation for past versions of Cesium?

Thanks!

---

<div class="post-metadata">

### Author: ![kkrogh](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@kkrogh](https://community.cesium.com/u/kkrogh)
#### Post date: [July 18, 2018, 4:50pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178/5 "2018-07-18T16:50:46Z")

</div>

I don't think it's the issue, but here's the output for WebGL1:

Platform: Win32  
Browser User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36  
Context Name: webgl  
GL Version: WebGL 1.0 (OpenGL ES 2.0 Chromium)  
Shading Language Version: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)  
Vendor: WebKit  
Renderer: WebKit WebGL  
Unmasked Vendor: Google Inc.  
Unmasked Renderer: ANGLE (NVIDIA Quadro K2100M Direct3D11 vs\_5\_0 ps\_5\_0)  
Antialiasing: Available  
ANGLE: Yes, D3D9  
Major Performance Caveat: No  
Vertex Shader  
Max Vertex Attributes: 16  
Max Vertex Uniform Vectors: 4095  
Max Vertex Texture Image Units: 16  
Max Varying Vectors: 30  
Best float precision: [-2127, 2127] (23)  
Transform Feedback  
Coming in WebGL 2  
Rasterizer  
Aliased Line Width Range: [1, 1]  
Aliased Point Size Range: [1, 1024]  
Fragment Shader  
Max Fragment Uniform Vectors: 1024  
Max Texture Image Units: 16  
float/int precision: highp/highp  
Best float precision: [-2127, 2127] (23)  
Framebuffer  
Max Color Buffers: 8  
RGBA Bits: [8, 8, 8, 8]  
Depth / Stencil Bits: [24, 8]  
Max Render Buffer Size: 16384  
Max Viewport Dimensions: [16384, 16384]  
Textures  
Max Texture Size: 16384  
Max Cube Map Texture Size: 16384  
Max Combined Texture Image Units: 32  
Max Anisotropy: 16  
Uniform Buffers  
Coming in WebGL 2  
Supported Extensions:  
ANGLE\_instanced\_arrays  
EXT\_blend\_minmax  
EXT\_color\_buffer\_half\_float  
EXT\_frag\_depth  
EXT\_shader\_texture\_lod  
EXT\_texture\_filter\_anisotropic  
WEBKIT\_EXT\_texture\_filter\_anisotropic  
EXT\_sRGB  
OES\_element\_index\_uint  
OES\_standard\_derivatives  
OES\_texture\_float  
OES\_texture\_float\_linear  
OES\_texture\_half\_float  
OES\_texture\_half\_float\_linear  
OES\_vertex\_array\_object  
WEBGL\_color\_buffer\_float  
WEBGL\_compressed\_texture\_s3tc  
WEBKIT\_WEBGL\_compressed\_texture\_s3tc  
WEBGL\_compressed\_texture\_s3tc\_srgb  
WEBGL\_debug\_renderer\_info  
WEBGL\_debug\_shaders  
WEBGL\_depth\_texture  
WEBKIT\_WEBGL\_depth\_texture  
WEBGL\_draw\_buffers  
WEBGL\_lose\_context  
WEBKIT\_WEBGL\_lose\_context

To see draft extensions in Chrome, browse to about:flags, enable the "Enable WebGL Draft Extensions" option, and relaunch.

And here's the output for WebGL2:

Platform: Win32  
Browser User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36  
Context Name: webgl2  
GL Version: WebGL 2.0 (OpenGL ES 3.0 Chromium)  
Shading Language Version: WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium)  
Vendor: WebKit  
Renderer: WebKit WebGL  
Unmasked Vendor: Google Inc.  
Unmasked Renderer: ANGLE (NVIDIA Quadro K2100M Direct3D11 vs\_5\_0 ps\_5\_0)  
Antialiasing: Available  
ANGLE: Yes, D3D9  
Major Performance Caveat: No  
Vertex Shader  
Max Vertex Attributes: 16  
Max Vertex Uniform Vectors: 4095  
Max Vertex Texture Image Units: 16  
Max Varying Vectors: 30  
Best float precision: [-2127, 2127] (23)  
Max Vertex Uniform Components: 16380  
Max Vertex Uniform Blocks: 12  
Max Vertex Output Components: 120  
Max Varying Components: 120  
Transform Feedback  
Max Interleaved Components: 120  
Max Separate Attribs: 4  
Max Separate Components: 30  
Rasterizer  
Aliased Line Width Range: [1, 1]  
Aliased Point Size Range: [1, 1024]  
Fragment Shader  
Max Fragment Uniform Vectors: 1024  
Max Texture Image Units: 16  
float/int precision: highp/highp  
Best float precision: [-2127, 2127] (23)  
Max Fragment Uniform Components: 4096  
Max Fragment Uniform Blocks: 12  
Max Fragment Input Components: 120  
Min Program Texel Offset: -8  
Max Program Texel Offset: 7  
Framebuffer  
Max Draw Buffers: 8  
Max Color Attachments: 8  
Max Samples: 8  
RGBA Bits: [8, 8, 8, 8]  
Depth / Stencil Bits: [24, 8]  
Max Render Buffer Size: 16384  
Max Viewport Dimensions: [16384, 16384]  
Textures  
Max Texture Size: 16384  
Max Cube Map Texture Size: 16384  
Max Combined Texture Image Units: 32  
Max Anisotropy: 16  
Max 3D Texture Size: 2048  
Max Array Texture Layers: 2048  
Max Texture LOD Bias: 2  
Uniform Buffers  
Max Uniform Buffer Bindings: 24  
Max Uniform Block Size: 65536  
Uniform Buffer Offset Alignment: 256  
Max Combined Uniform Blocks: 32  
Max Combined Vertex Uniform Components: 212988  
Max Combined Fragment Uniform Components: 200704  
Supported Extensions:  
EXT\_color\_buffer\_float  
EXT\_texture\_filter\_anisotropic  
OES\_texture\_float\_linear  
WEBGL\_compressed\_texture\_s3tc  
WEBGL\_compressed\_texture\_s3tc\_srgb  
WEBGL\_debug\_renderer\_info  
WEBGL\_debug\_shaders  
WEBGL\_lose\_context

To see draft extensions in Chrome, browse to about:flags, enable the "Enable WebGL Draft Extensions" option, and relaunch.

WebGL 2 Functions Implementation Status:  
88 of 88 new functions implemented.

copyBufferSubData  
getBufferSubData  
blitFramebuffer  
framebufferTextureLayer  
getInternalformatParameter  
invalidateFramebuffer  
invalidateSubFramebuffer  
readBuffer  
renderbufferStorageMultisample  
texStorage2D  
texStorage3D  
texImage3D  
texSubImage3D  
copyTexSubImage3D  
compressedTexImage3D  
compressedTexSubImage3D  
getFragDataLocation  
uniform1ui  
uniform2ui  
uniform3ui  
uniform4ui  
uniform1uiv  
uniform2uiv  
uniform3uiv  
uniform4uiv  
uniformMatrix2x3fv  
uniformMatrix3x2fv  
uniformMatrix2x4fv  
uniformMatrix4x2fv  
uniformMatrix3x4fv  
uniformMatrix4x3fv  
vertexAttribI4i  
vertexAttribI4iv  
vertexAttribI4ui  
vertexAttribI4uiv  
vertexAttribIPointer  
vertexAttribDivisor  
drawArraysInstanced  
drawElementsInstanced  
drawRangeElements  
drawBuffers  
clearBufferiv  
clearBufferuiv  
clearBufferfv  
clearBufferfi  
createQuery  
deleteQuery  
isQuery  
beginQuery  
endQuery  
getQuery  
getQueryParameter  
createSampler  
deleteSampler  
isSampler  
bindSampler  
samplerParameteri  
samplerParameterf  
getSamplerParameter  
fenceSync  
isSync  
deleteSync  
clientWaitSync  
waitSync  
getSyncParameter  
createTransformFeedback  
deleteTransformFeedback  
isTransformFeedback  
bindTransformFeedback  
beginTransformFeedback  
endTransformFeedback  
transformFeedbackVaryings  
getTransformFeedbackVarying  
pauseTransformFeedback  
resumeTransformFeedback  
bindBufferBase  
bindBufferRange  
getIndexedParameter  
getUniformIndices  
getActiveUniforms  
getUniformBlockIndex  
getActiveUniformBlockParameter  
getActiveUniformBlockName  
uniformBlockBinding  
createVertexArray  
deleteVertexArray  
isVertexArray  
bindVertexArray

---

<div class="post-metadata">

### Author: ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)
#### Post date: [July 20, 2018, 6:07pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178/6 "2018-07-20T18:07:30Z")

</div>

Hi,

We don’t have a version we can commit to for materials on primitives on tilesets right now. I have bumped that linked issue with this report, so watch that for updates, and will ping this thread when it’s going to release.

To viewed archived documentation, see the downloads page ([https://cesiumjs.org/downloads/](https://cesiumjs.org/downloads/)). There’s links to past versions of the docs and even Sandcastle.

Thanks,

Gabby

---

<div class="post-metadata">

### Author: ![sean\_lilley](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sean_lilley/32/2083_2.png) [@sean\_lilley](https://community.cesium.com/u/sean_lilley)
#### Post date: [January 3, 2019, 10:48pm UTC](https://community.cesium.com/t/groundprimitive-materials-examples-with-cesium-1-46/7178/7 "2019-01-03T22:48:05Z")

</div>

Just to update this thread, ground primitives can now classify 3D Tiles. This was added in [https://github.com/AnalyticalGraphicsInc/cesium/pull/7434](https://github.com/AnalyticalGraphicsInc/cesium/pull/7434) and will be part of Cesium 1.54.
