meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
expgame [2022/01/20 10:05] croftexpgame [2023/11/07 09:31] (current) steph.jorgensen
Line 1: Line 1:
-======Exporting to Game Formats======+======Games export options======
  
-In game versions of the SpeedTree Modeler, you have the option of exporting to a selection of "Game Editor" formats. These exports differ from [[expstaticmesh|static mesh exports]] in that the geometry is batched and optimized for real-time rendering, texture atlases are created to allow fewer draw calls, and billboard impostors are rendered for use with LOD. Currently, the exporters for [[impue4|Unreal Engine 4]], [[impunity|Unity]], and [[imply|Lumberyard]] all use this dialog, as well as for the SpeedTree SDK in custom game integrations. In the Indie and Full Games Modeler, you may also export trees prepared in this style to a few static mesh formats, such as FBX, OBJ, and USD.+You can export to a selection of game editor formats. With game exportsthe geometry is batched and optimized for real-time rendering, texture atlases are created to allow fewer draw calls, and billboard impostors are rendered for use with LOD. 
  
-{{ :exportgamedialog.png?400&nolink |}}+To export a model for games, select **File** > **Export to mesh** then choose the Games export type.
  
 +For command line export options, refer to [[export_from_the_command_line|Export from the command line]].
  
 +=====Export type=====
  
-=====LOD=====+^**Type**^**Description**^ 
 +|**Games**|Export a model with options optimized for games.| 
 +|**VFX**|Export a model with options optimized for VFX. Refer to [[expstaticmesh|VFX export options]].|
  
-These options set which type of geometry from the tree to include: the fully 3d geometry LODs, the billboard LOD, or all of it+=====Preset===== 
 +You can choose a game preset to simplify the export process and make sure the export settings are correct for the format
  
-Geometry LODs are what you are editing when you make a treeYou can adjust the number of LODs, how the tree changes as it goes down in LOD, and the smoothness of these changesPlease see the [[kclod|Level of Detail]] section for more information.+^**Preset**^**Description** ^ 
 +| **Unity** | Optimizes the export for Unity
 +| **Unity (one draw call)** | Optimizes the export for Unity and limits it to one draw call. | 
 +| **UnrealEngine (ST)** | Optimizes the export for Unreal Engine and exports the .st file type. | 
 +| **UnrealEngine (ST9)** | Optimizes the export for Unreal Engine and limits it to one draw call. Exports the .st9 file type.  | 
 +| **SpeedTree SDK** | Optimizes the export for the SpeedTree SDK or static mesh formats
 +|**Generic FBX**| Export a generic FBX for use in any game engine or DCC application.|
  
-If you enable billboards to be exported, one new LOD is added at the end of the LOD transition. This LOD is a very simple mesh made of pictures of the tree rendered from different views. These billboard pictures are all placed into a billboard atlas. All the same material maps that are exported for regular geometry are exported for billboards, so it can fit into your normal rendering pipeline. The game engines handle removing the views that are not facing the camera, and you are left with a simple picture of the tree in the distance. With this method, you can have very dense forests at real-time speeds. +====Preset options====
  
-{{ :billboard_maps.png?nolink |}}+^**Control**^**Description**^ 
 +|**Save new preset**|Save the current export settings as a new preset.| 
 +|**Edit preset name**|Edit the name of the current preset.| 
 +|**Delete preset**|Delete the current preset.| 
 +|**Load options**|Load previously saved export options from an .ini file.| 
 +|**Save options**|Save the current export options to an .ini file.|
  
 +=====Show atlas=====
  
-=====Include=====+At export time, if you are not happy with the automatically-generated atlas layout, you can edit it by clicking the button in the top right of the export dialog. If multiple atlases are being exported, you can choose which one is being displayed.
  
-This section of the dialog features options for extra things that may be included during export+{{edit_atlas.png?nolink&300}}
  
-==Variations== +The tools for editing are translate, rotate, scale uniformly, and scale non-uniformly. Once a tool is selected, simply click on a texture in the atlas and drag the mouse to perform the action.
-[[toolmaterialsassetsbar|Variations]] may be set up in the material. This option enables the processing of variations on export. Instead of requiring the final game engine to have shader code that does the variation, the exporter will simply make new materials and textures with the variation information baked in+
  
->**Note**: Variations should be used sparingly on real-time SpeedTree models to avoid too much extra texture space being used. If atlassedthe variations of a material will take up multiple places in the atlas. If notadditional textures will be made.+>**Note**: With manual editingit is possible to cause overlapping textures in the mapwhich will not work correctly in the exported file.
  
