Correctly importing mesh is not as easy as it seems. Yes it's easy to upload mesh in OpenSim, thanks to the simplified upload window in the viewer. But doing it the state of the art way asks for some knowledge about all this works internally. I hope after this article, everything will be more clear.
LODs?
LOD means Level Of Details. Depending from how far an object is seen, it does not need to show as many details when watched from far away as in close up. That's what LODs are about: several versions of the same object with more or less details. The viewer will select the appropriate one from the user point of view.
In OpenSim (and SL) there are 4 LODs:
High for close up details,
Medium from a a few meters aways,
Low for a more global view and
Lowest for very far away view.
The threshold for LOD switch depends on the viewer (and I think the model definition when it was uploaded), and you can see the values when editing the object properties, on Object tab.
Cost
I wont talk about money required to upload mesh, but about rendering cost. As a LOD defines a mesh model by itself, using 4 LODs for an object means uploading 4 models on the server. The lower the LOD, the less definition is needed, but still all LOD models are added to build one object, increasing storage needs and download time.
Yes, when an object is needed by the viewer, this one downloads all LOD models for that object. The one it uses to render the scene depends on the user's camera position, but used or not, all models are downloaded, increasing network traffic and rendering time.
Why it is important ?
You might you don't care about it, as long as your avatar and objects display well, and you have a good internet bandwidth so you are not affected by performance.
First, that's a bit seflish :-) Your avatar is displayed to all other users around you, so they have to
download the same than you. They might not be as lucky as you.
Mesh and textures download are the biggest sources of traffic in OpenSim, and the more is download for each avatar or rezzed object, the slower for everyone, because of resources needed on the server to fullfill the request and the bandwidth needed to send assets to all viewers.
I think everyone should care at least about avatar complexity (ARC = Avatar Rendering Cost). You can easily display it by your viewer preferences (at least in Firestorm):
I choose to always show avatars complexity, including mine, and I always try to stay low on this.
I am usually around 30K for a full naked avatar, one piece of cloth shouldn't be more than 10K... it should more often be around 1K, unless it has some mesh details, jewels should be rigged and around 1-2K, 10-20K for unrigged ones. A fully defined and clothed avatar shouldn't be more than 100K. I often see some at 200K or more... there is a problem there (mostly because of rigged mesh with all LODs defined).
Automatic computation
Of course, you don't need to create 4 versions of your model each time you build an object. To simplify the process for creators, the viewer as an integrated LOD computation algorithm, based on the number of triangles in the mesh.
That's what the Generate dropdown value is for. You define the triangles limit to compute how many triangles will be put in the model for this LOD, and the viewer guess the best match based on the model definition above. The limit is usually set by default to be under half of triangles of the model above.
You can also choose two other options:
- Load from file: if you defined yourself the different mesh models in your 3D software for different LODs, you can use them directly
- Use LoD above: as the name implies, this LOD will have the same complexity than the model above. Avoid using this except in very special situations.
Rigged vs Non-rigged
There is a big difference on how worn mesh is rendered on the avatar, depending on it's rigging definitions.
Rigging means attached to avatar bones (and moving with them). The viewer has a special way of rendering rigged mesh. It uses only the 2 highest LODs, so Lower and Lowest are never used.
So it's important when you upload rigged mesh to set the triangles limit to zero for those LODs.
Unfortunately the mesh upload window does not do it for you when you choose to include skin weight (rigging). Often that will generate mesh models with very few triangles. I suppose all LOD definitions are needed even if not used.
Beware that rigged does not mean attached! Non-rigged mesh objects attached to an avatar still need all LODs. It's a mistake many did when the trick of zeroing lowest LODs became known. People started to reset them for all attached mesh. That's why you sometimes see unrigged hair displayed incorrectly when zooming out.
For detailed things like jewels, rigging has its importance. If not rigged, you will need all 4 LODs, and as jewels tend to be very detailed, that can bring to a very high avatar cost. Using rigging permits to restrict to 2 LOD models, and it's better if the Medium LOD is not computed but a separate model, to ensure it's well defined with less details.
And for rezzed objects?
As rezzed objects need 4 LOD models to be correctly displayed whatever the distance, it's important to make some tests before uploading. A small object like a spoon will not be viewable from 50 meters or more, so it's safe to disable the lowest LOD by setting it to zero. In contrary, a prefab or something similar in size usually needs to be viewed from far, so the Medium LOD could need to be increased. Use the preview in the mesh upload window, and imagine how far you are from the object when selected each LOD.
Enough for now
I wanted to make a short article to explain this, without spending too much time writing it. But if you have remarks, questions or even better, suggestions for adding information, please don't hesitate and contact me, I might correct/update/fill the article.
Comments
Post a Comment