Pamela Galli Posted April 23, 2013 Posted April 23, 2013 I thought I understood something about size of bounding boxes and LI but don't understand the difference between the two railings below. (I have not made LODs for them yet so expect they will not remain so high.)The one on the Let is just a straight rail, 15 LI ; on the Right, 7 LI, with more geometry and a larger bounding box.Whatever principle applies here I am missing.
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Also, is there a difference between a mesh imported by itself and as one link in a larger build?
arton Rotaru Posted April 23, 2013 Posted April 23, 2013 You will find your answers here. But I'm sure Drongle will chime in and explains it just one more time for you. http://community.secondlife.com/t5/Mesh/Download-weight-and-size-Some-graphs/m-p/1057163/highlight/true#M5561 The answer to your second question is: No 1
Codewarrior Congrejo Posted April 23, 2013 Posted April 23, 2013 About your second question there can be differences between Objects that are:a) in separate mesh items and in a Linksetb) a joined / combined meshc) also when a mesh object is linked to primsThis can lead to differences in the 'download' cost, etc. (which is also part of the calculated LI) (separate objects or one single object behave differently in some of the values) The LI does not only depend on the size of your object or its bounding box size / scale. It also depends on the amount of faces and how low the LOD levels go (the more decreasing they are, from high to low, the better) Then there is also the physics shape. If you took one of the high settings from the algorythms secondlife offers or if you actually build a very lowpoly physics shape yourself can also make quite a difference. 1
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Thank you Arton. I have been looking at those graphs, but as Drongle euphemistically puts it, I don't "like math" (ie don't get it). :-) I was hoping for an English translation of a general principle.
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Thanks Codewarrior. I am uploading my whole house and then checking the LI of various meshes in it. One wall of windows was 6 LI, which seemed too high. Just now I uploaded it by itself, same upload settings, it was 4 LI. So in this case there was a 50% increase in LI by uploading the mesh as part of the house linkset. I will continue experimenting to see if a general principle can be applied and let you know. I don't get physics shapes. I have never understood the point of them. I just make everything "none" and put invisible cubes in the walls.
arton Rotaru Posted April 23, 2013 Posted April 23, 2013 Yeah, I suspected that. :matte-motes-big-grin: I'm afraid though, that there is some math invovled to calculate the bounding box radius of objects. To stick with your example files. The long straight one will probably have a larger Bounding Box radius, than the more squarish one. If the BB radius of the straight one is larger than 5.43 meters, the lowest LOD won't have any effect in the download weight calculation. That is, you could therorethically put the same number of triangles in the Low and Lowest LOD slot, and the download weight will be the same, as when you would blank out the Lowest LOD. The squarish mesh has probably a Bounding Box radius below 5.43 meters. So the Lowest LOD will have an effect in the calculation and the download weight can be lowered compared to the other one, wich only takes the Hi, Medium and Low LOD into the download weight calculation. 2
Codewarrior Congrejo Posted April 23, 2013 Posted April 23, 2013 in addition as you said you didn't make LODs for them, and as i assume you have chosen from the available settings in the uploader the outcome in LI can quite vary, depending on how SL calculates your object and its settings for LOD. (Same with physics) 1
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Oh I get it now, it's the length of the diagonal, not the area of the box!
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Yes I have noticed that uploading using the generated LODs is like rolling dice -- keep rolling til you get a good one. What I am going to do, for lack of a better idea, is upload the whole house using generated LODS, then replace the high LI meshes with individually uploaded meshes that I have made LODs for.
arton Rotaru Posted April 23, 2013 Posted April 23, 2013 Right. Think of you make a prim sphere which covers your object. That is, the corners of the rails bounding box are touching the sphere. Now the distance from the center of the sphere to it's surface is the bounding box radius. 1
Codewarrior Congrejo Posted April 23, 2013 Posted April 23, 2013 Just now I uploaded it by itself, same upload settings, it was 4 LI. yeah unfortunately with the presettings for LODs and other things the results can jump up and down. Sometimes i have that too with the exact same model, and in some cases even with my own LODs.I don't get physics shapes. I have never understood the point of them. I just make everything "none" and put invisible cubes in the walls. The Point of them if for example for Meshavatars having a correct Physic shape (think if i make a big monster and would just use the physics shape of the default avatar, then people could walk through half of my body, because there would be no colision) Another point is that a selfmade Physicsshape can be very very simple and contain very little geometry, and makes the object way 'lighter' so to say in its impact. (plus : less prims to have landimpact) For primboxes each box has 6 sides, and as you maybe already heard the default primitives have a quite heavy geometry (lots faces) because they need to be able to be cut/sliced etc. So when you use a primbox it's not wrong, but it adds up in landimpact as of the amount of prims, and also in rendercosts etc. i.e. for your left fence you could just have a 3 faces / polygons mesh (the front, back, and the top) to build its physic shape. If you use a full primbox to cover it it has unneded sides and the bottom and also way more faces. Makes sense?Additionally they are usefull for moving objects to fit the exact shape, same es for scripted events with collision (think of weapons and bullets being able to 'hit' a target at a shape that represents its actual physic shape or at least very close to it) and many more reasons.Sometimes its a good trick to use a primbox as linked physic shape when the actual object would have a very complex shape and if you don't want to make a complex physics shape to cover it, and to drop landimpact a bit that way. I hope that made it a bit more 'understandable' =) PS: Secondlife uses the HAVOK physics engine. If it interests you how that works here is an overview to havok and collision shapes: http://graphics.ethz.ch/Downloads/Seminar_Arbeiten/2002_03/Havok_Overview.pdf 1
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Thanks, yes, getting warmer :-) I have read this thread a couple of times, but it is as if I forgot how to speak English: http://community.secondlife.com/t5/Mesh/Physics-Costs-v-Server-Costs-For-Simple-Shapes/td-p/1937247/highlight/true Now could I upload physics shapes made of planes separately from the mesh walls and just stick them inside the walls? What is the advantage of uploading them along with the walls as physics shapes? And do physics shapes have the same requirements as LODs, regarding materials and bounding box?
Drongle McMahon Posted April 23, 2013 Posted April 23, 2013 No need for me to comment on the LIs because Arton's explanation is perfect. Using linked prim boxes, undistorted, as physics is very efficient for the engine because it uses havok primitives. That's why the only cost 0.1 weight each. However, it does mean there can be a risk of unlinking or distortions leading to sudden increase in cost if they are editable. If that's nor a concern, they are fine. I prefer the unbreakable shape you get with an uploaded shape. You can upload a more complex physics shape and link it, but then you still have the risks associated with it being unlinkable. The bounding box requirement of a physica sjape mesh is the same as for LOD meshes - they get stretched/squashed to fit the high LOD. There is no requirement for matching materials in the physics mesh (it was there as a bug in some viewers, but that was corrected a long time ago). 1
Codewarrior Congrejo Posted April 23, 2013 Posted April 23, 2013 Now could I upload physics shapes made of planes separately from the mesh walls and just stick them inside the walls? The physic shape would be uploaded 'along' with the model. Just as you do it in the first tab of the uploader where you can choose LOD models to upload from file. You have on the second Tab the physics and can also here choose to upload from file and include this into your object. But of course you 'could' upload it as separate Model - But it wouldn't make sense. Because when you upload it alone - then it also would have no physics shape and just be like your fence, just a non-physical model, and you would need to make a 'physics shape > for your physics shape' in order to achieve this, clearly makes no sense What is the advantage of uploading them along with the walls as physics shapes? That's one of the advantages everything is defines within 'one model / one object', no need for separate prims or additional prims anymore. Means less impact and rendercost and download cost (as its one object) (Unless you make a way too heavy / dense physic shape of course )And do physics shapes have the same requirements as LODs, regarding materials and bounding box? No a physic shape will stay "invisibe" to the renderer. Think of it like an invisible reference that defines where the 'psysical' borders of your object are and the engine knows 'when' something should collide or when being able to 'stand' on something and so on, as soon as something else touches this physical shape. Thus it needs no materials or anything of that kind. Regarding the bounding box. The object will mostly have a similar bounding box size to your model, because you create its simplified shape around / close to your models borders / skin. And you want to think of it as 'very simple' reference of your model's physical shape. Make it as low on polygons and faces as possible. For your fence i.e. a simple 1-face-polygon (quad) would be enough to cover the front of it, the beck of it, and a small long one to cover the top (so one can stand on it , that would make all together 3 polygon quads = 6 Tris. (PS: the side to which the 'normal' points will be the side the engine considers to be 'collideable') To show what i mean: if the left would be your fence; the object with just 3 polygon planes (as one object) on the right side, would be enough to represent your fence. (unless it wouldn't be covered by the pillars on the sides then you'd prolly would want to close it there too, so that people couldn't walk through it from the side) And since mostly noone will walk into your fence from below we also don't need any faces there. Hope that made it again a tiny bit more understandable : ) 2
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Thank you Drongle. By prim boxes you mean regular SL prims, right? I don't really understand about them being editable. I just stick them inside mesh walls; SL doesn't know I am using them for physics shapes does it? Sorry for being so dense about all this, but I have never seen the purpose of physics shapes except for walls. All the furniture I make seems to be fine without ever bothering with physics shapes. House walls are the only place I have needed them, and while sticking cubes inside them works fine, I really need to cut the LI on this current house so am trying to understand some basic principles.
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Thank you Codwarrior - yes, small rays of light are beginning to penetrate, appreciate it! I think what I find most confusing is the idea that, for example, I did not specify this house to have any physics shape at all, yet I collide with it -- most doorways I can't walk through unless I make them "none". I understand "having physics" to mean "you can collide with it". Now, about the rail example. Why would I not just use a plane as physics shape? Does it only provide collision in one direction? Also do I understand Drongle to be saying something different when he says cubes are good for collision? I get confused because it seems like there is some difference of opinion in some threads
Drongle McMahon Posted April 23, 2013 Posted April 23, 2013 Yes. Prim cubes with invisible texture linked to the mesh. One of those has to be the root, so that you can set the physics type of the mesh parts to "none". Then for physics, those meshes cost nothing and each box costs 0.1. Their LI will still be 0.5 each, from the server weight, but whether that matters depends on what the other weights are. This only works if the only changes tob the boxes are stretching. If you alter any other parameters, twist, taper, hollow etc., you will likely get a very larhge increase in physics weight. If you are selling the house no-mod, then there should be no problem with editing, but if it is mod, then an unwise purchaser could edit the hidden prims with something other than stretch and get an increase in the physics weight. In the worst case, this could lead to return of the whole house. He could also accidentally move the linked prims and find phantom walls an blocked interiors. I prefer physics shapes that are part of the mesh so that this sort of thing can't happen, and also because I just find it more intellectually satisfying (don't ask me to explain that!). 3
Drongle McMahon Posted April 23, 2013 Posted April 23, 2013 If you use one plane, the collision isn't very accurate. Triangle based shapes (no "Analyze") can be the cheapest for walls as ling as you avoid small/narrow triangles, but they do have disadvantages. Fast moving avatars can penetrate the surface before the collision is detected. For a single plane, that means occasionally passing through it. If it's two planes, it's possible to collide with the second one and get stuck inside the wall. You can collide with both sides of a single plane. However, I have the dtrong impression that it's easier to penetrate if from the back (that is, traveling in the direction of the mormal) than from the front. That doesn't make much sense to me because physics shouldn' care about the normal. With the convex hulls you get after "Analyze", you will always get pushed out even if you do penetrate to the inside. Don't confuse this with the default convex hull you get for the whole thing when you set the type to Convex Hull. You still have to set the type to Prim to used the "Analyze"d shape. 2
Codewarrior Congrejo Posted April 23, 2013 Posted April 23, 2013 Also do I understand Drongle to be saying something different when he says cubes are good for collision? I get confused because it seems like there is some difference of opinion in some threads He basically said what i mentioned in one of my former answers too, that it can be good at times to use primboxes, to lower the impact. But as he mentions too, it can sometimes also totally flip into the opposite direction and trhe costs increase. The upside when using them is that for the Havok Physics engine (which i mentioned earlier) a cube is the basic primitive and has a fix weight of 0.1. Whilst other shapes are calculated differently. Another downside is that you have to use with prims a new prim-box for each part you want to make 'physical' and collideable. Since only the transparent 'root' primbox is considered as the physical shape. So if you have a fence that bends around the corners you'd need a new boy for each side, whilst you could easily do that with just a few planes as included physics shape. Of course you could 'cut' the cube and hollow it but that makes its shape more complex and as far as i know it breaks the fix calculation of 0.1 weight. Thus a complete physics shape for a model when being included, could be less 'heavy' as having i.e. 40 prim-cubes all over the place. And as he also said, and it's the same for me: it's more conclusive to have it in one object: - to avoid certain issues (like the scaling he described, and the unexpected increase in impact in certain cases) - In all cases where you can't just use a prim (like wearables), or where an included physic shape gives you advantages a linked one can't serve. - In cases where the structure is more complex and a simple cube wouldn't be a good solution to represent it's physical shape. (like the walls of a house where you'd need a lot separate cubes to define all the doors and walls etc) - to be able to have the 'whole' correct physics shape of i.e. a house with its walls, floors, ceelings etc already all in 'one' object. - you have more control over the whole model and its impact by using selfmade physic shapes. And trying to find the best and lowest for your certain model. As conclusion: always try both ways (prim-cube and also own physics shape) and find whats suits best and gives the best results in terms of LI as well as usability (like for a whole model where a single cube won't be enough etc) 1
Pamela Galli Posted April 23, 2013 Author Posted April 23, 2013 Thank you guys for hanging in there explaining -- I know I am a very tough customer when it comes to getting technical information across. Usually at this point is where people throw their hands up. But I still have questions: I don't understand how I would make a physics shape for the entire house when the walls etc are different meshes.
Codewarrior Congrejo Posted April 23, 2013 Posted April 23, 2013 @ drongle: I noticed that too and not only in Secondlife. So I took this chance to dig a bit on the web, what I found is: "...The one item I'll mention in regard to rigid bodies is that they are sensitive to triangle normals... " A quote from an answer regarding havok and terrains. (http://software.intel.com/en-us/forums/topic/287347) I am not 100 percent sure how that implies, or in which ways this inflicts it but it might be the cause. And I think as in some other engines it might just use the surface normal as calculation for the collision normal and the directions the forces take effect (bouncing-off angles etc) And since the normal travels into one direction, this might lead to fluctuations / misinterpreting, or the forces being stronger towards this direction. I might be wrong - but that's how I assume it. Here is another good info PDF regarding physics calculation and normal / surface normal directions: http://ai.eecs.umich.edu/soar/Classes/494/talks/Lecture%205%20Basic%20Physics.pdf (not in regards to havoc but has a lot interesting content) 1
Codewarrior Congrejo Posted April 23, 2013 Posted April 23, 2013 .. throwing hands up? never ! : ) Methods to do that: 1 - take the chance and join your house or big parts of it into one mesh and make the physics shape for this bigger part. 2 make a separate object. Which is i.e. Just simple 6 face box of the size of your house (which you will texture transparent) and apply to this one a physics shape that contains all the walls, floors etc. (Edit - as drongle said: But in this case be aware its a separate object so could be scaled indepently.) But generally best is to join as many parts as possible into one mesh (depending on the limitations of 8 faces / material / texture faces each model can have) that is mostly the 'breakpoint' where i decide to start a new separate mesh. And taking into account that you can have several walls and objects on just one texture / face, you can reach pretty far by having 8 texture faces available. It's all a matter of good planning and playing around with it =) You can easily make bigger parts as one object. (not every wall or floor etc needs to be a separate mesh), and then create your collision shape for this combined object (the walls it has and the floors that are in this certain part) Lets say you can make 1 quarter of your house as one joined object, then you can implement the physics forthis quarter into this part of the model. (instead of having a primcube for each containing wall, floor and so on) and you repeat this for the other 3 quarters of your house. 1
Drongle McMahon Posted April 23, 2013 Posted April 23, 2013 "I don't understand how I would make a physics shape for the entire house when the walls etc are different meshes." It's just like the LOD meshes. You have to have a file with a physics shape (object in Blender) for each of the high LOD meshes (objects). There can be problems making sure the right physics mesh gets attached to the right high-LOD mesh. It's done by the order in the two files. So that has to be the same. Gaia and Co. got the "Sort by Object Name" option into the Blender exporter so that this could be done by using an appropriate naming convention (like mesha_hi, meshb_hi ....; mesha_phys, meshb_phys, ....). If you want to have a single shape (object) that covers several visual objects, then you are stuck with uploading that separately and linking it. That would still work, but with the risk that it can become unlinked oe separately edited. 2
Pamela Galli Posted April 24, 2013 Author Posted April 24, 2013 Codewarrior Congrejo wrote: .. throwing hands up? never ! : ) Methods to do that: 1 - take the chance and join your house or big parts of it into one mesh and make the physics shape for this bigger part. 2 make a separate object. Which is i.e. Just simple 6 face box of the size of your house (which you will texture transparent) and apply to this one a physics shape that contains all the walls, floors etc. (Edit - as drongle said: But in this case be aware its a separate object so could be scaled indepently.) But generally best is to join as many parts as possible into one mesh (depending on the limitations of 8 faces / material / texture faces each model can have) that is mostly the 'breakpoint' where i decide to start a new separate mesh. And taking into account that you can have several walls and objects on just one texture / face, you can reach pretty far by having 8 texture faces available. It's all a matter of good planning and playing around with it =) You can easily make bigger parts as one object. (not every wall or floor etc needs to be a separate mesh), and then create your collision shape for this combined object (the walls it has and the floors that are in this certain part) Lets say you can make 1 quarter of your house as one joined object, then you can implement the physics forthis quarter into this part of the model. (instead of having a primcube for each containing wall, floor and so on) and you repeat this for the other 3 quarters of your house. Due to scripted windows and doors etc, neither of these options would seem to work very well. However, could I have a small cube like up in the attic, with the physics shape for the whole house attached to it? IOW could the bounding box be different?
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now