-==Vertex blends== +=====Options=====
-Vertex blending is used on small pieces of geometry that need to blend, such as  the intersection of a branch to its parent or stitches to a parent mesh. This is done using vertex alphas to fade it out. If the engine does not support per-vertex alphas, or if z-buffer problems are causing the seam blends to flicker, then you may disable this. Even without per-vertex alphas (and thus a hard line where the material changes), the blend pieces usually add to the realism of the tree by hiding the actual branch intersection.+
  
 +====File type====
  
-==Leaf references== +You can choose a file type compatible with [[impue4|Unreal Engine 4]], [[impunity|Unity]], and [[imply|Lumberyard]], as well as the SpeedTree SDK for custom game integrationsYou can also export trees prepared in this style to a few static mesh formats, such as FBX, OBJ, USD, and raw XML.
-Leaf References are null objects in the correct position and orientation for each leafThese can be used to populate the leaves with higher quality meshes at runtime, or perhaps for use with mesh instancing.+
  
-==Bones/Skeleton== +>**Note**: Some of the export options change depending on the file type you choose.
-Some formats, such as FBX, allow you to include bone weighting for further deformation.+
  
 +=====Combine=====
  
-=====Atlas=====+These options are only available when more than one SpeedTree file is open in the Modeler.
  
-Atlassing is the most important aspect of preparing tree for real-time renderingPutting multiple materials into the atlas allows the geometry that uses them to be merged, resulting in fewer draw callsWith aggressive mergingyou can make an entire tree that renders in one draw call.+^**Property**^**Description**^^ 
 +|**Combine all open trees**|Export all open files in the Modeler and combine them into the same atlas. || 
 +|**Atlas name**|Assign root name to the exported atlases.|| 
 +|**Tree filenames**|Set a naming convention for the exported model files.|| 
 +| :::              | **Sequential** | All model files have the same root name as the current file and are numbered in sequenceFor exampleOakTree_1 and OakTree_2.|  
 +| :::              |**Tree name**| All model files have the same name as their original .spm file|
  
-|None|This option does not make an atlas. Each material will export its textures separately| +=====Grouping=====
-|Non-Wrapping|This option looks at the geometry using each material. If the UVs on the geometry fit within 0-1, then its material will be put into the atlas. Geometry that uses wrapping UVs or otherwise has UVs outside of 0-1, such as branches, will be exported as separate textures| +
-|Everything|This option puts every material in the entire tree into the atlas. Any geometry that has UVs outside 0-1 will be unwrapped before going into the atlas. Without being cognizant of this, you could end up with a suboptimal atlas layout. Enabling V-wrapping (see below) helps branches to not take up so much of the atlas when their UVs are outside 0-1.| +
-  +
-==Allow separate atlases==+
  
-If you have set materials to go into different atlases on the [[toolmaterialsassetsbar|material asset bar]]this option can let you enable or disable that functionality+These options set which type of geometry from the tree to include: the fully 3d geometry LODs, the billboard LOD, or all of it
  
-==Allow V wrapping==+Geometry LODs are what you are editing when you make a tree. You can adjust the number of LODs, how the tree changes as it goes down in LOD, and the smoothness of these changes. Please see the [[kcgameslod|Level of Detail]] section for more information.
  
-When geometry has UVs outside 0-1, they need to be unwrapped in order to be placed in the atlas. If they aren'tthese UVs may start referencing the textures surrounding its material in the atlasHowever, some things may wrap UVs lot, such as branchesIf these were unwrapped and placed in the atlasthey would be so much bigger than everything else, it would result in a suboptimal atlas layoutAlsosince you have maximum billboard atlas size, you may lose a lot of texture resolution as the whole UV space is squeezed into the atlas.+If you enable billboards to be exportedone new LOD is added at the end of the LOD transitionThis LOD is very simple mesh made of pictures of the tree rendered from different viewsThese billboard pictures are all placed into a billboard atlas. All the same material maps that are exported for regular geometry are exported for billboards, so it can fit into your normal rendering pipelineThe game engines handle removing the views that are not facing the cameraand you are left with simple picture of the tree in the distance. With this method, you can have very dense forests at real-time speeds
  
-This is where the V-Wrapping option can help. When enabled, anything that wraps in the V direction will get placed in the atlas such that its top and bottom edge touch the top and bottom of the atlas. Thus, V-wrapping UVs will work just fine and you keep much more of the texture resolution. You still need to be cognizant of U-wrapping, but since branches wrap a lot in V and not so much in U, this is a great feature when putting branches into an atlas+{{billboard_maps.png?nolink}}
  
-See the picture below for an example of a one-draw-call tree where everything has been placed into the atlas, utilizing V-Wrapping so as not to lose texture resolution on the branches.+=====Include=====
  
-{{ :tree_atlas.png?nolink&200 |}}+This section of the dialog features options for extra things that may be included during export. These options vary by the chosen file type.
  
