I'm making a particle renderer, which I have initially working mostly fine, using a very hacked together primitive class with Appearance and Geometry that attached to an entity.
But I still have critical problems preventing quality results.
I'll ask questions in descending order of importance
-How do I pass an image as a sampler to vertex shader, when I have both a vertex and fragment shader?
-What is the proper way to feed the position of an entity to a primitive for use in uniforms?
-How do I assign uniforms per primitive? I've been doing a horrible hack where I recreate an appearance for every primitive, and setting onPreRender.
I can't find any sort of function such as primitive.onRender(); or uniforms[i](primitive);.
The way I figured out how to use appearance.uniforms was by grepping czm's source and setting breakpoints then going up the stack. Appearance's documentation and even source make no mention of "uniform".
-Terrain's depth function appears to be variable per tile. czm_modelViewProjection works perfectly for everything else, but particles inside the ground will show when at high zoom levels and certain camera angles. I'm guessing each terrain tile is rendered with its own near/far? I don't know how to compensate for this.
-How to properly put a shader as a file instead of hardcoding it?
My experience with czm is that it does the things it expects you to do with it very well, but any expansion outside of that is awful.
After having to dig through stuff for about a week to learn how to make a basic renderer, I'm thinking It would've been easier to hack my own pipeline onPostRender.