Jump to content
Sign in to follow this  
Porky Gorky

Question about physics

Recommended Posts

I've not really played with physics yet but noticed some oddness when uploading some mesh last night so did a little test and am really confused now. 

So I have imported the same .dae file twice. The first time I didnt change anything in the uploader settings, I let the LOD tab auto calculate the levels then imported. That is the plant on the left. The LI is 20

Then I uploaded the .dae again. Again I let the uploader LOD tab calculate itself, but this time I went into the physics tab and on Step one: level of detail I selected 'lowest'. Then imported. This is the plant on the right. The LI is 6

Pysics question.jpg

So the only difference between the  two uploads was the right hand one had physics LOD set to lowest and that reduced the LI by 14!

I don't understand, If anything I was expecting the LI to go up when I added physics. Now I am completely confused.

BTW I repeated the exact same test with the same results so wasn't a random fluke.

Someone please explain to me why adding low level physics reduces the LI by over two thirds?

Cheers.

Share this post


Link to post
Share on other sites

Your mesh always has a physic box. You can actually see the physic box by turning on an option. I forget where tho, Admin or Dev, i think. The less verts you use on your physic box, the lower your Land Impact will be.  Most mesh can quite easily use a simple box as it's physics. It is almost always better to actually make your physic box rather than having the uploader do it.

Share this post


Link to post
Share on other sites

Oh. yeah that makes perfect sense :smileyhappy:

I assumed it was uploading with no physics as the drop down menu on the physics tab said "choose one". Although why I assumed it had no physics is a mystery as I am stood next to the bloody things and couldn't walk through them.

OK we'll put this down to a blonde moment and say no more about it. 

 

ETD this sudden realization is really going to help me get my prim counts down lol.

I shall start making my own custom physics boxes.

Share this post


Link to post
Share on other sites

If you look at the resource weights in the uploader, you'll see which one drives the LI (Hint: it's the highest one).

There's also a checkbox under the preview window that will show you the collision box. You can begin to see why one is more expensive than another. 

As Medhue said, it's almost always better to make your own, either in your modeling tool and loading the file in the uploader, or building a collision shape out of simple prims in a linkset. You will have much more control over the shape, and can optimize the cost for your needs as well.

 

Charlar

Share this post


Link to post
Share on other sites

1 thing you might want to take note. The default setting for a physic box is convex hull, meaning it covers the outside of the mesh like shrink wrap, lol. If you are making a house or something with a hole in the middle, you want to change the physic setting in the Edti Object window to Prim Physics. Also take note that a convex hull physic shape is going to be more efficient and less prims. I hope i got all that right, and it makes sense.

Expanding on what Charlar said, you can also see all the efficiency weights thru the Edit Objects Window, by clicking on the more info (or something like that) in the middle of the window.

Share this post


Link to post
Share on other sites

If you don't specify a physics shape, the default convex hull will be the convex hull of the high LOD mesh. This will ne the physics shape when the physics shape type is Convex Hull, and the Prim shape type will be unavailable.The physics weight you see in the uploader is always that for the default convex hull.

If you do specify a physics shape, that will be used to make the default convex hull that is used when the physics shape type is Convex Hull. Now the Prim shape type will also be available, and what it does depends on whether you used the Analyze button. If you did not, the Prim shape type will cause the physics shape to be the triangle-based shape of the specified physics shape. Its physics weight will depend on scaling, decreasing with increased size (yes I do mean that).

If you did use the Analyze button, then the Prim physics shape type will use the set of (one or more) convex hull generated by the decomposition of your specified physics shape. Either triangle-based or decomposed physics shapes can have accessible holes in their interior. The physics weights of the convex hull based shapes, default or decomposed, do not vary with scaling.

The default convex hull is not necessarily cheap. If the specifying mesh has curved convex parts that appear in the convex hull, the convex hull will have many surface points (that were vertices in the specifying mesh), which makes it have a high weight. Your high LOD tree has some rounded corners that would be included in the convex hull. So that is why it has a high default convex hull physics weight. When you use a lower LOD mesh for the physics shape, the mesh is simpler and there are less points in the default convex hull. So the physics weight is lower. If you made a physics shape that was just a simple cube for each of the rounded cubes, then the default convex hull would be cheaper, and if you decomposed it, each cube would make a simple hull and the physics weight as type Prim would still be quite low, while the collision behaviour would be more realistic than the default convex hull.

