Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
4
Question by John 26 · Feb 12, 2011 at 10:06 PM · errorshadertransparencyalpharender

Transparency shader problem

I have looked through:

http://answers.unity3d.com/questions/37029/shader-layer-overlapping-problem

as well as:

http://answers.unity3d.com/questions/11821/weird-shader-problem

and

http://answers.unity3d.com/questions/32202/alpha-channel-for-selective-transparency

and tried to use the tutorial at:

http://unity3d.com/support/documentation/Manual/HOWTO-alphamaps.html

The problem is using a .png texture with transparency in a material on an imported .fbx mesh from blender, when changing that material's shader to any form of transparency/diffuse, diffuse bump diffuse, etc, I am having the issue where parts of the model behind other parts are showing through, even though that area should not have any transparency (only the hair planes are intended to be using the alpha to fade out).

My main question is, is this something I, the texture artist, am able to fix (I've tried the steps in the alpha tutorial, saved it out 4 different times in-case I was or was not supposed to hide certain layers, but had no success), will this fall to the 3D model artist, or to our programmer? I am not familiar with shaders, and I am not sure our programmer has a lot of experience with them yet.

Here is an actual screenshot of what is happening (the teenager's model is all I'm concerned with in this picture, I know there is also a fuzzy box I was toying with laying around).

http://i27.photobucket.com/albums/c166/Riaayo/Time%20And%20Again/Transparency_Problems.jpg

Any pointers in the right direction, or some help with the alpha tutorial if I have somehow done it wrong, would be extremely appreciated. I apologize if this question feels to familiar to the others that are similar, but as I am not the sole person trying to solve the problem, I am trying to figure out where the best solution lies, and whom it lies under (Modeler, Texture Artist or Programmer).

Comment
Add comment · Show 7
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 Jessy · Feb 13, 2011 at 05:40 AM 0
Share
  • for checking all those other places first; not everyone with 1 reputation gives the impression that they've really tried to help themselves. I think you forgot to add that link to the teenager model, though.

avatar image John 26 · Feb 13, 2011 at 06:59 PM 0
Share

Thank you! And oh jeese, wow... I took the time to photo-bucket the screen-shot and everything, and as you said, completely forgot to put the url there. Fixed now (the url missing, that is).

avatar image TexeL · Feb 13, 2011 at 08:07 PM 0
Share

Can you paste your shader here ?i'll try to help ! (:

avatar image John 26 · Feb 13, 2011 at 08:22 PM 0
Share

The shader we're using is simply Unity's default "Transparent/Diffuse" and the "Transparent/Bumped Diffuse" shader(s) (more importantly the first, really). I could have sworn I was able to see the default shader's code before, but I'm not able to edit the shader so I can't get the code out of it. Is the default transparent shader a sort of newbie trap so to speak, in terms of not working properly? I'm not familiar with shader code, nor is our programmer, so at the moment we do not have a custom shader we are using for it. I apologize if this is not helpful ): ($$anonymous$$aterial is visible in the SS)

avatar image TexeL · Feb 15, 2011 at 06:31 PM 0
Share

Can't resolve the problom ... :( sorry

Show more comments

5 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Stephan-Tanguay · Oct 26, 2011 at 10:45 PM

If your having this issue with character models or you only require vertex lighting I highly recommend the following shadder!

AlphaVertexLitZ Shadder http://www.unifycommunity.com/wiki/index.php?title=AlphaVertexLitZ

Fixed the issues I was having, hope it does the same for others.,

Comment
Add comment · Show 3 · 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 reppiz01 · Mar 03, 2014 at 09:50 AM 0
Share

thx. helped me out!

avatar image radonthetyrant · Apr 05, 2015 at 05:07 PM 1
Share

Is there a mirror for this? unifycommunity.com seems to be dead.

avatar image coolfireking2 · Apr 05, 2015 at 05:25 PM 0
Share

They moved domains here's the new link: http://wiki.unity3d.com/index.php/Transparent_Alpha_Vertex_Lit_With_Z

avatar image
1

Answer by TexeL · Feb 15, 2011 at 06:30 PM

Here is similar problem ...

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 Wolfram · May 25, 2011 at 07:37 PM 0
Share

Aras' answer in that thread is exactly the answer that belongs here: "No, it is not possible to solve it adequately.", and "Split your object into almost-convex parts, each with its own mesh". Only then can the transparency sorting try its best and solve many/most of your rendering artefacts.

avatar image
0

Answer by Maarten · May 03, 2011 at 09:33 AM

Can you try to use a Transparent/Cutout/Diffuse shader? Then you can change the alpha cutoff

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

Answer by DFLY · Oct 02, 2011 at 10:32 AM

I have the same problem. But I have mad a few observations (please someone correct me if I am wrong).

First the transparency problem only appears to happen if an object that also has transparent textures is behind the first object. If the object behind is a diffuse (not transparent) texture the problem does not seem to happen.

Second the transparency problem seems to be distance related. Once the transparent object is over a specific distance away from the object behind, the problem stops.

I don't have a solution yet. By my workaround is to turn off the transparency when not needed.

eg.

function Solidify() {

 var children : Renderer[];
 children = GetComponentsInChildren.<Renderer>();
 

for (var i : Renderer in children) {

 var childMaterial : Material[];
 
 childMaterial = i.materials;
 for (var j : Material in childMaterial) {
     
     
     
     j.shader = Shader.Find ("Diffuse");
     
     Debug.Log ("Child Material = " +j);
     Debug.Log ("render = " + j.shader); /*GetTexture("_MainTex"));*/
 }

  

Hope this helps. I also hope someone can come up with a better solution.( I suspect the problem is quite deep and related to OpenGL or some such thing.)

Comment
Add comment · Show 2 · 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 redteardrop · Nov 22, 2012 at 05:40 AM 0
Share

This is exactly the issue I am having (http://answers.unity3d.com/questions/352271/shader-causes-triangles-to-dissapear-in-u4-worked.html) it only started when I upgraded to Unity 4, it was working fine in Unity 3.5. I did just refresh my Windows 8 install which might have installed a different direct X or it could be unity 4 or something, but yes, I can confirm a lot of the same things. Layered transparencies are an issue. distance between objects and from camera are an issue. happens will all the transparent shaders, built in or self made really annoying.

Would be nice to get a fix on where the problem is

avatar image Piesk · Oct 31, 2013 at 03:30 PM 0
Share

I am having the same issue, took me quite a while to find this thread as i didn't actually understand the problem at first, does any one know a solution?

avatar image
0

Answer by JonnyHilly · May 07, 2014 at 06:16 PM

old thread, but worth an answer. The problem is your mesh is unsorted, it tries to draw all polygons, but does not sort them before drawing. with a diffuse object, the z-buffer takes care of this... with an alpha object, the z-buffer is ignored, so the polygon draw order is not sorted, so further polygons may draw on top. There is a way to solve this... the shader mentioned above does it... it renders 2 passes... one to set the z-buffer, then another to draw the object. AlphaVertexLitZ Shader shader

If you search around, there are some similar diffuse & vertexlit shaders that do the same thing, though I haven;t found a bump one yet.

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

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Transparent Diffuse Specular Normal Shader problem 1 Answer

(c#) Transparency Problem - Toggle not Gradient 1 Answer

Change blend mode from outside shader? 3 Answers

Changing custom shader. Add alpha cutout 1 Answer

Alpha Transparency Shader Issue 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