Jump to content

[edit] Physics shape?


Nioxous
 Share

You are about to reply to a thread that has been inactive for 4079 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts


OKAY so, I got the first issue handled, and I'm just going to edit this so I don't make another thread. Are there any tutorials out there on how to make a collision/physics mesh? I can't seem to find any at all. Even a basic explanation (I'm vaguely aware using layers is best?) would be useful.

 

 

 

I'm back with another issue (cough).

 

So I put some textures on the house I'm building, and in blender they look great. I started with making vertex groups (living room floor, roof, etc) to easily grab them whenever. Then I'd select a group (making sure the proper faces are selected), create a material for it, and once it was ready, hit 'assign'. Then I'd do a UV unwrap for that material. 

 

Rinse and repeat.

 

Once I upload to SL though, the entire house is covered in one material; the roof tiles. I'm not sure what I did wrong. 

I'm used to blender 2.4+ versions and just popped back onto it recently. I'm adjusting to the 2.66 version and maybe I'm just rusty or missing something really simple. No idea. I've double-triple-quadruple-checked to make sure the roof tile isn't assigned to anything but the roof faces.

I can email the blendfile if needed.

Link to comment
Share on other sites

Okay, through a lot of testing I've discovered something that yourself and others may find quite interesting; there are actually two ways that textures get assigned in Blender and both can methods can be used to export a fully textured object to Second Life in a single collada file.

In the blender collada exporter, there are 2 somewhat vague options that read "Include UV Textures" and "Include Material Textures". By default, when you choose one of the second life presets, UV textures is the only one that ever gets checked.

I suspect that if you unchecked that one and checked Material textures instead, that would fix your problem and you'd see the textures in your upload! This is your easy fix.

That is interesting news because by all accounts that feature was broken! It seems clear to me that the real answer is that people just didn't understand how it worked (which is completely understandable).

But what about that other way to assign textures? Well, to do this you don't even need to assign a material at all. All you have to do is have the UV/Image editor open:

 - Assuming you've already UV unwrapped your object, If you then select all the faces you want to assign to a certain texture, you will see those corresponding UVs pop up in the UV window.

  - If you set those to a texture in the UV window (By pressing the + next to the image name and completing the image creation pop-up) with a set of faces selected, that texture will automatically be set to those faces' UVs. If you don't have textured solid set or you don't know how to set it, you can also set the viewer shading to "textured" by hitting (alt + z). Realize, however that if you don't have a lot of lighting in your scene, your object may appear dark or even black. It doesn't matter whether you can actually see the results in the viewport or not as far as the collada exporter is concerned.

 - If you assign all your UVs to textures this way instead of assigning materials to the UVs, you'll be able to use the exporter using the default settings (Include Texture from UV) because then you will truly be exporting the textures as they were assigned to the UVs.

This can be quite confusing in blender because it is possible to have materials assigned to your UVs and also have a texture separately assigned to UVs. Also, if you texture paint in the viewport, blender -only- recognizes the textures assigned to the UVs. Having material textures and UV textures conflict when attempting certain bake modes like normal or AO baking can cause feedback loops that will stop you dead in your tracks until you unassign the texture from the UVs (You do this by pressing the "x" next to the texture's name). There is no visual way to know if an image is applied to the UVs unless you just start selecting faces with the UV/image editor open, so just generally be careful.

Let me know if this makes sense to you or not.

Edit: I forgot to mention, you have to have "Include Textures" in the Upload Options tab selected for the textures to be uploaded with your collada file when you are actually uploading the mesh in SL.

 

Link to comment
Share on other sites

Please let me add some comments:

Material textures

The option to export textures from materials has been added to the Collada exporter first, because that is indeed needed to transfer the image based materials between different 3D tools. But this option will export all images assigned to all textures on the material's texture stack.

Early articles and tutorials about how to transfer textures to SL all have demonstrated, how materials can be can be used for exporting by assigning image textures to materials, simply because there was no other way to do it. However images in the texture stack are ALWAYS treated (by Blender) as input data for the final rendering.

And because export of material textures to a target engine makes no real sense, this option is disabled in the Export setting for Second life.

UV Textures

UV textures are directly assigned to faces instead of been used from materials. Hence you can see them in the viewport in solid mode. for testing purposes at least. So in order to add a "what you see is what you get" feature to the exporter as well, the exporting of UV textures has been added too. And that is the preferred method to get images exported to your game engine. Especially because now you can setup your materials as complex as you like, then bake your textures to images which in turn are assigned as face textures to your object, and finally export with UV textures.

Where it gets confusing

But there is a caveat which may make things a bit confusing. For Second Life you must define multiple materials for your object to get multiple faces (up to 8). So adding image based textures directly to your materials sort of makes sense too. So users would assign the images to material textures AND to material textures (which creates "feedback loops").

So, there are many ways to get what you want (or what you need). Therefor i can not recommend to do it this way or the other or just export textures on your own (by using "image save as"). But maybe this video can help you to deconfuse:

 

Link to comment
Share on other sites

Thanks guys. Rhakis hit it dead on and it looks great now.

 

Now I just need to figure out how I'm going to make the physics mesh. Doesn't appear that there's a single tutorial out there on making 'em. Looks like you need to use layers or something? 

Link to comment
Share on other sites

Thanks for the clarification Gaia. It was going on midnight for me and I didn't have time to make such a pretty and well organized post, but I'm glad he got the idea.

This is definitely one of those subjects that I don't envy newcomers for. I don't think I could have figured this out on my own a few months ago.

As for the physics shape, that's where things get hairy in large builds like houses. I will stand aside and let someone else try to help you on that one. I'm sure I'll learn something myself.

Link to comment
Share on other sites

Doesn't help that it's been ages (about 2 years) since I've used blender, heh.

I ended up creating a new layer and basically rebuilt the entire house structure with a flat plane (following the floorplan, sort of) then extended it up to the highest point of the house. I'd like to tinker with it, though I'm not sure how you'd go about loading 'em.

My issues are -usually- less about blender and more about how to adapt things to second life, and it seems there isn't a whole lot of info about those things out there.

 

House

 

Ignore the lack of roof for now.

Link to comment
Share on other sites

It looks like you're going about it the right way (The way I'd try to do it, anyway) but like I said before, I have no experience in large physics shapes in Second Life at all. Until someone else steps in, if you have the time, test with what you have now and see what happens.