It is not always true that the default convex hull is cheaper than the decomposed physics shape. Even the triangle based shape can be lower weight than the default convex hull when it consists only of very large triangles. This is tha case, for example, with 64x64 landscaping meshes. That is fortunate because the triangle-based shape makes an accurately walkable surface, while the convex hull does not (unless the landscape is already a convex hull!).

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Charlar and Med.

I need to take a step back i think. I've been trying to get a big house into SL that I built for a non SL project and have been alarmed at LI costs. Over this past week I've been learning lots about LOD's and opimising my models but i've clearly been overlooking simple things like the physics. I stupidly asusmed that as I know how to 3d Model I could just import into SL with minimum effort.

More the fool me :smileyhappy:

I shall now stop and do lots more testing as each new thing I learn seem to help bring my LI's down. 

Then i'll start on small items and work my way up to large.

Out of interest do you think it would be better to upload large models in smaller parts? i.e. a building that has say a 30m x 20m footprint, should i bring that in as a single mesh or maybe 6 meshes each 10m x 10m. I'm interested purely from an LI point of view here.  

Thanks.

 

Share this post


Link to post
Share on other sites

For effect of size on download weight, see this thread.

A huge mesh will force all observers to download the high LOD version ans consequently has a high download weight. You can generally get a substantially lower total download weight by breaking it into smaller parts. The payoff is that these will switch to lower LODs at closer distances, and not all at the same time. The uncoordinated LOD switching can be disconcerting, but that problem can be mitigated by careful design of the LODs.

Another solution, either alternative or in combination, is to use different sized meshes for different sized details. So you have the main shapes on a very simple big mesh which will stay at high LOD, while the small details are on smaller meshes will switch at shorter distances. That is appropriate as their smaller details cannot be seen from further away.

It's all a mattter of finding the best compromise for the particular thing you are making. One thing to remember is that many people will be using low graphics settings, which means renderVolumeLODFactor is 1.25. It is worth looking at your stuff with that setting so that you can make your choices bearing in mind the needs of those users.

Share this post


Link to post
Share on other sites

I've been experimenting with large builds for my own usage, and yah, if you split your buildings into segments, it can drastically reduce LI.

Something to definitely plan for, when possible, is for interior rooms / surfaces that will be hidden by natural occlusion from outside / longer distances. These can be broken into separate segments, and although their smaller bounding box sizes will mean their LODs switch at earlier ranges than larger sections, IF occluded by the outside structure, you can be REALLY savage on their subsequent LOD2-3-4 meshes - simple flat triangles (one for each material) are often all that are needed - due to the fact that these LOD switches probably won't be visible when they happen (and in most cases, the LOD switches won't occur for AVs moving about INSIDE the structure itself (unless it has massively open interior spaces compared to the bounding box sizes of the interior components visible etc).

From my experience thus far, this has a HUGE reduction on LI, especially if the geometry of the rooms was relatively clean and straight edged to begin with. Rooms which are about 15m x 15m x 7.5m tall, as an example, have tended to come in around 1.5LI to 4LI each in this manner (with basic angular trims on the walls for floors and ceilings, doorways etc). Obviously the more detailed the individual room meshes are, the higher the LI is, but you get the picture... if you can design for interior modules where the LOD switches won't be visible, then you can probably get away with very basic lower LOD meshes.... or if visible through windows, mayhaps model a very basic box shape (with normals facing inward) for wall / floor / ceiling surfaces that will be visible - still very basic, since at the distances they will kick in, the camera will be a fair distance away most likely.

The physics cost for these room segments tend to be very small too - just large flat surfaces to describe the basic contact areas expected, with gaps for doorways. When done as a modular design, the physics blocks will combine neatly with other physics blocks of other adjoining mesh segments, plus the overall physics hull LI tends to be quite small (around 0.5PE or so), generally not affecting the eventual highest LI of the segments.

