- Home /
double-sided plane with texture?
how do i create a double-sided plane with a transparent texture on one side, that is visible from the backside as well (mirror-inverted)?
Answer by duck · Dec 03, 2009 at 10:11 PM
There are many ways to do this:
- Create a two sided plane mesh in your 3D editor of choice.
- Use a two-sided shader.
- Use two back-to-back plane primitiveas, parented to a single empty game object, and work with the parent gameobject instead.
Some of the particle shaders are two-sided, such as "Particles/Alpha Blended". This shader will use the alpha channel of the texture you provide for transparency, but you can also fade the shader in and out as a whole by adjusting the alpha value of the Tint Color. You can set the Tint Color in your scripts by using Material.SetColor.
If you want a two-sided version of one of the other built-in shaders which isn't currently two-sided, you'll need to:
- download the Built-In Shader Source files
- duplicate the required shader into your assets
- set (or change) the culling value to "Off"
Then use your new custom shader in your material.
actually I don't think the back to back thing wouldn't quite fit your 'mirror inverted' requirement.
duck, thanks! how do i create a two-sided shader? how do i change transparency of the texture material at runtime? thanks, flexrails
I've updated the answer to include the answers to these questions.
the back-to-back method with mirroring works, if you use a separate material with textureScale=(-1,1) and textureOffset=(1,0).
Duck, how exactly do you set (or change) the culling value to "Off"? I don't see the word "cull" in the shader source (for AlphaTest-Diffuse).
Answer by golgauth 1 · May 08, 2011 at 11:17 PM
Yep, I agree with CULL Off method, but you must avoid Parallax built-in shaders if you don't want to get strange behaviour on the backside. Classical bumpmapping works good ;-)
Answer by username_unity_of_my · Oct 18, 2015 at 01:37 PM
You can use this package on asset store if you like.
http://u3d.as/content/mario-lelas/double-sided-standard-mobile-legacy-shaders
It maybe fit your description. Use standard double sided shader and rendering mode: transparent. It draws double sided meshes with accurate lighting in single draw call and pass.
Video:
https://youtu.be/z-u3CEfgYhY
Answer by ADNOC_LNG · Jun 06 at 03:58 PM
You can solve it by choosing in the Shader field: UI/Unlit/Detail