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 /
  • Help Room /
This question was closed Feb 26, 2016 at 10:38 PM by Le-Pampelmuse for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by GarrettShields · Feb 26, 2016 at 09:49 PM · shadershadersvertexoffset

Inside of a shader how can I convert a world direction relevant to a vertex's local position

I'm trying to make a shader for my grass that will allow me to have all the grass blowing in the same direction regardless of its rotation.

This is what I have at the moment (http://puu.sh/nl9l0/ff81760b81.png) alt text

My problem is that I want my grass to blow in the world direction (0, 0, 1), but the vertex offset input is for the vertex's local position. I need a way to make my world direction relevant to the vertex's local position.

Any input/help is appreciated.

grassshader.png (152.2 kB)
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 Le-Pampelmuse · Feb 26, 2016 at 10:43 PM 2
Share

Hi, I'm actually starting to learn shader coding myself and I really need grass that colellectively "bows" in wave patterns, like a world space wind blows over it, not that weird stuttering the unity tree creator shaders have.

Would you $$anonymous$$d sharing your work in progress or if not, point me to some tutorials that explain this well? Browsing through the "writing shaders" sections of the unity documentation gives me a headache since the pages link to each other in a weird cancerlike circle and don't actually explain basic commands needed.

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by GarrettShields · Feb 25, 2016 at 11:58 PM

I ended up solving my problem with help from someone in the IRC channel.

If anyone stumbles upon this in the future with a similar problem you need to multiply your world direction by _Object2World.

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

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Texture offset not working with shader 0 Answers

How to change the alpha value in the vertex color using a shader ? 1 Answer

Modifying shader requires restarting application 0 Answers

How to make the Shader combines two alpha textures ? 0 Answers

Getting Color Generated from Shader to Script to 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