- Home /
See through mesh from all angles
Hi, I want to import a model of a tent from Maya into Unity, but i keep having problems with the mesh, from the inside of the tent you can see the basic tent, but from the outside, you see through the tents coverings as shown in the image
is there a way to fix this so it looks like a regular tent?
Answer by DaveA · Sep 12, 2012 at 10:08 PM
Probably you have one quad per face of the tent right? You either need to duplicate that and flip it, so each side of the tent has 2 faces (in Maya), or use a non-backface-culling shader.
Answer by ghostreddy · Jan 07, 2013 at 01:08 AM
Open that 3d models in 3dsmax and clone the mesh and flip the normal...thats it :)
Answer by cgcookie · Jan 07, 2013 at 01:19 AM
You need to write Cull Off in the shader, the normals are correct as they are all facing inwards (though outwards would be preferable).
To be extra helpful I've posted a shader below for you ;) it's flat lit but shows what I mean. If you need any specific shader I have a massive collection so I can give you one with the lighting model you need.
Shader "unityCookie/flat texture no culling" {
Properties {
_Color ("Color Tint", Color) = (1.0,1.0,1.0,1.0)
_MainTex ("Diffuse Texture", 2D) = "white" {}
}
SubShader {
Pass {
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
//user defined variables
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform float4 _Color;
//Unity defined Variables
//Base Input Structs
struct vertexInput{
float4 vertex : POSITION;
float3 normal : NORMAL;
float4 texcoord : TEXCOORD0;
};
struct vertexOutput {
float4 pos : SV_POSITION;
float4 tex : TEXCOORD0;
};
//vertex function
vertexOutput vert(vertexInput v){
vertexOutput o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.tex = v.texcoord;
return o;
}
//fragment function
float4 frag(vertexOutput i) : COLOR
{
//Lighting
//Texture Maps
float4 tex = tex2D(_MainTex, _MainTex_ST.xy * i.tex.xy + _MainTex_ST.zw);
return float4(tex.rgb * _Color.rgb, 1.0);
}
ENDCG
}
}
//fallback commented out during development
//Fallback "Diffuse"
}
Save this to a .shader file and it will appear in the material selection menu. I hope this helps!
Your answer
![](https://koobas.hobune.stream/wayback/20220613080944im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why does my character import from 3Ds Max see through? 1 Answer
How to make first person model invisible 1 Answer
Generated mesh not showing up on my laptop 0 Answers
Seeing through mesh 1 Answer
Holes in 3d objects? -1 Answers