glTF Glow sphere model

Hello,

I’m going to achieve something like seen below on the screenshot.

  1. Is it correct way to use entity model and glTF?

  1. Do you have some glTF model library where I can pick one similar to my case? Or at least just sphere without glow, there is only box example on official repo https://github.com/KhronosGroup/glTF/tree/master/sampleModels

  2. Is there any way to use glsl to add custom shader with Entity API?

Please advice, thanks

Hello,

Using a point would probably be the best solution.

To achieve the glow though, you’ll have to write a custom shader for the PointPrimitiveCollection

You can see the shaders we currently use here:

The shaders are added to the primitive in PointPrimitiveCollection.update:

And here is an example of how to add a point using a point primitive collection:

var pointPrimitives = scene.primitives.add(new Cesium.PointPrimitiveCollection());
pointPrimitives.add({
    color : Cesium.Color.YELLOW,
    position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)
});

``

If you do decide to implement this, let us know! We would love the contribution back. I think this is something that would be helpful to a bunch of other people.

You can check out our build guide for instructions for getting and building the code: https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/BuildGuide

It’s a bit more work to connect this to the Entity API. Let me know if you get it working at the primitive level and I can give you the steps you need to hook it up at the entity level.

Best,

Hannah

thanks, I’ve played with the PointPrimitiveCollectionFS.glsl and as turns out if I set float maxDistance = 0.0 here https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Shaders/PointPrimitiveCollectionFS.glsl#L15 I got the effect I needed

the only issue with alpha, as you can see on the preview it is not transparent to other objects, but transparent to the terrain and space,

any ideas what it could be?

Try changing the line here: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/PointPrimitiveCollection.js#L863
from Pass.OPAQUE to Pass.TRANSLUCENT.

Points are going to have the same problems as billboards and labels. See this bug for more details: https://github.com/AnalyticalGraphicsInc/cesium/issues/2130

it works, thanks, here is a result

vwjl3071517.png