• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by flexrails · Dec 03, 2009 at 09:31 PM · shadermaterialgraphicscullingcustom-shader

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)?

Comment
duck
Cyclops
Statement
Faskoona
soulzero
Meater6
Jean-Fabre
Anxo
SisterKy
drawcode
Daniel Neel
hitarthdoc1994
Bunny83
jlangf

People who like this

14 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

  • Sort: 
avatar image
Best Answer

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.

Comment
Michael La Voie
Lucas Meijer 1
flexrails
spencer lindsay
seventyfive
Thaelvyn
Julian-Glenn
Robotron18
knowtheneo
soulzero
BinaryCaveman
Meater6
Jean-Fabre
michael 4
SisterKy
And 10 more...

People who like this

25 Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image duck · Dec 03, 2009 at 10:23 PM 0
Share

actually I don't think the back to back thing wouldn't quite fit your 'mirror inverted' requirement.

avatar image flexrails · Dec 04, 2009 at 12:17 AM 0
Share

duck, thanks! how do i create a two-sided shader? how do i change transparency of the texture material at runtime? thanks, flexrails

avatar image duck · Dec 04, 2009 at 09:53 AM 0
Share

I've updated the answer to include the answers to these questions.

avatar image Wolfram · Aug 03, 2010 at 12:00 PM 0
Share

the back-to-back method with mirroring works, if you use a separate material with textureScale=(-1,1) and textureOffset=(1,0).

avatar image Gillissie · Apr 18, 2011 at 12:35 AM 1
Share

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).

Show more comments
avatar image

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 ;-)

Comment
BerggreenDK

People who like this

1 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

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

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by ADNOC_LNG · Jun 06, 2022 at 03:58 PM

You can solve it by choosing in the Shader field: UI/Unlit/Detail

Comment

People who like this

0 Show 0 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Creating a Material from shader string 2 Answers

Custom shader dissappear on mobile 0 Answers

Standard material shader ignoring SetFloat property "_Mode"? 1 Answer

How to write Diffuse shader with Pass{} instead of surface? 1 Answer

use RenderTexture on a sphere correctly? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges