Digital Art Zone

 
   
1 of 2
1
Carrara and Unity Game engine
Posted: 28 February 2013 07:01 AM   [ Ignore ]
New Member
Total Posts:  20
Joined  2005-05-30

Thought I would start a thread regarding Carrara and the Unity Game engine as there appears to be some interest shown in another place.
If you are unaware of Unity, take a look at their website. Unity is free (there is also a paid pro version with more features).

http://unity3d.com

To set the ball rolling, here are a few tips which I have found out.

Carrara – Use the right size

To get Carraras weird idea of what a metre is into unity you need to scale to 255%.
Remember in unity 1 unit = 1 Metre. Not so important for static meshes, but important for physics and characters to get scaling correct in Carrara, rather than adjusting scaling in Unity.

BEST METHOD.
WHEN WORKING ON STATIC OBJECTS. Work in metres throughout. Then group all objects together and do an overall scale of 255%.
WHEN WORKING WITH BONED OBJECTS (CHARACTERS). Create mesh. Then scale up to 255% before adding bones.


The size of the your GameObject’s mesh is much more important than the mass of the Rigidbody. If you find that your Rigidbody is not behaving exactly how you expect - it moves slowly, floats, or doesn’t collide correctly - consider adjusting the scale of your mesh asset. Unity’s default unit scale is 1 unit = 1 meter, so the scale of your imported mesh is maintained, and applied to physics calculations. For example, a crumbling skyscraper is going to fall apart very differently than a tower made of toy blocks, so objects of different sizes should be modeled to accurate scale.

If you are modeling a human make sure he is around 2 meters tall in Unity. To check if your object has the right size compare it to the default cube. You can create a cube using GameObject->Create Other->Cube. The cube’s height will be exactly 1 meter, so your human should be twice as tall.

If you aren’t able to adjust the mesh itself, you can change the uniform scale of a particular mesh asset by selecting it in Project View and choosing Assets->Import Settings… from the menubar. Here, you can change the scale and re-import your mesh.

If your game requires that your GameObject needs to be instantiated at different scales, it is okay to adjust the values of your Transform’s scale axes. The downside is that the physics simulation must do more work at the time the object is instantiated, and could cause a performance drop in your game. This isn’t a terrible loss, but it is not as efficient as finalizing your scale with the other two options. Also keep in mind that non-uniform scales can create undesirable behaviors when Parenting is used. For these reasons it is always optimal to create your object at the correct scale in your modeling application.

Modelling
The direction the model must be facing.
3rd Person character must face to the left in Carraras scene.


Polygons, Bones and all that jazz
Use one Skinned Mesh Renderer
Your character should use only a single skinned mesh renderer. There is usually no reason to use multiple meshes for a character. Unity also has optimizations related to visibility culling and bounding volume updating which only kick in if you use one animation component and one skinned mesh renderer in conjunction. If you care about performance, multiple skinned meshes per character is not an option. If you use two skinned mesh renderers for one character instead of one, the time spent on rendering the character will most likely double!

Don’t Use Many Materials
You also want to keep the number of materials on that mesh as low as possible. There is only one reason why you might want to have more than one material on the character: when you need to use a different shader (e.g. if you want to use a special shader for the eyes). However, 2-3 materials per character should be sufficient in almost all cases. If your character is carrying a gun, it might be useful to have the gun a separate object, simply because it might get detached.

Reduce Amount of Bones
Medium Desktop games use bone hierarchies with 15-60 bones. The fewer bones you use the faster; with 30 bones you can achieve very good quality on Desktop platforms and fairly good quality on Mobile Platforms. Unless you really have to, we strongly recommend you use fewer than 30 bones if you are developing for Mobile Platforms and around 30 bones per character on Desktop platforms.

