Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
0
Question by pikill1 · May 26, 2016 at 07:53 PM · texture2dblendingquads

How to blend 2 quads in the same location

Hi all,

I know this has probably been answered before so please point me to the right post if so.

I need to blend 2 quads together. One should fade in on top of the other when I call a script function.

The quads are instantiated in a script. I was thinking that one quad could be completely transparent, and then fade in after the function call.

Is that the way to go or is there a better way?

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Eudaimonium · May 27, 2016 at 10:50 AM

Could you describe more what are you trying to achieve, what is your final result?

Normally having two surfaces overlap is a very bad idea (Z-fighting artifacts).

Instead I would recommend using only one plane, but a specially written shader that will blend the two textures you need in a crossfade manner. I can write such a shader for you if you describe what sort of textures you're blending (what effect are you trying to get).

Comment
Add comment · Show 1 · 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 pikill1 · May 27, 2016 at 04:23 PM 0
Share

Thanks, I'm trying to overlay a mostly transparent texture on a base image. In the screenshot, the $$anonymous$$RI is the base and the red dotted lines are in the overlay.

Using your advice, I found some example code: ![Properties {

        _Blend ("Blend", Range (0,1)) = 0.5
         _$$anonymous$$ainTex ("Base (RGB)", 2D) = "white" {}
         _BlendTex ("Alpha Blended (RGBA) ", 2D) = "white" {}
     }
     SubShader {
         Pass {
             // Apply base texture
             SetTexture [_$$anonymous$$ainTex] {
                 combine texture
             }
             // Blend in the alpha texture using the lerp operator
             SetTexture [_BlendTex] {
                 combine texture lerp (texture) previous,
             }
         }
     }][1]


[1]: /storage/temp/70892-screen-shot-2016-05-27-at-102905-am.png

I would like to use the "_Blend" property to fade in the red lines somehow. I've tried a few things but they all affect the background $$anonymous$$RI, which I want to remain constant.

Thanks for the help

screen-shot-2016-05-27-at-102905-am.png (281.7 kB)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

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

blending colors on a texture: shader, render texture, or other 2 Answers

Blending modes of video texture for mobile 0 Answers

Blending two Texture2D 1 Answer

UnityEditor - Drawing on a Texture 1 Answer

ReadPixels requires an offset while in the Editor? 2 Answers


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