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
0
Question by nerial · Jul 03, 2012 at 12:56 PM · shadermaterialproceduralgradient

procedurally generated gradient

Hello,

I'm procedurally generating buildings. Everything is fine except materials. I want to be able to create gradient by code between vertices.

Let's take an example : I created a simple triangle with three Vertices (1, 2 and 3) :

alt text

I would like to be able to create a not-too-slow gardient by defining different mesh.colors and interpolate colors. For example if I set vertex1 and vertex3 color to red and vertex2 to green, I would like to generate smtg like this :

alt text

I understood you could do that by shaders, notably this one http://unifycommunity.com/wiki/index.php?title=VertexColor, but it doesn't seem to work (everything is white). Basic I imagine, but I'm still quite lost :-)

Thanks in advance !

capture d’écran 2012-07-03 à 11.53.46.png (13.7 kB)
capture d’écran 2012-07-03 à 12.03.02.png (19.0 kB)
Comment
Add comment · Show 2
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 Fattie · Jul 03, 2012 at 02:33 PM 0
Share

"I'm procedurally generating buildings" it seems like the whole world is doing that these days! Heh!

avatar image nerial · Jul 03, 2012 at 02:54 PM 0
Share

yes, I think the word "procedurally" and "generating" together in the same sentence are actually pretty fashionable.

But even if it looks serious and professional, I must confess my buildings are extremely basic procedures :-).

2 Replies

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

Answer by Piflik · Jul 03, 2012 at 12:59 PM

Vertex Colors is exactly what you want. As t why it doesn't work, we'd need more details.

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 nerial · Jul 03, 2012 at 01:42 PM 0
Share

Actually I find some answer here : http://answers.unity3d.com/questions/51283/is-there-a-way-to-make-a-gradient-material-white-to-black-in-Unity3D.html

I tried a particle shader ins$$anonymous$$d of VertexColor on the wiki and it works. I don't know exactly why though...

Unity Docs says "(Note that most builtin shaders don't display vertex colors, you can use eg. a particle shader to see vertex colors)"

Thanks,

avatar image
0

Answer by nerial · Jul 03, 2012 at 03:41 PM

Actually I find some answer here : http://answers.unity3d.com/questions/51283/is-there-a-way-to-make-a-gradient-material-white-to-black-in-Unity3D.html

I tried a particle shader instead of VertexColor on the wiki and it works. I don't know exactly why though...

Unity Docs says "(Note that most builtin shaders don't display vertex colors, you can use eg. a particle shader to see vertex colors)"

Thanks,

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

6 People are following this question.

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

Related Questions

is there a way to make a gradient material, white to black, in Unity3D? 2 Answers

How to avoid Texture.Apply() 1 Answer

Material doesn't have a color property '_Color' 4 Answers

Shader Graph | How to create gradient from scratch 1 Answer

How to properly modify a multi-material object shader? 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