I have a simple plane I made in Blender, exported to a fbx file and imported to Unity. Then I made a shader, that should allow a two sided textured plane (if I’m reading the past two sided shader discussions right).
Now when I look the plane in the editor, it looks fine. Both sides look like they are supposed to, but when I run the game, the other side is completely black. Is it because of the normals or the lighting or what? I’m kinda new to writing shaders.
Here are some images from the editor:
Here is the shader code:
Shader "Shader test" {
Properties {
_AmbientColor ("Ambient Color", Color) = (1, 1, 1, 1)
_DiffuseColor ("Diffuse Color", Color) = (0, 0, 0, 0)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_SideOne ("Side 1", 2D) = "white" {}
_SideTwo ("Side 2", 2D) = "white" {}
}
SubShader {
Pass {
Material {
Diffuse [_DiffuseColor]
Ambient [_AmbientColor]
}
Cull Off
Lighting On
SetTexture [_SideOne] {
Combine Primary * Texture
}
}
Pass {
Material {
Diffuse [_DiffuseColor]
Ambient [_AmbientColor]
}
Lighting On
SetTexture [_SideTwo] {
Combine Primary * Texture
}
}
}
}