duststorm wrote:AshMcConnell wrote:Could this be used for "blob" shadows?
I believe so.
fd9_, do you have an idea of the performance of the decals?
Well, there are two different categories: the performance of the calculation itself and then the rendering cost.
The calculation is going to be dependent on the size of the decal and the amount of triangles in the scene. You start out with an AABB and calculate all the triangles in the scene that intersect it. For simplicity, my world is a single mesh which I test against, and I ignore any other objects. Right now I'm using Bullet to perform the AABB-triangle and clipping tests, but I plan to separate that code out so the algorithm is independent of any physics engine. Since the world can potentially be very large, I'll most likely provide some sort of optional callback function (i.e, GetTrianglesInAABB), so that the end-user can make use of any optimizations provided by whichever physics engine they may end up using. By default, the algorithm will just use a brute-force test.
I'm currently using an indexed triangle list for the rendering operation with a single begin()/end(), and I seem to be getting an average of 6 batches per decal. Now I don't really know how Ogre optimizes this stuff internally, but my understanding was that if you have a single object with a single material, you should be able to render it in one batch. I've tried using one scene node per decal, and I've tried using a single global scene node for every decal, but it doesn't seem to make any difference. I know Ogre has a static geometry feature, but I haven't tried using that yet. My initial thought was that perhaps I needed a triangle strip to get it down to 1 batch, but from my reading so far, it seems that an indexed triangle list should be just as fast. Perhaps someone can clarify this, since this is not my area of expertise. Isn't it possible to somehow have all decals of the same material rendered in the same batch as well?
About the shadow blob: I don't see why it wouldn't work, if optimized correctly.