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 /
  • Help Room /
This question was closed Mar 15, 2016 at 03:04 PM by joshua-lyness for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by joshua-lyness · Mar 15, 2016 at 08:23 AM · shadervertexefficiencyvertex shaderdisplacement

Should I use a shader or conventional code for displacement?

I need to be able to move vertices up and down on a mesh using a brush (the terrain features without using terrain) and I'm not sure if i should do this in a shader or in c#. To create it, i would get the uv co ordinate of the vertex and find the colour of that on the displacement texture (b/w) and then use the value of it to set the height. That sounds like something you could do in a shader, but i have almost no knowledge of how shaders work and so id prefer to make it in c# :) So would a shader be more efficient to implement this, or should i stick with what i know? can shaders even move vertices?? haha sorry for my ignorance ;)

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

  • Sort: 
avatar image
1
Best Answer

Answer by See_Sharp · Mar 15, 2016 at 08:47 AM

Well, I'd go with mesh displacement either way.

Height maps only give an illusion on how something is rendered, so interaction with physics will still be the same as with the 'flat' mesh. You could however, give a little extra depth with a displacement shader, for the sake of graphical looks.

Creating such shaders from scratch is indeed not that easy with no knowledge, while replacing vertices and triangles is much much easier.

Take a look here. It's requires some trial and error to get it to work in the beginning, but IMO, it's super fun to mess around with.

Comment
Add comment · Show 3 · 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 joshua-lyness · Mar 15, 2016 at 10:23 AM 0
Share

Yea ive been using mesh data in combining meshes, its a right pain but I know how to use it. So using a c# script would be worse than a shader? would it be worth learning?

avatar image See_Sharp joshua-lyness · Mar 15, 2016 at 02:01 PM 0
Share

You can't transform vertices with a shader. you'll have to acces it through a C# script.

avatar image joshua-lyness See_Sharp · Mar 15, 2016 at 03:03 PM 0
Share

Ahhh ok, i guess shaders must be read-only then? Like you can read the mesh data but not write to it? Thanks, i think i understand, should be pretty easy in c# :)

Follow this Question

Answers Answers and Comments

53 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

Related Questions

I need help with vertex displacement shader 1 Answer

WebGL displacement shader doesn't work in build 0 Answers

Unity shader vertex displace doesn't work 0 Answers

how to get spot-/point-/..lights working with vertex displacement shader? 0 Answers

RESOLVED: Shader built using Shadergraph's Vertex Color node looks washed out 1 Answer


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