-==Separate Materials==+====Lightmap UVs====
  
-When placing materials into an atlas, these materials get merged together. While they use the same textures, sometimes you may want to split the materials based on a number of factors. For example, a common situation is that leaves need to be two-sided but branches should cull backfaces. Enabling "Separate Materials" will split up the materials based on the things that do not get written into the textures. For now, this is just the two-sided flag.+Compute and include unique UVs for lightmapping.
  
-==Ignore smooth LOD==+Available for all options but OBJ.
  
-When exporting to formats that split the geometry up for different vertex shaders (such as .ST for UnrealEngine4), smooth LOD may impact your total draw calls because leaves LOD differently from branches. If you are not using SpeedTree-style LOD with vertex morphingyou can choose to ignore smooth LOD requirements for different types of geometry and get the fewest number of draw calls.+====Vertex blends==== 
 +Vertex blending is used on small pieces of geometry that need to blend, such as  the intersection of a branch to its parent or stitches to a parent meshThis is done using vertex alphas to fade it out. If the engine does not support per-vertex alphasor if z-buffer problems are causing the seam blends to flicker, then you may disable this. Even without per-vertex alphas (and thus a hard line where the material changes), the blend pieces usually add to the realism of the tree by hiding the actual branch intersection.
  
 +Available for all options but OBJ.
  
-=====Geometry=====+====Vertex color====
  
-These options modify the output geometrysuch as flipping and rotating it for a particular coordinate system. In most of the game-specific exporters, these are either disabled or pre-filled with the most common values for that particular engine.+Override the model’s vertex colorsincluding the alpha (transparency) value.
  
-In FBX and USD, there is a new option to pack the vertex color how you wish it. Each channel of the final color can be set to a variety of options, to facilitate a mesh version of the tree going into your particular engine. Common setups include (R,G,B,Blend) and (R,G,B,AO).+Available for all options but OBJ.
  
-{{ :packcolor.png?nolink&200 |}}+====Bones/Skeleton==== 
 +Some formats, such as FBX, allow you to include bone weighting for further deformation.
  
-In formats that support itsuch as STSDKthis is also where you would supply the [[vertexpacker|vertex packer]] used on tree and billboard geometry.+Available for FBX and XML. 
 + 
 +=====Transform===== 
 + 
 +These options modify the output size and geometry of your model. You can keep the current scene unitconvert to a different unitchange the scale, or flip and rotate the model for a particular coordinate system.
  
 =====Textures===== =====Textures=====
Line 83: Line 106:
 These options deal with the creation and writing of all the textures needed for the tree during export. These options deal with the creation and writing of all the textures needed for the tree during export.
  
 +====Packing====
  
-==Format==+Game exporting uses the concept of texture packing, where the material maps used in the Modeler are merged, compressed, or otherwise prepared for use in the final game engine. Every engine requires a different texture setup, and we include a number of them with the Modeler. You are able to switch between them easily, even to [[texturepacking|custom ones you write yourself]].
  
-This option sets the format of the exported textures. For some game engine, this format is locked to the commonly-used format (usually PNG or TGA).+====Format====
  
-==Size==+This option sets the format of the exported textures. For some game engines, this format defaults to the commonly-used format (usually PNG or TGA). 
 + 
 +====Size====
  
 With the size options, you can set the size of the atlas, the size of the billboard atlas, and the max size of any other texture written. With the size options, you can set the size of the atlas, the size of the billboard atlas, and the max size of any other texture written.
  
-==Packing==+====Include variations==== 
 +[[toolmaterialsassetsbar|Variations]] may be set up in the material. This option enables the processing of variations on export. Instead of requiring the final game engine to have shader code that does the variation, the exporter will simply make new materials and textures with the variation information baked in. 
  
-Game exporting uses the concept of texture packingwhere the material maps used in the Modeler are merged, compressed, or otherwise prepared for use in the final game engineEvery engine requires a different texture setupand we include a number of them with the Modeler. You are able to switch between them easily, even to [[texturepacking|custom ones you write yourself]].+>**Note**: Variations should be used sparingly on real-time SpeedTree models to avoid too much extra texture space being used. If atlassed, the variations of a material will take up multiple places in the atlasIf notadditional textures will be made.
  
 +=====Atlas=====
  
-=====Atlas Editing=====+Atlassing is the most important aspect of preparing a tree for real-time rendering. Putting multiple materials into the atlas allows the geometry that uses them to be merged, resulting in fewer draw calls. With aggressive merging, you can make an entire tree that renders in one draw call.
  
