| View previous topic :: View next topic |
Ohms
Joined: 03 May 2009 Posts: 14 Location: France
|
Posted: Wed May 06, 2009 10:36 am Post subject: [SOLVED] Billboard question and two side faces |
|
|
|
Hello everyone,
I have two questions for which I don't find answer in the website.
How can I billboard a mesh ? (I don't know if it's the correct name for unity users, maybe it's rather sprite the good term ?)
So my second part of question, where can we specify that the face on a mesh must be display in one or two sided ? And is it possible to inverse normal directly in Unity Editor ? |
|
| Back to top |
|
|
Ohms
Joined: 03 May 2009 Posts: 14 Location: France
|
Posted: Wed May 06, 2009 3:46 pm Post subject: |
|
|
|
| No-one knows if it's possible and how to do ? |
|
| Back to top |
|
|
aNTeNNa trEE Unity Demo Team

Joined: 30 Oct 2005 Posts: 3539 Location: Unity HQ, Copenhagen
|
Posted: Wed May 06, 2009 5:37 pm Post subject: |
|
|
|
Quite the opposite
The question of two-sided faces has come up so much on this forum that it's a bit of a running joke. But for the uninitiated here's how it works.
You can either:
Duplicate your geometry and flip the normals in your 3D app.
Turn culling off in the shader you're using.
Billboarding... there is a script on the Wiki just for this:
http://www.unifycommunity.com/wiki/index.php?title=LookAtCameraYonly _________________ Ethan Vosburgh - Artist at Unity Technologies
http://twitter.com/antenna_tree |
|
| Back to top |
|
|
VoxelBoy
Joined: 07 Nov 2008 Posts: 181 Location: Istanbul, Turkey
|
Posted: Wed May 06, 2009 5:41 pm Post subject: Re: Billboard question and two side faces |
|
|
|
Hi Ohms,
I don't know if there's an "automatic" way of billboarding meshes in Unity except for trees on Terrain. The terrain engine takes care of billboarding trees for you if you set it up right, but for generic meshes, I'm afraid you would have to do that in your 3D package.
Regarding your question about rendering things two-sided, I'd recommend that you do a Search in the forums for "two-sided" since this has been discussed several times before. I think there are a few shaders that come with Unity that will render things two-sided (such as the Nature Soft Occlusion Leaves material) but for regular use I think you will have to end up making your mesh have a copy of its polygons facing the other way (invert normals) manually in your 3D package, unless you know how to write shaders yourself. Finally, there isn't a way to invert normals in Unity but I assume it would be relatively easy to do with a Script.
Good luck. _________________ Yilmaz Kiymaz - www.yilmazkiymaz.com
Technical Artist
iPhone Developer |
|
| Back to top |
|
|
Ohms
Joined: 03 May 2009 Posts: 14 Location: France
|
Posted: Thu May 07, 2009 9:06 am Post subject: |
|
|
|
Hello thanks to you both,
In fact, to double sided object, I'm surprise of the two method...
1-Double mesh with one with flip normal : So by object two sided, there must be 2 meshes ? (The final file will be probably heavier if I do this no ??)
2-Use a shader to do this. This method seems to be good, but is it possible that the user graphic cards don't support it ?
Sorry to insist, but in fact, I come from a VRML Engine, and I'm surprised that there is no way to do that easily (In VRML, by mesh, there is a boolean property used to specify that)
For billboard it's a few the same thing. In VRML, all objects can billboarded easilly (Just put the shape in a billboard node and our object is a billboard, even it's possible too, to do it by script). |
|
| Back to top |
|
|
Ohms
Joined: 03 May 2009 Posts: 14 Location: France
|
Posted: Thu May 07, 2009 1:22 pm Post subject: |
|
|
|
Hi all,
I have try the script present here: http://www.unifycommunity.com/wiki/index.php?title=LookAtCameraYonly
But I have a matter... My meshes were import from Blender 2.48a. It seems in Unity, all meshes where scale/rotation was applied are import from Blender with a rotation of x=270 (but models are correctly oriented, like on Blender).
So, at the begining it was not a problem for me, why not.
Then, I use on my meshes the script LookAtCameraYonly... But the problem is that when the mesh is render, the billboard is display like if it was not the rotation in x=270, so my billboards models look not at the correctly place...
Did you ever have the same things ? how did you do to bypass this problem? |
|
| Back to top |
|
|
aNTeNNa trEE Unity Demo Team

Joined: 30 Oct 2005 Posts: 3539 Location: Unity HQ, Copenhagen
|
Posted: Thu May 07, 2009 1:38 pm Post subject: |
|
|
|
The easiest solution would be to parent the model to an Empty Game Object and attach the script to the parent. _________________ Ethan Vosburgh - Artist at Unity Technologies
http://twitter.com/antenna_tree |
|
| Back to top |
|
|
Ohms
Joined: 03 May 2009 Posts: 14 Location: France
|
Posted: Thu May 07, 2009 2:02 pm Post subject: |
|
|
|
Hi aNTeNNa trEE,
Thanks for your answer.
I have just tried your idea, for the orientation you are right, it's good, but now, the matter is, that as concerned models have all translation's information, the pivot is not at the center object... so the billboard is not good... Have you got an idea for that ? |
|
| Back to top |
|
|
aNTeNNa trEE Unity Demo Team

Joined: 30 Oct 2005 Posts: 3539 Location: Unity HQ, Copenhagen
|
Posted: Thu May 07, 2009 2:09 pm Post subject: |
|
|
|
Yeah, move the child (model) so that the parent's center is the desired pivot point. _________________ Ethan Vosburgh - Artist at Unity Technologies
http://twitter.com/antenna_tree |
|
| Back to top |
|
|
Ohms
Joined: 03 May 2009 Posts: 14 Location: France
|
Posted: Thu May 07, 2009 2:21 pm Post subject: |
|
|
|
You are again in right . ^^
I thought that it was what I did but in fact no...
thanks a lot !! |
|
| Back to top |
|
|