Difference between revisions of "Mesh/Decomposing a mesh for physics shape"

From Second Life Wiki
Jump to navigation Jump to search
(Replaced content with "{{Multi-lang}} {{Navbox/Mesh|advanced}} {{:Viewerhelp:Upload_Model_-_Physics}}")
 
(23 intermediate revisions by 6 users not shown)
Line 1: Line 1:
__NOTOC__
{{Multi-lang}}
 
{{Navbox/Mesh|advanced}}
[[Image:MeshWalkthrough-Decomposing Physics-Splash.png|300px]]
{{:Viewerhelp:Upload_Model_-_Physics}}
 
This walkthrough will go through how to make the physical shape that can be bumped into.
 
One key thing to understand first is that the model that you see and the model that you bump into can be defined by different meshes. We're ideally looking to make a physical shape that is only detailed enough to give the illusion that you are bumping into the shape that you see, because if the physical shape is extremely detailed, the simulator will slow down when the model collides with objects or avatars.
 
== Obtain a Second Life compatible mesh file ==
The first step is to get a mesh file onto your computer that you want to upload to SL.  SL's mesh import is able to read [https://collada.org/mediawiki/index.php/COLLADA_-_Digital_Asset_and_FX_Exchange_Schema COLLADA] ("''.dae''") files.  For the purposes of creating a physics shape, you can pretty much use any model that you can successfully import into SL, so we'll use the basic duck here.
* Click on this link -- https://collada.org/owl/download.php?sess=0&parent=126&expand=1&order=name&curview=0&binary=1&id=698/ -- to download the "''duck.dae''" COLLADA file.
* Save the file anywhere on your hard drive where you can find it subsequently.
 
 
== Upload the mesh file to Second Life ==
[[File:MeshWalkthrough-Import_Model.png|right|300px|thumb|Import Model Menu]]
Next, take the file that you downloaded to your computer and upload it to SL. (Note that during beta, uploading is free!)
* Open the main menu "''Build''" menu, choose "''Upload''", click "''Model...''".
*: (Alternately, open your Inventory View, click the "''+''" menu button, "''Upload''" > "''Model...''").
*: This will cause a file dialog box will open.
* Find and select the "''duck.dae''" file from your computer.
*: The Import Model window will then appear.
* Click the "''Generate LOD''" button at the top of this window.
*: The viewer will take a moment to process this.
 
[[File:MeshWalkthrough-Generate_LOD_and_set_Physical_Shape.png|300px|Physics Representation]]
* Find the drop down item called "''Physical Shape''", choose "''Triangle Limit''".
*: A text field will appear to enter the triangle limit, and the preview will show a single triangle.
* Type "''500''" into the text field and then hit enter.
*: Note: You can choose a different number, although using a very large number will cause the next steps to take longer to process.  500 is high enough to make a good approximation of the duck shape for most physics purposes.
* A duck will appear in the preview window, at lower resolution than your original duck.
*: This is just the physics representation; it doesn't mean that your duck will appear in-world in that low resolution.
 
[[File:MeshWalkthrough-Physics_Decomposition_window.png|right|200px|thumb|Physics Decomposition Menu]]
* Click the >> button next to "''Physical Shape''" to open the "''Physics Decomposition''" tool window.
* In the "''Physics Decomposition''" tool window, set the "''Decompose Quality''" dropdown to "''Normal''".
* Set the "''Method''" dropdown to "''Surface''".
 
[[File:MeshWalkthrough-Decompose.png|300px|Decomposition Results]]
* Click the "''Decompose''" button.
*: The viewer will take a few seconds to process.
 
* Slide the "''Explode''" slider to see the decomposed shape.
*: Note: The explode slider does not change the decomposed shape, it only moves it away from the Mesh visually so you can see it clearly.
[[File:MeshWalkthrough-Explode_view.png|300px|Decomposition Explode View]]
* Slide the "''Detail Scale''" slider to "''0.075''".
* Set the "''Simplify Method''" dropdown to "''Detail''".
* Click the "''Simplify''" button.
*: The Decomposed pieces are simplified into a few objects.
[[File:MeshWalkthrough-Simplify.png|300px|Simplified Decomposition]]
* In the main "''Import Model''" menu, click the "''Upload''" button to upload the mesh with this simplified Physics Shape.
 