Polygon Count
How many polygons you should use depends on the quality you require and the platform you are targeting. Anything between 300-1500 triangles on Mobile Platforms and 500-6000 triangles on Desktop Platforms is reasonable. If you want lots of characters on screen or want the game to run on old machines, you will have to reduce the polygon count for each character. As an example: Half Life 2 characters used 2500-5000 triangles per character. Next-gen AAA games running on PS3 or Xbox 360 usually have characters with 5000-7000 triangles.

Profile
 
 
Posted: 28 February 2013 07:40 AM   [ Ignore ]   [ # 1 ]
Member
Avatar
Rank
Total Posts:  86
Joined  2004-09-21

Thanks for the useful information about Carrara to Unity.  I might have to experiment with it a little.  I usually use Blender to create assets for Unity

 Signature 

Master the Muse - Journeys into Creativity
http://www.masterthemuse.com/

Profile
 
 
Posted: 28 February 2013 11:20 AM   [ Ignore ]   [ # 2 ]
New Member
Avatar
Total Posts:  16
Joined  2006-01-07

Awesome Richard! Thanks for the good info.

 Signature 

“Reality is the only word in the language that should always be used in quotes.”- My Life with the Thrill Kill Kult
My website:
http://www.shannonhoppe.com

Profile
 
 
Posted: 02 March 2013 11:50 AM   [ Ignore ]   [ # 3 ]
New Member
Total Posts:  14
Joined  2007-09-14

Thanks Richard. I almost thought I am alone using Carrara+Unity.

Is there any way to transform the procedural shaders of Carrara into Unity ?

Profile
 
 
Posted: 02 March 2013 10:48 PM   [ Ignore ]   [ # 4 ]
New Member
Total Posts:  4
Joined  2008-11-15

Hi All,

I also use Carrara and Unity.
One tip I have is that my luck has been better using .dae over .fbx.
At first, I struggled with fbx files in some cases, and one day tried .dae, and have not had issues since.

One example issue I had with fbx was the coordinate system is not the same as unity (IIRC I tried different settings)
So once you bring it into unity, you have to compensate, and just makes things more difficult than necessary.
DAE solves this.

Also, yes you can use procedural shaders from Carrara, if you get the Baker plugin from inagoni, and bake your shader channels to textures.
For some things, you may want to write some custom unity shaders to handle some of the channels you generate, for example, I have a set of custom shaders to handle things such as specular maps instead of a specular color value.

For the unity side of shaders, I recommend getting Strumpy Shader Editor from the asset store (It is a free download)
It allows you to create unity shaders in a visual node tree environment, and is fast and easy to use.

Regards,
Dave

Profile
 
 
Posted: 02 March 2013 10:51 PM   [ Ignore ]   [ # 5 ]
New Member
Total Posts:  4
Joined  2008-11-15

Oh, and another thing I have found, if you have animation, it works best to put all animated components inside of a single static parent.
When in unity, you can translate the parent around safely, and the parts obey local space scope as expected.
The same can be achieved in unity by placing the imported mesh into a “Container” empty game object.
I generally just use a parent node in Carrara though.

I hope these additional tips help someone.
Thanks Richard Szydelko for starting this thread and for your tips.

Regards,
Dave

Profile
 
 
Posted: 03 March 2013 05:32 AM   [ Ignore ]   [ # 6 ]
Power Member
Avatar
RankRankRank
Total Posts:  1828
Joined  2004-08-24
PLahoda - 02 March 2013 11:50 AM

Thanks Richard. I almost thought I am alone using Carrara+Unity.

Is there any way to transform the procedural shaders of Carrara into Unity ?

You can export as OBJ,. Carrara can convert procedural shaders to texture maps at that point
or,...
You can apply a procedural shader to a plane,. then export that as an OBJ just to get a texture map of the procedural.
or,..
You can get the “Baker” plugin,. which will convert procedural shaders to texture maps, and much more.

Profile
 
 
Posted: 03 March 2013 08:06 AM   [ Ignore ]   [ # 7 ]
Power Member
RankRankRank
Total Posts:  1231
Joined  2004-11-07

I’ve always wanted to work with the unity game engine but it just seemed far to complex for me to understand. :(

Years ago I worked up a western RPG, but I am clueless where to go from there.

Profile
 
 
Posted: 03 March 2013 05:41 PM   [ Ignore ]   [ # 8 ]
Active Member
Avatar
RankRank
Total Posts:  336
Joined  2007-07-31
Richard Szydelko - 28 February 2013 07:01 AM

Thought I would start a thread regarding Carrara and the Unity Game engine as there appears to be some interest shown in another place.
If you are unaware of Unity, take a look at their website. Unity is free (there is also a paid pro version with more features).

Ive looked at Unreal     http://www.unrealengine.com/udk/

Looks impressive but daunting - not too much success getting daz characters into it but checking the Unity website it does seem to have more going for it.

I thought it might be good for general “Movie Making” and wondering what your opinion is on that ?
I will download if you think it would be useful for the above purpose - actually I was surprised to see a lot of discussion about Carrara in their forum.

http://search.unity3d.com/uss1/?q=carrara&app=All

 Signature 

http://bond3d.wix.com/carrarators#!home/mainPage

Profile
 
 
Posted: 03 March 2013 05:49 PM   [ Ignore ]   [ # 9 ]
Active Member
Avatar
RankRank
Total Posts:  336
Joined  2007-07-31
Richard Szydelko - 28 February 2013 07:01 AM


Carrara – Use the right size

To get Carraras weird idea of what a metre is into unity you need to scale to 255%.
Remember in unity 1 unit = 1 Metre. Not so important for static meshes, but important for physics and characters to get scaling correct in Carrara, rather than adjusting scaling in Unity.

In Carrara I work in Metric as default - would that dispense with need of rescaling as above ?

 

 Signature 

http://bond3d.wix.com/carrarators#!home/mainPage

Profile
 
 
Posted: 04 March 2013 04:13 AM   [ Ignore ]   [ # 10 ]
New Member
Total Posts:  20
Joined  2005-05-30

Wow a lot of responses over the weekend.
@ooSeven. Yes even if you work in metric you will have to do the scaling.
3Dage explained this to me once. I can’t remember the exact details. Maybe he can explain it again.
Basically create a cube 1metre x 1 metre, export then import to unity. Create a cube in Unity (default 1metre x 1 metre) and compare it to your Carrara import, they are not the same!
Not used unreal engine, so can’t comment, although I have heard it is much more difficult to use than Unity.

Profile
 
 
Posted: 04 March 2013 03:10 PM   [ Ignore ]   [ # 11 ]
Active Member
Avatar
RankRank
Total Posts:  336
Joined  2007-07-31

Thanks for the reply

This what got me interested in exploring Unity.  http://youtu.be/MKC-gFtM5pE

Its 3 part Daz to Unity video. You probably have seen it -others may not.
Ive always been deterred from using other software in conjuncion with Carrara because of the “usual” asset/formats interchange problems.

is there hope with unity ????

 Signature 

http://bond3d.wix.com/carrarators#!home/mainPage

Profile
 
 
Posted: 04 March 2013 09:54 PM   [ Ignore ]   [ # 12 ]
New Member
Total Posts:  4
Joined  2008-11-15
0oseven - 04 March 2013 03:10 PM

Thanks for the reply

This what got me interested in exploring Unity.  http://youtu.be/MKC-gFtM5pE

Its 3 part Daz to Unity video. You probably have seen it -others may not.
Ive always been deterred from using other software in conjuncion with Carrara because of the “usual” asset/formats interchange problems.

is there hope with unity ????

Hi 0oseven

In regards to your question “Is there hope with unity?”

Yes, I use carrara and unity together, working professionally, making realtime visualization apps (with numerous finished apps under my belt over the past several years).

Our art pipeline honestly is mostly Maya (used by our art team - I am first a coder with art background).

When I work on my own art assets, it is Carrara that I use mostly, along with hexagon. The way I have to handle Maya output and Carrara output is different, but I have had equal success using assets from both. At least one app I can think of offhand, I did all the assets myself, and all was output from Carrara. (It was a very simple flight simulator).

I would gladly share some links so you could see the results I have had, but I would have to get permission from my boss to do so (under NDA).

I hope this helps to answer your question.

Regards,
Dave

 

Profile
 
 
Posted: 06 March 2013 12:38 AM   [ Ignore ]   [ # 13 ]
Active Member
Avatar
RankRank
Total Posts:  336
Joined  2007-07-31

Hi thanks for info.
I’m a bit of a flight sim fan so that would be interesting to see.

Regards Unity I note the video tut relied heavily on decimating daz “characters” to get them into unity. Is that necessary in your experience ?
(need the daz studio decimator plugin of course)
Is it reasonably easy to animate daz characters in Unity - I mean using bvh files etc. ?

I know a bit of Java - nothing of python but anyway don’t really wish to spend time learning either so as I’m not a coder how “necessary ” is it to using Unity ?

 


 Signature 

http://bond3d.wix.com/carrarators#!home/mainPage

Profile
 
 
Posted: 06 March 2013 04:16 AM   [ Ignore ]   [ # 14 ]
New Member
Total Posts:  20
Joined  2005-05-30

As regards DAZ characters, the polygon count is probably too high for games. You will be able to get them into the game and the game will run, but framerate will be affected. Remember game engines render in real time. Efficiency and optimisation is the name of the game in game design. Daz characters are in the region of 80,000 polygons, even the latest games running on high end platforms do not go that high, certainly far too high for mobile platforms such as iphone and android. (see my first post for recommended polygon counts).

There are lots of prebuilt characters available in Unity’s own Asset Store (accessible from within Unity) as well as environments, plug ins etc, specifically designed for use in Unity.

As far as scripting goes, depends on what you want to do. If, for example you created, say a building and you just wanted to walk around. Scripts already exist that come with Unity. (This would entail using a character controller with a couple of prewritten scripts and a camera attached.

To create a more sophisticated game such as, say a Tomb Raider style game, you will need some scripting skills. However there is an awful lot of help in the Unity community in the form of Tutorials, pre-existing scripts to do common things etc.

Unity can use Javascript or Csharp or a language which is similar to python called Boo.
It is worth noting that there are plugins to Unity which allow you to create scripts visually using node based systems (available on Unitys Asset Store). Some are free. worth trying if you really don’‘t want to get into the wonderful world of scripting!

I would recommend also this site, which has some great tutorials.

http://www.3dbuzz.com/training/topic/unity?resetFilters=True

There are also resources such as the link below, which, in this case has all the necessary resources and scripts to easily build a first person shooter game (all you need to do is build your environment). This is excellent and even includes AI editor for your baddies (AND IT IS FREE). The designers (Tornado Twins) have many useful tutorials etc also.

http://www.fpscontrol.com/features

Profile
 
 
Posted: 09 March 2013 12:42 PM   [ Ignore ]   [ # 15 ]
Member
Avatar
Rank
Total Posts:  43
Joined  2003-10-09

Great thread! I am working in a game using Unity and Carrara also. For now I just create a scene using Carrara modified trees and other stuff in the scenario.
Theres a problem using Vic ou other DAZ3D character, you need a special license from DAZ3D to do that. In the past they created a special session in the store for thsi kind of thing. The problem using DAZ3D stuff is that you are selling the mesh with your game, so is very very problematic.
I am building all things in Carrara myself, after draw the ideas by hand or in a tablet.
A real cool thing also is that Terrains in UNity works almost the same way as in Carrara, so I am creating the elevation maps in Carrara, editing in PaintShop and adding to Unity.

Image Attachments
terrain_unity.jpg
 Signature 

Shaders and Freebies for Carrara
http://www.euqfiz.com.br

Profile
 
 
   
1 of 2
1