Well, sure. It would be silly to reimplement TBT in Python. But I wasn’t proposing you do that; I was just describing how the TBT works because you asked for more information about it.
Incidentally, the TBT doesn’t modify the GeomVertexData directly. Nor does the RBC. The RBC only has to update the entries in the TBT, and Panda will automatically apply the changes to the GeomVertexData when it is rendered, by looking up the transform for each vertex based on the “transform_blend” column.
If you were to implement your custom animation needs, I would not recommend going this route, because there is no easy facility for animating colors this way. (Though there is some facility: you could use an RGBA morph, which would accomplish the desired goal, especially for flipping between two colors. But you’d have to set up the GeomVertexData yourself, eschewing the RBC.)
But setting up a GeomVertexData for animation, including a TransformBlendTable and/or morph animation, is complicated. It might be much easier just to directly manipulate the vertex values with a GeomVertexWriter.
It might, depending on your scene and your hardware. Enabling two-sided rendering can actually improve your performance, if you are spending more time processing vertices than you are filling triangles (which appears to be likely in your case). But don’t just ask theoretically: try it, and see what happens.
I don’t know. If your mouse is freezing, it’s either a driver issue, or your system is swapping virtual memory to disk. What does it look like in PStats?
Since I anticipate your asking the next question about RGBA morphs, I will briefly describe that too. But be warned that morphs are a complex topic and there’s lots of literature in general on the net.
A morph is a linear blend between two different vertex values. Any frame, the vertex may have value A, or value B, or some value linearly in between. Conceptually, for a given morph “x”, each vertex in the GeomVertexData has two definitions: x[0], and x[1], and by varying the value “x”, you can smoothly change the vertex from x[0] to x[1]. All the vertices change at the same time, though you can have certain vertices whose value for x[0] and x[1] are the same thing, and these vertices don’t change when you change x.
So, by varying x, you can change the entire shape (or color, or normals) of the surface from x[0] to x[1]. You just have to define what the shape is at x[0], and what the shape is at x[1].
To implement this, we store a new column in the GeomVertexData for each different morph. This column defines the value of x[1] for each vertex. (x[0] is the initial position of the vertex). Actually, the data in the column is the delta: x[1] - x[0]. The name of the column is “basename.morph.slidername”, where “basename” is the name of the column it is affecting (and might be something like “vertex” or “color”), “morph” is literal, and “slidername” is the name of the particular morph, e.g. “x” in my example so far. This column must also have a type of CMorphDelta.
Then we construct a SliderTable with an entry for each named morph slider, and store it on the GeomVertexData. Then manipulating the morph values is simply a matter of manipulating the slider values, and when the mesh is rendered, Panda will automatically apply the request morph operations to the vertices.
To use this technique to color individual tiles of a grid, you will need to define a different morph for each group of tiles that will be independently controlled. If each tile could potentially be independent of all of the other tiles, you will need a morph for each tile, which could be prohibitively expensive (there is a small cost per each morph).
David