Another benefit by splitting up builds into components like this, is making better usage of material faces. Each mesh can have up to eight materials assigned, so each room component can have its own eight materials and subsequent textures - very handy for additional versatility.

By breaking up your mesh interiors into components like this, especially if you link them together inworld afterwards to combine LI (decimal rounding), it will save quite a lot of LI. Your exterior is where the LI will tend to be more expensive - mostly because it will be larger overall (if a single mesh) and that you will want it to look good over all distances, which will require more detailed LODs and a higher server weight. But balancing this with the tiny LI interiors, you should be able to get a very acceptable LI overall - especially compared to emulating the same with regular prims.

I hope this helps - have fun! :matte-motes-smile:

  • Like 1

Share this post


Link to post
Share on other sites


Maeve Balfour wrote:

I hope this helps - have fun! :matte-motes-smile:

Your post was incredibly helpful, thank you.

WIth Drongles technical explanation of how LOD scales (with pretty shiny graphs to boot) and your advice on how best to take advantage of this scaling, I now have a completely new plan on how to break down and import buildings into SL.

I normally like to use allot of large open spaces in my builds, especially the modern ones which sometimes need to feel light and spacious. I now realise that the house models I have right now are not suitable for SL without allot of adaptation as they were built for animation and far too 'heavy' for SL. I think for SL I am going to need to plan interiors allot more intelligently and try and guide the camera as an AV moves around the building, so as to not expose the camera to anything that is too far away.

I have a question about this part of your post.


Maeve Balfour wrote:

 IF occluded by the outside structure, you can be REALLY savage on their subsequent LOD2-3-4 meshes - simple flat triangles (one for each material) are often all that are needed

I understand that you need to have the same number of materials on all 4 LOD's, but when you say "simple flat triangles" do you just mean you need to create an object that has enough faces to accommodate the number of materials/textures used? If so, does this need to be about the same size as the main mesh or can it be tiny and hidden as the intention is it wont  ever be seen at lower LOD's?

Thanks again for taking time to post your advice and I would love to be a nosy parker and have a look at your mesh builds some time if you are not apposed to visitors. :smileytongue:

 

 

Share this post


Link to post
Share on other sites

