Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 reinabada · Sep 04, 2018 at 07:59 PM · particlesparticlesystemparticle systemaugmented-realitygrass

Change color of particles by distance from emitter

Hi!

I am trying to create a static grass area with particles and I've been researching how to change the color of the particles depending how far are from the emitter, but I had no luck. Because I need the grass to look yellow in the far edges of the grass area.

If you can point me in the right direction or have some similar shaders I will really appreciate it.

Thanks alt text

PD: why I am doing grass with particles? Great question, I am experimenting in ways to make great performance grass area for Augmented Reality in mobile. If you know any other way, let me know!

screen-shot-2018-09-04-at-1.jpg (185.6 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by richardkettlewell · Sep 04, 2018 at 08:06 PM

The only way to do this efficiently is to do it in the shader. You would need to write a custom shader to do it. Then you take the distance from each vertex to the Transform center, remap it to 0-1, and use that to blend the color towards your yellow color.

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 reinabada · Sep 04, 2018 at 08:34 PM 0
Share

Thank you Richard! I will try to do it, I am a bit clumsy with shaders barely touch them but I am willing to try to do what you advise.

avatar image richardkettlewell ♦♦ · Sep 04, 2018 at 09:03 PM 0
Share

A tip: particles don’t set unity_LocalToWorld, so you must send Transform.position to the shader manually from a script. Good luck!

avatar image
1

Answer by telecaster · Sep 04, 2018 at 08:52 PM

not sure if this helps: https://answers.unity.com/questions/1428669/color-of-vertex-based-on-player-distance.html

also there is a way to fake these things. https://assetstore.unity.com/packages/tools/utilities/amplify-impostors-beta-119877 allows hardware instancing which might help.

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 reinabada · Sep 04, 2018 at 09:21 PM 0
Share

Thanks a lot! never used Amplify. Thanks for the suggestions.

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

105 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 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 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 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

Assign random start lifetime for particle system from script 2 Answers

Customising Particle Effects for exploding rocks?? 1 Answer

Is there a way to determine what mesh(es) are used by the particle system when multiple meshes are assigned? 0 Answers

I want to pause and clear a particle system and be able to start it again, but I am using the Sparkle Rising particle which has no Particle System? 1 Answer

Smoke Particle Not Playing Continuously 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