glTF Glow sphere model

464 views
Skip to first unread message

Andrii Varhanov

unread,
Jul 1, 2016, 7:18:31 PM7/1/16
to cesium-dev

Hello,

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

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



2. 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 

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


Please advice, thanks


Hannah Pinkos

unread,
Jul 5, 2016, 8:43:56 AM7/5/16
to cesium-dev
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

Andrey Varganov

unread,
Jul 14, 2016, 11:35:04 AM7/14/16
to cesiu...@googlegroups.com
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?


--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/dSVi6lE_ex4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Bagnell

unread,
Jul 14, 2016, 12:35:25 PM7/14/16
to cesium-dev
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

Andrey Varganov

unread,
Jul 15, 2016, 10:22:20 AM7/15/16
to cesiu...@googlegroups.com
it works, thanks, here is a result

Inline image 1

Reply all
Reply to author
Forward
0 new messages