Monday, 18 June 2012

The devil is in the detail

In the last post we concluded a rather arduous journey through the world of mesh and levels of details with what must have seemed a very terse and over simplified view of mesh creation using Mesh Studio.

To reiterate:-
  • With this completed we simply add the mesh studio script into the root prim 
  • Touch the object to get a menu.
    The menu tells us that this object will be created at high LOD, preserving all details, it also informs us that we have two texturable surfaces.
  • For now we can simply accept all these and click the "Mesh!" button.
    A few moments later a URL appears in the local chat window. 
  • Clicking the the URL will download a zip file containing a default texture to use and the Collada (.dae) model ready to be uploaded.
Well, yes it was short and to the point but in all honestly, for the high LOD mesh that we just created that really is all that there is to it.

So let's get on and upload this shall we?


This is the standard mesh upload dialogue. We are looking at the levels of detail tab.
The dialogue offers us 4 different levels of detail that we can load. we have to have all 4, and the system "kindly" creates the missing ones. We have only the one LOD model so we have loaded this as the high level. You can see that our model is made up of 4422 triangles. All of the other levels are generated by the SL uploader.

The SL uploader tries its best. But to be quite frank it is not very aesthetically aware. you can see that the medium LOD model that is displayed in the preview window is alrady showing signs of corruption. as soon as we step down to the lower levels it will decay into a mess.

What is more, we have calculated the land impact and it is coming out a 9.323, this mesh lamp is going to cost us 10 prims! less than the 40 for the pure rpim version but twice the 5 prims that the previous sculpted prim version cost. This cannot be right!

So how is the land impact calculated?

The truthful answer is..your guess is as good as mine. The overall algorithm is to my knowledge not public though I could well be utterly wrong in this regard.  However we do know the general principles.
In this case the land impact is 9.323, this is the largest of the 3 factors, download, physics and server.
Download is calculated by a weighted sum of the total number of traingles in the combined set of LOD models multipled by a random number that the Lab came up with (or something like that).

The fact of the matter is that triangles in the lowest LOD are REALLY expensive, having a much higher weighting than those in the next level up, which in turn have a much higher cost than the level above (medium) and the n in turn medium has a higher cost per triangle than the higest level of detail.

We can therefore mess arouns with the Triangle limit setting of the LOD generator to get a more acceptable land impact.


So here we have reduced the triangle counts for all the lower levels of LOD. Medium is now at 552, Low at 69, lowest at 17. Our object's land impact will now be 1.7 (aka 2 prims). this is great news.

We can hit upload and enjoy our mesh lamp. Except we now find of course that as soon as we pull away form the lamp the thing mangles up into the shape shown. We can set our graphics settings to forestall this but we cannot force others to do likewise.

"Surely there must be a better way?", I hear you cry.

There is, and we'll look at this in the next instalment, wherein we will look at generating specific models for the other LOD levels.


No comments:

Post a Comment