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 cadellinman · Aug 21, 2015 at 01:13 PM · meshrenderingparticlestransparencymode

How to make mesh-render mode particles fade out?

I have a particle system that is emitting chunks of rock. These are of course are meshes, using the mesh rendering mode under particle settings, and use a mobile diffuse for performance.

These rocks land on the ground- but then dissappear instantly when they hit the end of their lifetime. I would prefer for them to fade out instead.

The alpha option in color over lifetime doesn't work, because they are being shaded by a mobile shader and not just the color over lifetime thing in the particle window. Does anyone know of a method to make them fade out?

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 _dns_ · Aug 21, 2015 at 03:01 PM 0
Share

Hi, using the alpha of a texture or color would mean the material is "transparent" and this mean sorting + rendering with blending after opaque geometry. This could impact performances, you can try transparent+diffuse shader and modify the alpha over time to see how it impacts performances.

Another option would be to have a alpha-cut shader that is cheaper that real transparent shader. $$anonymous$$aybe animating the alpha or the alpha-cut parameter is possible but I've never tried it. With the right alpha in the texture, you could have a kind of "dissolve" effect with texels disapearing as the alpha-cut value is modified. Some shaders also have this dissolve effect pixel by pixel in screen space using a noise/random texture, it should be nicer than texel-based but I don't know the cost on mobile.

Another option would be to use scaling to make the particles disappear.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by FortisVenaliter · Aug 21, 2015 at 04:01 PM

You need to use a shader that supports Vertex Coloring. Then the shuriken colors will apply to the particle meshes. I think there's a vertex-colored diffuse shader, but not sure if there's one for mobile. You might need to look at both and combine the code to make one that works well for mobile.

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 cadellinman · Aug 21, 2015 at 04:07 PM 0
Share

The game isn't actually for mobile; I was just using the mobile shaders for these chunks of rock for efficiency. There can be about 200 of them in frame, you see. I will see if the vertex colour option works.

avatar image
0

Answer by JesseSmith · Apr 08, 2016 at 10:27 PM

So there is a difference between the alpha value defined by "Color over Time" and the alpha a shader is defining. "Color over time" in Unity's particle system sets the values for a vertex. What you want is to take that vertex alpha and apply it in the shader (as the shader ultimately defines the color/alpha). Here is some example code describing what to do and not do:

 struct Input {
     ​float4 vertexColor : COLOR; //vertex color set by Color over Lifetime
 };
 
 void surf (Input IN, inout SurfaceOutput o) {
     //o.Alpha = _Color.a;   // This will not make the particle's alpha appear to change when rendered
     ​o.Alpha = IN.vertexColor.a; // This will
 }

There is other shader code missing here but the point is you have to get the alpha from the vertex being updated by the particle system and apply it in the shader.

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 borbs727 · Jan 16, 2018 at 03:49 PM 0
Share

I'm about a week into trying out Unity and I could use a little help with some context for this code. Where does it go into the shader code and what's a good shader to edit? To give you an idea of the final effect I'm going for I need emission (with outer glow), cutout, and particle driven alpha fading.

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

28 People are following this question.

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

Related Questions

Particle rendered behind meshes/billboards? 0 Answers

Problems with rendering Particles 0 Answers

Best Method For Best Particles? 1 Answer

how to make an horizontal mesh? c# 0 Answers

Weapon system 0 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