GeometryInstance in batching - how does it work?

Hi,

I have been offline for two weeks, and I see that a new class,

GeometryInstance has been introduced, which has to be used to create
a primitive now. whereas previously I could use:

var geometry = new Cesium.PolygonGeometry(opts);

var primitive = new Cesium.Primitive({

    geometries :  [ geometry ],

    appearance : appearance

};

primitives.add(primitive);

now I'm trying:

var primitive = new Cesium.Primitive({

    geometryInstances :  [ new Cesium.GeometryInstance({ geometry:

geometry }) ],

    appearance : appearance

};

primitives.add(primitive);

I'm getting errors:

Uncaught DeveloperError:
Invalid renderState.blending.equationRgb.
Error at new DeveloperError
(lib/Cesium/Source/Core/DeveloperError.js:44:22) at new
RenderState (lib/Cesium/Source/Renderer/RenderState.js:176:19) at
Context.createRenderState
(lib/Cesium/Source/Renderer/Context.js:1801:22) at
Primitive.update (lib/Cesium/Source/Scene/Primitive.js:393:34) at
CompositePrimitive.update
(lib/Cesium/Source/Scene/CompositePrimitive.js:403:27) at
Scene.render (lib/Cesium/Source/Scene/Scene.js:543:26) at
declare.render
(lib/Cesium/Source/Widgets/Dojo/CesiumViewerWidget.js:1178:24) at
declare.updateAndRender
(lib/Cesium/Source/Widgets/Dojo/CesiumViewerWidget.js:1203:18) at
updateAndRender
(lib/Cesium/Source/Widgets/Dojo/CesiumViewerWidget.js:1227:24) RenderState.js:176

what am I doing wrong?

Akos

but this gives me errors :(

Hi Akos,

Your code looks right. It looks like the problem is with the appearance. We also moved to separate appearances classes. The joy of being on the bleeding edge.

I updated the Wall Sandcastle example in the batching branch. Have a look and let me know if you need more help syncing up your code.

Patrick

Patrick,

Your code looks right. It looks like the problem is with the
appearance. We also moved to separate appearances classes. The joy
of being on the bleeding edge.

:slight_smile:

it seems that it was the pickData attribute again - as soon as I added
pickData to the GeometryInstance constructor, everything was working
fine again.

I updated the Wall Sandcastle example in the batching branch. Have a
look and let me know if you need more help syncing up your code.

will look at it, thanks.

Akos

Good eye. I still haven’t gotten to matching up the vertex formats yet. I’ll let you know when that is in.

Patrick