-At export time, if you are not happy with the automatically-generated atlas layoutyou can edit it by clicking the button in the top right of the export dialogIf multiple atlases are being exported, you can choose which one is being displayed.+^**Control**^**Description**^ 
 +|**None**|This option does not make an atlas. Each material will export its textures separately| 
 +|**Non-Wrapping**|This option looks at the geometry using each material. If the UVs on the geometry fit within 0-1then its material will be put into the atlas. Geometry that uses wrapping UVs or otherwise has UVs outside of 0-1, such as branches, will be exported as separate textures| 
 +|**Everything**|This option puts every material in the entire tree into the atlasAny geometry that has UVs outside 0-1 will be unwrapped before going into the atlas. Without being cognizant of this, you could end up with a suboptimal atlas layoutEnabling V-wrapping (see below) helps branches to not take up so much of the atlas when their UVs are outside 0-1.| 
 +  
 +====Allow separate atlases====
  
-{{ :edit_atlas.png?nolink&300 |}}+If you have set materials to go into different atlases on the [[toolmaterialsassetsbar|material asset bar]], this option can let you enable or disable that functionality. 
  
-The tools for editing are translate, rotate, scale uniformly, and scale non-uniformly. Once a tool is selected, simply click on a texture in the atlas and drag the mouse to perform the action.+====Allow V wrapping====
  
->**Note**: With manual editingit is possible to cause overlapping textures in the mapwhich will not work correctly in the exported file.+When geometry has UVs outside 0-1they need to be unwrapped in order to be placed in the atlas. If they aren't, these UVs may start referencing the textures surrounding its material in the atlas. Howeversome things may wrap UVs a lot, such as branches. If these were unwrapped and placed in the atlas, they would be so much bigger than everything else, it would result in a suboptimal atlas layout. Also, since you have a maximum billboard atlas size, you may lose a lot of texture resolution as the whole UV space is squeezed into the atlas.
  
 +This is where the V-Wrapping option can help. When enabled, anything that wraps in the V direction will get placed in the atlas such that its top and bottom edge touch the top and bottom of the atlas. Thus, V-wrapping UVs will work just fine and you keep much more of the texture resolution. You still need to be cognizant of U-wrapping, but since branches wrap a lot in V and not so much in U, this is a great feature when putting branches into an atlas. 
  
-=====Exporting From the Command Line=====+See the picture below for an example of a one-draw-call tree where everything has been placed into the atlas, utilizing V-Wrapping so as not to lose texture resolution on the branches.
  
-Full SpeedTree Games also has the option to export tree from the command linewithout ever opening the GUIThe command line options are shown below.+{{tree_atlas.png?nolink&200}} 
 + 
 +====Separate materials==== 
 + 
 +When placing materials into an atlas, these materials get merged together. While they use the same textures, sometimes you may want to split the materials based on number of factors. For example, a common situation is that leaves need to be two-sided but branches should cull backfaces. Enabling "Separate Materials" will split up the materials based on the things that do not get written into the textures. For nowthis is just the two-sided flag. 
 + 
 +====Ignore smooth LOD==== 
 + 
 +When exporting to formats that split the geometry up for different vertex shaders (such as .ST for UnrealEngine4), smooth LOD may impact your total draw calls because leaves LOD differently from branches. If you are not using SpeedTree-style LOD with vertex morphing, you can choose to ignore smooth LOD requirements for different types of geometry and get the fewest number of draw calls.
  
-|  -h|Show help/options | +=====Billboard=====
-|  -export_game <file>|Export the loaded spm file to the specified mesh file (fbx, obj, or abc) | +
-|  -export_options <file>|Set options for exporting using the indicated ini file | +
-|  <any other file>|The SPM filename to open |+
  
-The export options .ini file you can pass on the command line is the same one you can save using the button in the bottom left of the export mesh dialog. In this manner, you can use the Modeler to set up how you wish files to be exported at a later date.+Determine how to treat billboards in the exported file
  
->**Note**: On Windows, if you run the .exe directly, the command line will return immediately and may not receive output from the process until it finishes in the backgroundIf you wish to get feedback from the Modeler, use one of the following methods:+^**Control**^**Description**^^ 
 +|**Faces**|Set how many faces to render on a billboard.|| 
 +|**Top down**|Include top-down faces in the billboard.|| 
 +|:::|**Top down height %**|Set where to put the top-down geometry in the billboard mesh (from bottom to top).|
  
-| cmd|start /WAIT <exe> <arguments>+=====Format-specific=====
-| PowerShell|Start-Process -Wait -FilePath <exe> -ArgumentList '<arguments>' |+
  
 +When exporting an animation, different cache formats have options that will appear in this section.
  
 +These options are available for USD and SpeedTree SDK exports.
  
 +=====Extra=====
  
 +^**Control**^**Description**^
 +|**Show summary**|Shows a summary of the export settings when the export completes.|
 +|**Skip texture save**|Doesn't save the textures to disk.|