== Add your mesh object to the world ==
[[File:MeshWalkthrough-Physics_Shapes_setting.png|right|200px|thumb|Physics Shape display]]
You can now add your model to the world and view its physics decomposition.
* Find your "''LOD3spShape''" object in your "''Objects''" folder; if you're having trouble or have a large inventory, use your inventory's "''RECENT''" tab view.
* Drag the new object from your "''Objects''" folder to anywhere on the ground where you have permissions to build.
*: A duck model will appear on the ground.
* Enable the "''Develop''" menu by hitting CTRL+ALT+Q or "''Main Menu->Advanced->Show Develop Menu''".
*: A new menu titled "''Develop''" should appear in your main menu bar.
* Enable "''Main Menu->Develop menu->Render Metadata->Physics Shapes..".
* Objects will display with a color overlay:
*: A blue overlay indicates the object's physics are efficient and will produce very little load on the sim.
*: A red overlay indicates the object could potentially cause high physics lag on the region.
[[File:MeshWalkthrough-Physics_Shape_efficiency_visualized.png|right|200px|thumb|Physics Efficiency]]
 
[[Category:Mesh]]

Latest revision as of 13:51, 12 August 2011


KBcaution.png Important: This article has been translated. The translation was imported on Aug 19 2011. Any changes will require re-export for incremental translation.

Level of Detail > Physics > Modifiers > Calculate weights & fees > Upload

This tab is the second step in the model upload process.

A model's physics shape defines how it collides with other objects, and is typically simpler than its visual appearance to reduce computational cost. For example, a complex vehicle model might have a square physical box shape. NOTE: Models meant to be used as vehicles must not have a physics weight higher than 32.

Step 2: Analyze and Step 3: Simplify are not mandatory for creating a physics shape for your model, but can significantly decrease your model's physics weight.

After you make selections in this tab, click the Modifiers tab.

Step 1: Level of Detail

Choose one...   Select a level of detail to automatically generate a physics model based on an existing visual level of detail:
  • Lowest
  • Low
  • Medium
  • High
  • From file (see below)

Lowest or Low are adequate for most purposes and incur a relatively small physics cost.

From file   Select this option to upload your own physical model from a .dae file. This gives you the greatest control over the model's physics shape. Click Browse to select a file.

Step 2: Analyze

Select options in this section, then click Analyze.

Method   Select a decomposition method for the model. Each method is best suited to a particular type of shape, because it will return the most accurate and least costly results for models of that type:
  • Surface - best for curved, organic shapes, such as an animal body.
  • Solid - best for objects with sharp angles and a clear inside and outside, like buildings.
  • Wrap - best for very complex shapes, such as trees and branches.
Quality   Select how much combining and overlap reduction is performed on the hulls at the decomposition stage. High returns the best simplification results, but requires the most time to process. If you experience performance problems, try Preview setting first to confirm your smoothing and select Close Holes, then switch to High to get the best simplification results.
Smooth   Set the tolerance to which coplanar triangles are merged. The value is the angle between adjacent triangles for which merging is permitted. A value of zero allows some angle between triangles, resulting in gently-curving surfaces being flattened.

A lower Smooth setting results in a lower physics cost for objects with curved surfaces.

Close Holes (slow)   Select to fill any holes in the physical representation of the model (if possible) to fix minor errors in the model. Selecting this option will also close intentional openings in objects: do not use for models that have intentional openings, such as door frames.

Step 3: Simplify

Select options in this section, then click Simplify.

Method   Select a simplification method:
  • Retain %: Select a percentage of the hulls to retain from the original analysis.
  • Detail: Reduces the complexity of the physics model based on the Detail Scale slider.
  • Better Detail: Similar to Detail, but does a better job preserving openings in your model.
Passes   Increase this value to create results with fewer overlapping hulls and more accurate overall representation of your model's physical shape.
Detail Scale   Reduce this number to preserve more fine detail in your model during the simplification process. Larger values result in a decreased physics cost, but lower accuracy in the physics model. For many models, most of the simplification takes place at very low values, between 0.0 and 0.3, after which the physics model is reduced to a single hull.
Preview Spread   Move the Preview Spread slider (below the Preview pane) to explode your view of the hulls that comprise your physical model. Make sure the Physics box below the Preview pane is also checked. On objects with many hulls, this can help you to find and examine hulls that would not otherwise be entirely visible.