So now you’ve bought your first meshed dress and/or avatar and are generally excited about the bright new future that meshes will bring. Well, after you persuade your friends to switch to a mesh-enabled viewer, of course; thankfully, even the non-LL viewers are all starting to include meshes (yes, even the ones based on SL 1 :), so I guess soon everybody will be seeing meshes in all their glory.

At least on avatars and avatar attachments. Buildings and furniture is a completely different story!

Why? Because Linden Lab, as usual, has shot their own foot. Their formula for “prim equivalents” — how many prims an uploaded mesh will use on a parcel — is so weird and complex that the results are an absolute mess.

Let’s take a simple example. Long time ago, I uploaded a sculpty of my own head. There was a tutorial somewhere to explain how to export your avatar as a mesh, tweak it via some crazy software (I wish I could remember what I’ve used), and get the equivalent sculpty. SL avatars are not insanely huge in terms of polygons (about 7,500 triangles for the full mesh, I think — more than many MMORPGs, but not that complex), and since sculpties can become 4096-triangle meshes, they will fit fine in three sculpties. So I did just that for fun. And of course, as you know, a sculpty just takes one prim. So long as you can fit the mesh inside 4000 triangles or so, it’s a reasonable compromise. The problem, of course, is that few 3D modelling tools create flawless sculpties easily — it’s very hard for an amateur to get them “just right” with a simple 3D tool.

I have kept that mesh around, though. So now I could upload the mesh directly. Here is the result:

Hmm. Note that it’s the same mesh as the one used for the sculpty, but it actually looks nicer (well, or it would, if I didn’t have it selected). The trouble is, this now takes *six* prims instead of just one!

Of course, if you have been tweaking with the mesh upload controls, you know that you can optimise this a bit. For instance, I might be able to delete some triangles, or even upload a very, very simple physics model, which would reduce the amount of prim equivalents. Expert modellers know how to reduce meshes even further by tweaking with the mesh *on their 3D modelling application*, and eventually compensate the lack of triangles by using cleverly designed textures on top of a simplified UV model. So I guess this would be enough to get the mesh down to just one PE — after all, if this is pretty much the same as a sculpty which only takes one prim, you should be able to upload the same mesh and get just one PE, right?

Wrong. My friend the artist Scarp Godenot, pointed out to me that LL got the equations all wrong. Namely, the amount of PEs change with *size*. The tests I did were for insanely huge meshes, so they were already so big in terms of PEs, that I didn’t notice any difference at all in PEs. But I knew I was using highly unoptimised meshes.

This one, by contrast, is very simple — probably some 3000 triangles or so. Less than 4000, in any case. so see what happens when I start resizing it:

What happened?! Well, this is extraordinary: the amount of triangles remains *exactly the same*, and remember, it’s the number of triangles that make the difference. But now this mesh is a bit larger than twice the size… and LL now thinks it should “consume” 13 PEs instead of 6!

When Scarp told me about this, I was very, very skeptical. You see, there is supposed to be some *logic* to PEs. Mesh size — the amount of polygons — is what makes a difference to the rendering engine, and the *size* of a mesh is usually the amount of polygons it has. The actual virtual size in meters makes little difference. Well, perhaps a bit, if you consider how occlusion is calculated, but the algorithms for that are hardly easy to predict what works best. For instance, rezzing a huge mesh near to you might mean that there is a lot of objects occluded behind the mesh, but, on the other hand, after figuring out which ones don’t need to be rendered every frame, it means the graphics card will have *less* work to do. On the other hand, shading a huge mesh might take a bit more time than shading a small one; but, again, if you have just *one* huge mesh filling the whole of the 3D viewport, the renderer will not need to worry about shading the remaining objects — they will be out of sight anyway. So it’s not so obvious that a mesh with *large* triangles will take *more* time to render than one mesh with *small *triangles. It all depends on what’s on the background, the lighting, and so forth.

But all that happens client-side! So why should the amount of PEs actually *grow* if you have a mesh that is twice the *visual* size but has *exactly the same amount of triangles*? Remember, you can resize a sculpty as much as you want, and it will be always exactly one prim; the same happens to Linden Trees as well. In terms of server resources, it makes no difference whatsoever.

Well… perhaps that is not entirely correct. You see, a mesh will interface with Havok beneath. The more virtual space it takes, possibly the more calculations Havok has to make. With sculpties, LL has pretty much ignored that. With meshes, however, objects pay a huge penalty! In fact, it looked like half the cost for PEs would come just for the amount of resources consumed by Havok, which is exaggerated… but possibly makes sense for someone at LL.

