- Home /
How to render both sides of a cloth?
I am making a flag which is affected by wind force.
I currently can only see one side of the InteractiveCloth object. I understand that I need to use 2 planes. But isn't there an efficient way to do this? Otherwise, won't it calculate cloth physics for both of the planes?
If culling is turned off, then the shader will display both sides. This is a simple, one line change you can make in the source of shaders. Just add/change "Cull Off" as the first line of a Pass.
I don't want to turn off culling as the lighting will be wrong on the back side. Is there any other way?
You can use a shader that does two passes, one for each side.
Can you use that shared mesh in two materials, one affected by physics and one not, and set the culling of the back face to the other winding?
Seems like it should work, but I don't know enough to be sure.
Answer by Jonny-Roy · Aug 04, 2013 at 07:15 PM
I did this recently, for best results, duplicate your faces either in your 3d editing environment or via a script and flip the normals. Just turning culling off with screw up your lighting (as the lighting uses the normals and they will face the wrong way) and if you create a 2 pass shader you will end up with un-needed extra draw calls.
every face will be affected by the cloth collisions separately and it won't be realistic when some part of the flag wraps around because of the wind's speed and direction. There should be a way to stuck InteractiveCloth between 2 planes and group those planes as 1 so InteractiveCloth can deform and transform vertexes correctly. Can't this be done?
You are only going to duplicate the faces, so each face on the opposite side would share the same Vertices. As the InteractiveCloth updates the Vertices not the Faces, it will act correctly.
Answer by DanJa512 · Dec 21, 2015 at 05:37 PM
Just to document -- having tried just about everything in Unity 5.3, duplicating the geometry has been the closest solution, though both sides are simulated separately leading to "rogue edges" being seen from the other side.
The solution Jonny Roy suggested does NOT work in 5.3 because Unity seems to simulate the cloth based on its normals -- this is what the "surface penetration" value represents, how far negative to resting position the cloth is allowed to move (opposite normal direction), while "max distance" represents maximum distance negative OR positive resting position the node is allowed to move.
Please correct me if I'm misled.
Let's see...
You cannot just duplicate the mesh with normals pointing the other way because then you'll just get 2 separate cloths simulated.
And you cannot have 2 faces to share the same vertices. That's just impossible.
And If you do use Culling Off then you'll get wrong lighting on one side.
So, there's no solution?
Answer by pmurph03 · Feb 14, 2016 at 08:06 AM
Looking into this myself I discovered the only thing that worked for me was instead of using a plane, using a very thin box as the cloth instead to display two sides properly.
Your answer
![](https://koobas.hobune.stream/wayback/20220613111525im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Unity 3.0 Cloth Slingshot Settings 2 Answers
Center a logo on an interactive cloth. 1 Answer
Does Unity cull away unused assets on build time? 1 Answer
Get shadow areas from a plane 0 Answers