• 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
1
Question by Emericanized · Feb 18, 2011 at 02:16 PM · particleseffect

Alpha Blended Partiles Flickering

I'm wondering if there is an solution for alpha blended particles flickering when I have 2 emitters overlapping.

I require 2 emitters because I need 2 separate textures, and the additive particle materials make the particles wash out!

Any thoughts?

Thanks for your time!

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
4
Best Answer

Answer by Jessy · Feb 18, 2011 at 02:41 PM

You're describing Z-fighting. Add an Offset to the shader used for one of the particle emitters. Just copy the entire shader, and add the single line of code needed for offset. Offset -1, -1 will make the particles render in front, and Offset 1, 1 will make them render behind.

Shader "Particles/Alpha Blended" { Properties { _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 }

Category { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } Offset -1, -1 // This line could be here, or anywhere else before "SubShader". Blend SrcAlpha OneMinusSrcAlpha // ...

http://unity3d.com/support/documentation/Components/SL-CullAndDepth.html

http://www.youtube.com/watch?v=MlLvQxZv3h4

Comment
Add comment · Show 15 · 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 Emericanized · Feb 18, 2011 at 03:36 PM 0
Share

Hands down the best support I've had on a website! Thank you very much!

I don't suppose you know where to find the built in shaders (for copying purposes)? I grabbed the built in shader pack from the Unity site, but that has a bunch of errors, possibly due to being an older version...

In Unity I cant seem to locate: Particles/Alpha Blended" to duplicate it or grab the code.

I looked through the project directories to no avail. Perhaps it's somewhere in the install dir.

Thanks again!

avatar image Jessy · Feb 18, 2011 at 04:22 PM 0
Share

I just tested this and had no problems. I grabbed the file at the link I provided above, added the appropriate shader to my project, and added the Offset line to it. What are you doing differently?

avatar image Emericanized · Feb 18, 2011 at 05:31 PM 0
Share

Hey Jessy, Interesting! I downloaded the .zip package, and took the particle/Alpha Blended out and dropped it into my project. Unity then gave me 3 errors, as follows:

~Shader error in 'Particles/Alpha Blended': Program 'frag', undefined variable "UNITY_SA$$anonymous$$PLE_DEPTH" at line 71

~Shader error in 'Particles/Alpha Blended': Shader program had errors at line 25

~Shader error in 'Particles/Alpha Blended': GLSL vertex shader: ERROR: 0:264: 'fixed4' : syntax error parse error at line 24

I should note that these errors happen before I make any alterations to the shader!

-John

avatar image Jessy · Feb 18, 2011 at 05:54 PM 0
Share

Are you using Unity 2.x? 3.2 yields no errors for me.

avatar image Emericanized · Feb 18, 2011 at 06:12 PM 0
Share

3.1.0f3, pro trial at the moment!

Show more comments

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Does anyone know how to go about achieving slash effects like this? 0 Answers

How can i accomplish fog at the edge of my map. 0 Answers

How to make the ground evaporate? 1 Answer

Built in Glass Stained Bump distort on Particles 0 Answers

how would i do this effect 3 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