Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Creating 3D Game Art for the iPhone with Unity Part 5 pot
Nội dung xem thử
Mô tả chi tiết
Remember, importing to Unity iOS is the goal, and it’s best to match all of
your 3D objects to Unity’s default scale.
Ok, we’ve established that Blender objects are twice as large as Unity iOS
objects and we need to adjust the Scale Factor to 0.5 upon import; however,
there’s a caveat to this setting when working with modo objects exported
from Blender. Remember that our modo objects are twice as small as Blender
objects. If we export our modo-created objects from Blender, then the 0.5
Scale Factor will now become incorrect. Because modo objects are twice
as small as Blender objects, the process of importing and working with the
modo object from Blender acts as a “prescaling operation” when we export
the modo-created object from Blender, it will already be scaled twice as
small and we can then simply set the Scale Factor in the FBX Importer to 1.0
upon importing into Unity iOS. In Fig. 5.3, you can see a modo-created cube
exported from Blender and that it matches the default Unity iOS cube’s scale
exactly with a Scale Factor of 1.0.
So now, we have the correct workflow for sizing our Blender and modo
objects to perfectly match the default Unity iOS scale. You can see the proper
settings in the chart in Fig. 5.4.
Unity iOS Blender Support and FBX Workflow
In regards to Blender animation, Unity iOS supports all nodes with position,
rotation, and scale. Pivot points, you set in Blender, as well as object names
are also imported. Blender’s Bones and Skinned Mesh Animation are also
supported.
Using FBX
Unity iOS will import a “.blender” file and convert it on the back end using
the Blender FBX Importer. However, this is not the workflow that I use with
94
Creating 3D Game Art for the iPhone with Unity
FIG 5.3 Show Modo-Created Cube
Being Same Size as Unity iOS Cube
at1.0 Scale Factor.
Blender and Unity iOS. Instead, I prefer to export the FBX from Blender. The
reason being is mainly personal preference. In my day-to-day work, I mainly
work with modo, Maya, Motion Builder, and Mudbox and have long established FBX to be the best method for sending objects through my pipeline.
I like having the FBX intermediate file available in case I need to take it into
another application and it stops me from having to open Blender to create an
FBX file in these cases.
A major issue I have with Blender is the inability to import an FBX file. Luckily,
I am only using Blender for character animation and this doesn’t pose a huge
problem, but it does make me add an extra step to my pipeline, which is to
export, and OBJ from modo. Once Tater was ready for rigging, I exported an
OBJ from modo so that I could get the model into Blender for rigging and
animation. A big issue with OBJ files is that they only support one UV set.
However, since my character doesn’t contain overlapping UVs and typically,
a character won’t, I only needed 1 UV set. As you’ll recall from Chapter 4, when
creating the level, we needed to have a separate UV because we were using
overlapping UVs for tiling. You can’t correctly create lightmaps with overlapping UVs. With Tater, I didn’t use a lightmap shader in Unity iOS and thus didn’t
need the second UV set. Instead, I baked the lightmap into the diffuse texture
map as shown in Fig. 5.5.
Baking the lightmap into the diffuse texture map is not only a solution to
my multiple UV set issue with OBJ but it’s also a viable solution overall in
regards to reducing texture memory. Instead of using a lightmap shader in
Unity iOS, you can just use a vertex lit shader and one diffuse texture map
as shown in Fig. 5.6. This effectively reduces the number of texture maps
needed for Tater.
The complete workflow for the Tater 3D assets is shown in the chart
in Fig. 5.7.
FIG 5.4 Here You Can See a Chart
that Shows the Different Scale Factor
Settings.
Blender and Collada
Besides the OBJ format,
you can also utilize a
Collada pipeline between
Blender and modo since
both apps can read and
write the Collada format.
95
Animation Using Blender