So, well, an object twice the linear size (as measured on the X, Y, Z axis) consumes twice as many PEs. That makes sense… or perhaps not. In terms of volume, it’s *eight* times larger (2 to the power of 3). So that was a bit confusing and unexpected. Hoping to figure out what was going on, I resized the head mesh even more:

What’s going on?? The mesh has now grown: over 3000 original meshes could fit inside this new mesh, the volume has grown quite a lot. But *now* the number of prim equivalents is just… seven! Now *that doesn’t make any sense whatsoever*. Scarp has told me that sometimes the number of PEs is not immediately calculated, and he’s right, sometimes there is a short delay. But in *this *case I waited a long time and the numbers didn’t change!

I was expecting this to be *at least* a PE of, say, 90. The theory was: something twice as large *linearly* (i.e. along the axis) has twice as many PEs. So since this object is now 15 times the linear size of the original, it would make sense to consume 90 PEs. Instead, it consumes little more than what the small object did! Why?? I have no clue, so I made the object even bigger:

This is about 3,6/3,5 times the linear size of the previous object, so apparently the “rule” works well again. However, this is over 50 times the linear size of the *original* object — and that would mean that if the rule had any logic, it would have, say, a PE of 300!

So… well… it’s clear that the algorithm is not linear but a very strange curve. My last example:

This final example has three times the linear size than the previous one, but the PE just became twice as much. Compared to the original object, however, this is *200* times the linear size (8 million small heads would fit inside this object). So, clearly, the algorithm is *not* linear — not in the linear size, and not in the volume. It seems to be a logarithmic progression, but there are some anomalies. They might be explainable with the way Havok deals with objects: perhaps there are a lot of tradeoffs for very small objects (which tend to be very penalised) compared with huge ones (which Havok might deal differently and thus the “weight” of the physical aspect of the object matters little). So this means that a 3D modeller uploading a mesh will have to find the “right” size for the upload: not too small, or it will be over-penalised by Havok (assuming that’s what causes the anomalies shown in the images above), and not too big, or the sheer visual size will also penalise the algorithm.

As a conclusion… this means that meshes are pretty much worthless as building elements. If such simple elements, which can be done with a single sculpty, take so much PEs… nobody will want to buy them. Since the algorithm is very strange, it will require a lot of trial-and-error to get the *minimum* amount of PEs for a particular mesh, and that requires a 3D modeller spending a lot of time (and money!) uploading meshes until they get an “adequate” PE. “Adequate” in this context means: at *most* as many prims as the equivalent object done with sculpties, for the same amount of triangles. However, since the final size of the object matters so much, I’m afraid that except for some very specific cases, it will *never* pay off: you’ll always be better off with a clever combination of sculpties and regular prims instead of using a mesh.

I don’t know if this is deliberate. Attached objects to avatars clearly are differently handled: I’m assuming that for Havok’s sake, there is little difference between a naked avatar and one wearing a 150,000-triangle mesh. So fashion designers and avatar creators will be happy, since they will pretty much have no constraints on their creativity — and meshed clothing, even this first generation, looks awesome — specially when sitting down!

Vehicles might also work well… I read that the trick is to keep PE to less than 32. Well, it’s still a constraint, but possibly it allows more effective modelling than using sculpties, I don’t know. People have certainly come up with nice designs, although I see little difference — from the pictures! — to sculpty-based designs. I’d have tio buy one and test it!

But buildings… well, definitely they will just be a “novelty” for people who have whole empty sims, but the common user will not really be able to afford a meshed house with meshed furniture… which might take 500 or 1000 PEs and don’t look that much different from a primmed design.

I think it’s important that LL reflects on how they will tweak the algorithm in order to make it usable. I think that the major problem in the past year of testing is that people have just uploaded meshes to empty sandboxes. I’m also to be blamed: all my own tests were made on relatively empty sims, and for the purposes I needed those meshes (small machinimas), the amount of PEs was pretty much irrelevant, and was so insanely huge in any case, that I didn’t bother with the algorithm.

But now meshes are out in the open. People are actively selling them — mostly as avatars and avatar attachments and a few vehicles, for obvious reasons. Builders, furniture makers, and other decorative elements — as well as artists — are kept out of the whole mesh economy. Is this deliberate for some reason? Only Linden Lab can answer that. Perhaps they really don’t want a meshed world — just better-looking avatars.

Note that there is a simple (well, relatively simple) alternative to the current prim-based economy: use a triangle-based economy instead. The problem of dealing with resized objects would still continue, however. Unless LL reviews their crazy algorithms, *that* will always remain a huge issue. And even the highly-inflated PE even for simple meshes is a huge deterrent — only the most sophisticated 3D modellers will be able to tweak their meshes in order to get low PEs, and, by doing so, might get their meshes at such a low triangle count, that it might be better to simply use a sculpty instead…