Assimp: Difference between revisions
From Spring
Jump to navigationJump to search
m →Assimp Textures: actually link to assimp section |
Carrepairer (talk | contribs) →Blender Workflow Tutorial: Fixed page, the number indexes were all wrong. And the third photo is not a lamp, it's a camera. |
||
| Line 16: | Line 16: | ||
=Blender Workflow Tutorial= | =Blender Workflow Tutorial= | ||
This is a stub containing a simple outline of a Blender workflow | This is a stub containing a simple outline of a Blender workflow. | ||
# Open an existing Blender model or import a different format through the File menu (File > Import). | |||
# In the 3D view, drag out the secret panel from the right. [[File:3-12-2013 5-02-21 PM.png‎‎|secret panel]] | |||
# In that panel, select Display > Shading > GLSL. [[File:3-12-2013 5-02-04 PM.png‎‎|display settings]] | |||
# Make sure you have a lamp in your scene while in this mode or your model will be dark. | |||
# Applying texture: | |||
## In the UV/Image editor, click the image icon (Tooltip: Browse Image to be linked) to select your texture. If it's not there, click on Image > Open Image to browse for it. | ## In the UV/Image editor, click the image icon (Tooltip: Browse Image to be linked) to select your texture. If it's not there, click on Image > Open Image to browse for it. | ||
## In the 3D View, select (right-click) your object and hit Tab to enter Mesh Mode. | ## In the 3D View, select (right-click) your object and hit Tab to enter Mesh Mode. | ||
| Line 55: | Line 38: | ||
### Under Image Sampling, check Normal Map. | ### Under Image Sampling, check Normal Map. | ||
### Under Influence > Geometry, check Normal. Make sure it.s 1.00. | ### Under Influence > Geometry, check Normal. Make sure it.s 1.00. | ||
## You'll need to do this for each piece. | ## You'll need to do this for each piece. | ||
# Piece hierarchy: | |||
## Select piece A, hold shift and select piece B. Hit Ctrl+P and it will make piece A a child of piece B. | ## Select piece A, hold shift and select piece B. Hit Ctrl+P and it will make piece A a child of piece B. | ||
## Make sure all the pieces are descending from one single piece. | ## Make sure all the pieces are descending from one single piece. | ||
| Line 68: | Line 49: | ||
### Click on the dropdown "Pivot Center for Rotation/Scaling" and select Individual Origins. | ### Click on the dropdown "Pivot Center for Rotation/Scaling" and select Individual Origins. | ||
### Rotate. | ### Rotate. | ||
## | ## Do this for all your pieces. | ||
# Preparing for Spring: | |||
## Select your root piece. | |||
## Press Shift-C to put the 3D cursor in the center of the world. | |||
## Click on the dropdown "Pivot Center for Rotation/Scaling" and select 3D Cursor. | |||
## Rotate your whole model so that it's -90 degrees. You can do this by typing "R X -90". This will make your model lie on its back. | |||
## Click Object > Apply > Rotation & Scale. | |||
# Save your model. | # Save your model. | ||
# Select all the pieces of your model, ignore the lamp. | # Select all the pieces of your model, ignore the lamp. | ||
# Click on File > Export > Collada. | # Click on File > Export > Collada. | ||
# Check "Export Only Selected" and export. | # Check "Export Only Selected" and export. | ||
# The dae file will be used as your object. | # The dae file will be used as your object. | ||
Revision as of 19:07, 26 April 2013
Development < Game Development < Assimp
Assimp
Open Asset Import Library (short name: Assimp) is used in Spring for loading a number of model formats including Collada & 3ds (currently obj is parsed by a different codepaths).
What Spring supports in its Assimp renderer:
- extended metafile (
%modelfilename%.luanext to the modefile) - still uses tex1 & tex2 texture system of S3O (same shader as S3O)
- 2nd texcoord
- loading of the texture filepaths from the model (don't have to be in
unittextures/) - when texture filepaths aren't included in the model, it searches for
%modelfilename%.*&%modelfilename%2.*inunittextures/ - special modelpieces `SpringHeight` & `SpringRadius`
Assimp Textures
See Units:Textures (Assimp Section)
Blender Workflow Tutorial
This is a stub containing a simple outline of a Blender workflow.
- Open an existing Blender model or import a different format through the File menu (File > Import).
- In the 3D view, drag out the secret panel from the right. secret panel
- In that panel, select Display > Shading > GLSL. display settings
- Make sure you have a lamp in your scene while in this mode or your model will be dark.
- Applying texture:
- In the UV/Image editor, click the image icon (Tooltip: Browse Image to be linked) to select your texture. If it's not there, click on Image > Open Image to browse for it.
- In the 3D View, select (right-click) your object and hit Tab to enter Mesh Mode.
- Hit A to select all your faces.
- In the 3D View, hit A to select all the faces there and select your image with the image icon. Assuming there's a UVMap, you should see your texture.
- If you don't see any faces you'll need to add the UVMap to a new texture:
- In the Properties view click on Textures (checkerboard icon).
- Click on Add New Texture (plus icon).
- Select Type = Image or Movie.
- Under Image, click on the image icon and choose your image file.
- Under Mapping, select Coordinates = UV.
- Under Influence > Diffuse, check Color and make sure it's 1.00.
- To add a normalmap:
- Repeat steps 5.1 to 5.5.
- Under Image Sampling, check Normal Map.
- Under Influence > Geometry, check Normal. Make sure it.s 1.00.
- You'll need to do this for each piece.
- Piece hierarchy:
- Select piece A, hold shift and select piece B. Hit Ctrl+P and it will make piece A a child of piece B.
- Make sure all the pieces are descending from one single piece.
- Setting piece origins:
- Select a piece.
- Place the 3D cursor where you want the origin to be (left-click).
- Click on Object > Transform > Origin to 3D Cursor.
- You can now rotate your pieces:
- Click on the dropdown "Pivot Center for Rotation/Scaling" and select Individual Origins.
- Rotate.
- Do this for all your pieces.
- Preparing for Spring:
- Select your root piece.
- Press Shift-C to put the 3D cursor in the center of the world.
- Click on the dropdown "Pivot Center for Rotation/Scaling" and select 3D Cursor.
- Rotate your whole model so that it's -90 degrees. You can do this by typing "R X -90". This will make your model lie on its back.
- Click Object > Apply > Rotation & Scale.
- Save your model.
- Select all the pieces of your model, ignore the lamp.
- Click on File > Export > Collada.
- Check "Export Only Selected" and export.
- The dae file will be used as your object.