I could probably be more helpful if you attempted something and took screenshots of any specific issues that came up.

Link to comment
Share on other sites

Here's is something to read, if you haven't already. http://wiki.secondlife.com/wiki/Making_Mesh_Physics

Here's some more to read, if you haven't already. http://wiki.secondlife.com/wiki/Mesh/Decomposing_a_mesh_for_physics_shape

Reading this doesn't hurt as well, if you haven't already. http://wiki.secondlife.com/wiki/Mesh_and_LOD

Don't forget to set the Physics Shape Type to "Prim" under the Features tab in the build floater, in-world.  Or you won't be able to walk inside.

Once you made it work, we can talk about on the options how reduce the physics weight and the ins and outs of doing so, if necessary.

 

Link to comment
Share on other sites

There are lots of posts on houses and physics in this forum. So doing a search for "house" "physics" "building" "can't walk through door"  etc will probably get you some info. 

I can tell you that you will probably have better luck uploading the mesh in PIECES (less physics hassle and less land impact).

 

My sticky note which I refer to when I really need to upload something akin to a house (don't enjoy it ) says:  doorway -
Solid - analyze- physics dae - change to prim in build menu.   That is very obtuse but gives you some more search words anyway.

 

You DO need to build your own physics DAEs which are either planes or cubes and do not TOUCH each other.   I haven't heard any mention of the "layers" you are talking about :D.

Good luck and remember that ADITI grid is your friend :D

Link to comment
Share on other sites

Any advice is always welcome.

 

Arton: I have in fact read all of those, haha. I'm definitely going with my own collision mesh, since decomposing has too much limitation here. I've got closets and pantries (this is a full house) and it's just too delicate to trust the wonky SL collision handling.

So basically I upload my physics shape as a .dae by itself and rez that in game? Do I just drop it inside of the house, or do I need to do something special when I upload either? That's the kind of stuff I get stuck at. I've only barely started using SL (the last few days really) and I'm completely unfamiliar with the interface.

 

Aeon: Yeah, I searched it thoroughly, as well as google. But basic instructions are really hard to find when it comes to SL. Blender isn't so much my issue. 

I've gathered the information you just gave already in regards to prims and building your own dae and so forth and so on, but I can't find a single article that says, "follow these steps to get from point A to point B".

 

Link to comment
Share on other sites

No offense, but if you had read all those you should know how to bring your custom physics in-world. :matte-motes-big-grin: You load it under the Physics tab in the uploader along with your visual mesh.

You can also decompose your loaded custom physics mesh. There are 2 options, leave the Analyze button alone after you loaded your phys mesh, this will end up as a so called "triangle based" physics shape (Probably cheaper in physics weight, but has it's own issues). Or you hit the Analyze button and get a decomposed physics mesh. That is, it breaks up your mesh into a set of convex hulls.

Link to comment
Share on other sites

As Arton says. There is no need to upload the physcs separately. Much better to have it as an integral part of the mesh, which is what you get if you specify it in the physics tab. You are right about the limitations of the decomposer. Here is a picture of the sort of mesh you appear to have used, on the left, and, on the right, the sort of thing you need to get the best results from the decomposer. The secret is that it is made up of unconnected pieces (it's still one mesh though) each of which is already a convex hull, and that there is no touching or overlapping. Using "Analyze" on this with either surface or solid options, should give you what you need without having to use "Simplify", which is where the worst problems come from.

pshape_decomp.png

The alternative, using a triangle-based shape (no "Analyse") is shown here for the same mesh. The secret with these is to use the minimum number of triangles, and especially to avoid small and narrow triangles. That's why all the uneccesary edge faces have been removed here. This kind of shape will generally give lower physics weight than the decomposed version as long as the walls etc are large enough*. Counterintuitively, the weight increases as the sizes of the triangles decrease.

pshape_triangles.png

You can halve the weight by using only a single plane with no thickness, but that makes the collision less accurate. The main problem with triangle-based shapes is that the are a bit leaky, and an avatar (or a moving prim) can occasionally go through a single wall, or can get trapped between the two planes of a double wall, especially if it is moving fast when it collides. Actually, convex hulls, default or parts of a decomposition, are leaky too, but the physics engine pushes you out again if you penetrate into the inside of one. So it's less of a problem.

Whichever you use, you have to remember to make the physics mesh fit exactly the same bounding boz as the high LOD mesh. Otherwise the uploader will stretch it out of shape. Then you have to remember to switch the mesh to physics shape type "Prim"

*Unfortunately there are serious peculiarities in the triangle-based physics weight calculations that make them very unpredictable, but these principles still generally apply. You can read about these problems in other thread (episodes 3 and 4).

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4079 days.

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
 Share

×
×
  • Create New...