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 /
This question was closed Mar 28, 2016 at 10:01 AM by greatPasta for the following reason:

Other

avatar image
0
Question by greatPasta · Mar 17, 2016 at 10:35 PM · 2dshaderstransparency

I have transparent shader, but after quad with it material all objects with not default sorting layer are unvisible

I'm doing the fog of war in 2d game. But through the material with shader are visible only objects with sorting layer = default. If i changed sorting layer to something else then object disappeared

Some objects have only sprite renderer. Camera is ortographic.

That is shader which i use

 Shader "Custom/FogOfWarCG" {
     Properties {
         _MainTex ("Base (RGB)", 2D) = "white" {}
     }
     SubShader {
         Tags { "RenderType" = "Transparent" "Queue" = "Transparent" }
         Blend SrcAlpha OneMinusSrcAlpha
         Cull Off
         LOD 200
         Lighting off
         
         pass {
             CGPROGRAM
             #pragma vertex vert_img
             #pragma fragment frag
 
             #include "UnityCG.cginc"
             
             uniform sampler2D _MainTex;
             
             fixed4 frag(v2f_img i) : SV_Target {
                 return tex2D(_MainTex, i.uv);
             }
             ENDCG
         }
     }
     FallBack "Diffuse"
 }

Why this happens?

Comment
Add comment · Show 1
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 Lewwwer · Feb 01, 2017 at 11:45 PM 0
Share

Hi! Have you checked you camera's Culling mask settings? If the layer you are using is disabled in the camera it will not render it.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Make a complex object semi transparent without changing it 2 Answers

I have transparent areas in my sprite, how can they show up as transparent in Unity? 1 Answer

What is the best way to draw a 2D sine wave? 3 Answers

Replicate CSS3 animation in Unity 0 Answers

Prefab's High poly mesh VS lower poly transparency cutout 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