In regards to the simple flat triangles for the LOD2-3-4 meshes, yah, I mean simply that (IF they won't be visible when their LODs change) - I have a simple set of flat triangle meshes in my "library" on my hard drive, from one triangle up to eight, with each surface having a separate material applied... so, when I create an interior mesh where the other LOD's don't matter in appearance, I just choose the relevant one in regards to material requirements to upload (instead of creating them each time). The uploader simply scales them to fit within the bounding box of the LOD1 mesh. Obviously, you need to take care if your interior room is an irregular shape (say, an L-shape) and the subsequent LOD mesh pokes through its edges to match the bounding box (I hope that makes sense LOL). In a case like that, I just reshape and scale the chosen LOD2-3-4 mesh to suit.

With open spaces, I guess it depends on how it is utilised. If the interior space itself is one large mesh, any AV standing within it will never see its LOD change, since they are in close proximity of it while standing within it - the LOD1 mesh will only be visible. Plus, with the large size, the cam distance before it changes will be longer, so less likelihood of it occuring while being visible. I guess it's a balancing act, learning how large things need to be before their LODs switch. As an example, I previously experimented on a large warehouse-like interior as a test, intended for use within an enclosed skybox (so its exterior LODs weren't of concern to me). The interior space is roughly 90m x 60m x about 35m high (at its highest point), built with about 30 or so mesh components (walls, roof spaces, floor sections, stairs etc). Due to each of the components having a relatively large bounding box (although some of them aren't overly huge), as far as I know, while inside the space (and even camming in from outside from reasonable distances), you can't see any of the LODs change. So yah, wide open interior spaces are definitely viable for a reasonable LI - it's just a matter of getting an instinct for when the LODs of the various components will switch, and working around that.

EDIT: Here's rough coordinates to the above-mentioned build (I'm not able to get inworld at the moment for an exact location, but this should give you a close reference (wear a flight feather in case I'm wrong! LOL).

Tintoria/34/126/3902 - I hope this doesn't drop you in the middle of a pillar or something! (Anyone interested is welcome to take a look around).

Please note this is an abandoned build now... so ignore the funky material colours and unfinished texturing. It was an experiment from about three months ago from which I learned some valuable lessons, and have since moved on to newer concepts (modular builds and more efficient UV/material usage, which I will post about for others to benefit from once I get my workflow settled). Anyways, you will be able to get an idea of how an interior space can work - remember, that EVERY mesh object in this build has the flat triangle LOD technique used, so as such, keeps the component mesh LI pretty low overall (although there is always room for improvement). I deliberately didn't have exterior faces on most of the walls etc since I intended to enclose all of this within a skybox exterior - so the transparency wouldn't be easily visible. I think the total LI of the build as it is now is about 94 if I remember correctly. Also, ignore the texture flickering where I experimented with alpha textures on separate mesh overlays - that's a concept I have also abandoned (in favour of modular / repeating texture UVs and materials).

Also, the floor is worth studying - it's an experiment in mixing UV spaces and materials, and taking advantage of SL's texture/face editing inworld. I talked about the workflow in this thread. (NOTE: the main floor area is slightly covered by an invisible prim for faked physics - so you will get a false LI count (getting the prim instead of the floor). LOL, I've since then figured out how to get accurate physic to work for a floor plane like that!

Have fun, and don't trip over any of my debris left lying around LOL! :matte-motes-smile:

Share this post


Link to post
Share on other sites

Thanks very much again Maeve. I visited the build and read your tutorial on how to create the floor, all very informative. I am definitely going to incorporate the idea of modular interiors when designing builds. 

I still can't see how I could effectively create a 100% mesh exterior for a build of that size without pushing the LI through the roof . As someone in the thread mentioned, splitting the whole exterior into modules would result in them appearing at different LOD's as you moved around the outside. I definitely think there would be room for using standard prims here for the main flat surface of the walls then use mesh for everything else like doors windows and any other smaller features. Definitely lots of experimentation to be done I think. 

It's great. I feel excited about building content here again. After nearly 7 years of building in SL it had become routine and restrictive. Sculpts offered a certain level of liberation but I always felt I had one hand tied behind my back throughout the design process. 

I was also worried that the prefab market would be flooded with 3D models "acquired" from the internet, but clearly you can't just upload any old house model into SL and expect to sell it competitively. Those models are going to need to be pulled apart and optimized which is allot of work and in my experience content thieves don't like doing the work bit. I am pleased about that too :smileyhappy: 

Share this post


Link to post
Share on other sites

I built an exterior of a 64x20x20 or so building... 8 prims, it's not finished and it will be more, but the normal prim build it replaces so far was 64 prims. All you really have to model at those sizes is LOD0, the rest can be as small as possible.

Share this post


Link to post
Share on other sites

Great thread folks. After explaining the basics of physics, you went on to cover LoD practice really well. I've tried to explain each several times to people (with varying success) and I believe they're critical for mesh optimization (LI and visual). You gain flexibilitiy and power by understanding how it works and what your options are as a creator. 

While this was generally focused on large objects, I think the concepts can be applied to make smaller objects even more efficient. The key is to think about how far away a given object should be visible. Sculpt furniture (in particular) drives me crazy because it usually breaks down too quickly even in a room of 'normal' size.

I love seeing these new amazing structures, send me slurls or ping me in-world - and let me know if I can post a picture of it or if it's sekrit.

 

Charlar

  • Like 1

Share this post


Link to post
Share on other sites

To help give ideas to fellow mesh builders in regards to the optimisation methods I am exploring, I've now rezzed a duplicate of my current work-in-progress above my prior-mentioned build. It's intended to eventually be some kind of really grungy, modular store based as a sky build (if I ever get around to becoming a merchant LOL). I have always loved the aesthetics of grungy old buildings... it makes for a lot of fun potential for texturing!

Coordinates: Tintoria/43/126/3969

Please keep in mind that I still have a LOT of work to do with this build, and that there are large sections on the lower floor still not filled (hence the empty see-through spaces). Also, ignore the texturing - I've only used a couple of placeholder textures currently - and that you cannot really see how I have optimised the UVs and materials (that will become evident once I start creating specific textures). LOL and also also: Ignore the flickering where I have doubled up on mesh pieces in the modules - I will fix those as I revise things later. Eventually I'll be adding in functioning doors, lots of mesh texture decals etc. The goal is to have an efficient build with as much visual diversity as possible, without massive texture overload.

:matte-motes-smile:

Anyways, this build will give an idea of the modular process I am working towards. Specifically, repeated usage of modular, pre-UVmapped pieces, designed to slot easily into an overall modular build. When I say pieces, I mean exactly that... all the tiny little pieces that make this build are actually UV-mapped prior to construction, and duplicated over and over - with each room module / build section being uploaded as a single mesh. In essence it means efficient texture usage via repeats, time saved on UV-mapping in general, and the ability to mix textures on a per-room module basis via material settings.

NOTE: the floors / ceilings are only standard prims currently - they are just placeholders for now, until I create the relevant sections in mesh (utilising my mixed UV-materials tiling concept).

I have deliberately left this build UN-LINKED... so residents can see the LI of each module and get an idea of the potential savings of mesh over equivalent prim builds, especially with my savage LOD technique. I think there is at least ONE glitchy LOD switch I will need to change later... plus some of the rooms I will change the LOD to interior boxes (where the windows show the change occuring). But it will give some ideas of how LODs can be a massive prim saver. I think currently, the MESH totals of this build come to 51 LI - the majority of the LI cost coming from the exterior window wall due to its size and complexity (but worth it for the aesthetics in my mind - I might be able to reduce this by splitting this section into two meshes).

As I progress, I will update this duplicate build, so anyone interested can check back in and take a look around. Once I get it completed, I'll make a detailed post here in the forums explaining my methodology.

 

Oh, and Charlar: Please, feel free to take pics of my builds mentioned here (over my plot in Tintoria) and post them if you wish. I am not a commercial builder (or rather, have no ambitions of selling constructions like these), so I don't have any "trade secrets" to hide. If my work helps to further SL mesh, I am happy for you to use my examples here. I am honoured!

:matte-motes-smile:

Modular Build 001.png

Modular Build 002.png

Share this post


Link to post
Share on other sites

I strongly endorse this. Thinking in advance about symmetry and replicating pieces before you start, and doing the UV maooing and LODs first, is the greatest modelling time saver there is, especially if you are going to make lower LODs from the high LOD. I can't begin to count the number of times I have deleted practically entire models because I forgot to do this. It's usually either that of hours of mindless repetitive work.

I had a look. Your disappearing interiors (aka super aggressive LODs) work very well even with renderVolumeLODFactor = 1.25.  This is a great LI saver. I guess the only caveat is to keep the disappearing components big enough that they can't disappear while you are inside. The second LOD switch is about 4x as far as the first, so I guess things 4x smaller would still be ok if the drastic LOD was applied at the second step.

The region went down when I tried to stand after sitting on your stairs! I hope that's nothing to do with the meshes.

 

Share this post


Link to post
Share on other sites

Mmmm... things like doors etc I am thinking about in regards to LODs, possibly faking them larger with a tiny triangle placed away from them to force their bounding box larger (just an idea for now - the doors themselves will eventually slide INTO the wall cavities, so the extra triangle won't be seen in normal usage.

My apologies about the Sim going down - I can pretty much assure you it ISN'T due to my meshes LOL... just unlucky timing on your part. As far as I know, I have never had my region crash while I have been there (fingers crossed).

Also, I will be redoing the physics for the stairs later - currently the sides are basic, so you end up sitting on air if you dont sit on a pillar, but since their LI is lower than the overall mesh LI (I think it was about 1.5 for the stairwell module), I will add some extra physics detail for more accurate sitting. Details, details I know.... but I am fussy like that!

Thanks for looking Drongle! I hope the sim behaves itself for you next time! :matte-motes-wink:

Share this post


Link to post
Share on other sites


Maeve Balfour wrote:

Mmmm... things like doors etc I am thinking about in regards to LODs, possibly faking them larger with a tiny triangle placed away from them to force their bounding box larger (just an idea for now - the doors themselves will eventually slide INTO the wall cavities, so the extra triangle won't be seen in normal usage.

Won't that mess up the physical shape of the doors? On a simple object like a door (assuming it's a simple box) I'd go with more detail on the lower LoDs. A (mesh)box won't press on your landimpact, staying at LI 1. It ofcourse depends on how many doors you want in a single object, I can imagine you can combine a couple since they are sliding. All you need is 6 faces with 12 verts for a (sliding) door with some volume, you could have 4 faces with 8 verts for a lower LoD, I can't imagine that will push the impact over 1.

  • Like 1

Share this post


Link to post
Share on other sites

"...a tiny triangle placed away from them to force their bounding box larger..."

That would work, but at the same time it would increase the download cost (rightly so, because it causes the high LOD to be seen over a larger area). Windows are a special case because you can use alpha texture billboards very effectively for the low LODs to reduce download weights.  Here are some windows I made a long time ago. They all have two rectangles that carry the alpha texture at the lower LOD. At the high LOD, the frame parts of the alpha texture are covered by the solid frames. At the low LOD, the high LOD frame texture is carried on a tiny hidden triangle, although this will not be necessary if the subset bug gets fixed.

The thirteen windows and doorframe on the right are all one mesh. As it is large, with a distant LOD switch point, the medium LOD uses the alpha texture only. It has a current LI of 5 (it was 1 when I made it early in the beta!). To the left are three windows that use the same high and low LOD meshes. The difference is that the largest uses the high LOD mesh only at the highest LOD, the middle on uses it for medium LOD too, and the smallest uses it for low LOD as well. Each is stretched to about as large as it can be while keeping the LI at 1 or less. That gave about 17x34, 8x4 and 4x2 meters.

For later windows I have used a third LOD where the internal parts of the solid frame disappear at the first LOD point, and the outer frame at the next.  You can also accomodate bevels at the highest LOD that disappear at the second LOD. I suppose I could reduce the LI further by omitting the inside facing rectangle in the lowest LOD, as that will never be seen from the inside, but that would be a problem if you could see in through one window and out of one opposite. The opposite window would have no glass or frame. It would avoid any alpha stacking glitches though, although I never noticed any with this kind of window.

Note also that these windows have rounded tops, that have many triangles, greatly increasing the download weight. Plain rectangular windows using this technique should have much lower LI even than these. The main cost of this approach is that you have to have a specific texture for each style of window. While the frames use a stock texture, the low LOD cannot, as the frames must coincide with those in the solid model.

windowegs.jpg

 

  • Like 1

Share this post


Link to post
Share on other sites

Kwakkelde and Drongle: Thank you for the pointers - all very valuable and useful! So many things can combine to keep LI down, while maintaining visual appeal - which is why I love mesh so much!

I haven't really experimented much with LODs yet for smaller objects (such as mesh doors) - so both your tips are extremely helpful to my design process. And I love your windows concept, Drongle - will definitely explore that more. I will probably pull apart the window wall in my build and redesign it in a few combined meshes, just to make use of that concept (and free up valuable material space for greater texture options as well).

Will tweak further on the weekend... back to work for me (RL work! Monday is already well under way in my part of the world LOL) sigh....

:matte-motes-smile:

Share this post


Link to post
Share on other sites

Don't confuse physics with clipping.  All objects, physical or not have a clipping setting (phantom), if physical or not, if it's set, you can walk through it, and if not, you cannot.  Physics deals with gravity and collision detection.  One might argue collsion detection and clipping are the same thing, but they are not.  Clipping deals only with weather or not two objects can occupy the same point or not, and don't take velocity and angle of impact into consideration, where collision takes all 3 into consideration.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...