# 3d tiles next point cloud example (tiles stored using GLB instead of PNTS)

**URL:** <https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203>\
**Category:** CesiumJS\
**Created:** [April 16, 2022, 12:56am UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203 "2022-04-16T00:56:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![danlipsa](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/danlipsa/32/5809_2.png) [@danlipsa](https://community.cesium.com/u/danlipsa)\
**Post date:** [April 16, 2022, 12:56am UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203/1 "2022-04-16T00:56:41Z")

</div>

Hi,  
I am trying to render a simple 3D Tiles point cloud using tiles stored in GLB as described in 3D Tiles Next post, but I cannot get it to render in Cesium. My dataset it very simple, it has only 3 points.

I was able to get the tileset version using pnts format, and also a version of the tileset that stores a triangle using GLB to render correctly.

Can you point me to a tileset of a point cloud that stores tiles using GLB? This will help me see what I am doing wrong.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 16, 2022, 1:08pm UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203/2 "2022-04-16T13:08:12Z")

</div>

Trying to provide some context:

3D Tiles Next is a set of draft extensions for 3D Tiles 1.0. Most of the functionalities that have been shown in these extensions are now becoming part of 3D Tiles 1.1. This means that with the latest version of 3D Tiles and CesiumJS, you should just be able to refer to the GLB file as the `tile.content`, and it should just be rendered.

(There currently is no dedicated sample for point clouds in the `3d-tiles-samples` repository, but that is still on my ‘to do’ list. Point clouds can come in different flavors - [see the Cesium Unit Tests](https://github.com/CesiumGS/cesium/blob/db2669aae149e965a3578fd0343384a33f83543c/Specs/Scene/PointCloud3DTileContentSpec.js#L35-L70) - and I’d try to generate a representative sample here, based on different GLBs. There is [one sample with a GLB that contains a point cloud](https://github.com/CesiumGS/3d-tiles-samples/tree/92f615ab072594d315fc48f886a6055b434d02b7/next/MultipleContents) from an earlier state, based on 3D Tiles 1.0 and an extension. It should still work, but has been removed for now, and will be replaced by an updated 3D Tiles 1.1 sample).

When you encouter problems with your test tileset: If you could append the whole tileset+GLB here (as a ZIP file), others could try it out and maybe find out what’s wrong there.

---

<div class="post-metadata">

**Author:** ![danlipsa](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/danlipsa/32/5809_2.png) [@danlipsa](https://community.cesium.com/u/danlipsa)\
**Post date:** [April 20, 2022, 1:51pm UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203/3 "2022-04-20T13:51:01Z")

</div>

@Marco13 Thank you for the pointers! It seems that the points in my example did show up, but they were very hard to see. It seems pointSize for styling the points does not seem to work if the points are using gltf instead of pnts.  
This is the example I am using for 3 points stored using gltf and 3 points stored using pnts.

[https://drive.google.com/drive/folders/1wWeBVMYDg8BF9w\_C7WVbubfYEmlQMd3E?usp=sharing](https://drive.google.com/drive/folders/1wWeBVMYDg8BF9w_C7WVbubfYEmlQMd3E?usp=sharing)

I include the html file I am use to style the points.  
Do you have any advice on how to fix this?

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![danlipsa](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/danlipsa/32/5809_2.png) [@danlipsa](https://community.cesium.com/u/danlipsa)\
**Post date:** [April 20, 2022, 4:20pm UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203/4 "2022-04-20T16:20:57Z")

</div>

Another experiment I’ve done is took jacksonville-3dtiles dataset (from the folder linked in my previous post) which shows a triangle and only changed the mode field inside the gltf file from 4 (triangle) to 0 (point).

I had to regenerate the glb file afterwards.

The triangle disappears but there are no points visible. So actually I am not sure the points are shown at all.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 20, 2022, 7:17pm UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203/5 "2022-04-20T19:17:47Z")

</div>

I’m not sure about the last one - one of the examples that you uploaded _did_ contain a triangle, but apparently, with mode 4.

Regarding the other one: Indeed, it seems like the `pointSize` is not supported for glTF models yet ( [Cesium3DTileStyle.pointSize in ModelExperimental · Issue #10046 · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/issues/10046) ), so the points should be there, but may hardly be visible.

One workaround could be a custom shader…

```auto
const viewer = new Cesium.Viewer("cesiumContainer");

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
    url : 'http://localhost:8003/test/jacksonville-3dtiles-points-gltf/jacksonville-3dtiles-points-gltf/tileset.json'
}));

function setPointStyleWithShader(tileset, pointSize, r, g, b) {
  var pointShader = new Cesium.CustomShader({
    vertexShaderText: [
      "void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput)",
      "{",
      " vsOutput.pointSize = float(" + pointSize + ");",
      "}",
    ].join("\n"),
    fragmentShaderText: [
      "void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)",
      "{",
      " material.diffuse = vec3(float(" + r + "), float(" + g + "), float(" + b + "));",
      "}",
    ].join("\n"),  
  });
  tileset.customShader = pointShader;
}

setPointStyleWithShader(tileset, 10.0, 1.0, 1.0, 0.0);

viewer.zoomTo(tileset);

```

but that’s clumsy…

---

<div class="post-metadata">

**Author:** ![ptrgags](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ptrgags/32/4938_2.png) [@ptrgags](https://community.cesium.com/u/ptrgags)\
**Post date:** [April 20, 2022, 7:33pm UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203/6 "2022-04-20T19:33:44Z")

</div>

@danlipsa as @Marco13 pointed out, `pointSize` in styling is not yet supported in `ModelExperimental`.

However, if you’re just trying to get the points to show up, point cloud attenuation is another option. Set

```auto
tileset.pointCloudShading.attenuation = true;

```

There are other parameters to adjust the size of the points. Please see the [docs](https://cesium.com/learn/cesiumjs/ref-doc/PointCloudShading.html?classFilter=pointcloud) and the [Point Cloud Shading Sandcastle](https://sandcastle.cesium.com/?src=3D%20Tiles%20Point%20Cloud%20Shading.html) for more information.

---

<div class="post-metadata">

**Author:** ![danlipsa](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/danlipsa/32/5809_2.png) [@danlipsa](https://community.cesium.com/u/danlipsa)\
**Post date:** [April 20, 2022, 10:22pm UTC](https://community.cesium.com/t/3d-tiles-next-point-cloud-example-tiles-stored-using-glb-instead-of-pnts/18203/7 "2022-04-20T22:22:14Z")

</div>

@ptrgags That did it! Now I can see the points. I’ll check out the example to see other shading parameters.

Thank you guys!  
Best,  
Dan
