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 toto007 · Oct 17, 2018 at 09:47 AM · mesh renderer

how to progressive rendering a mesh?

Hi guys,

I have a bezier curve on which I draw a mesh. I want to render it progressively. You can see the final result on this video: https://youtu.be/J8oyxfL5IeU

For achieve this result I build the mesh vertex dynamically but I think that this isn't the best method. Is there a better way to do this without rebuild the mesh? For example using a shader or uv map? Unfortunately I am not practical of this subjects.

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

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Oct 17, 2018 at 11:31 AM

Well progressively based on what?


If it should appear based on "time" you can give each vertex a time value when it should be visible. Inside a shader you can use the _Time.y value inside the fragment shader to selectively show parts of the curve. The nice thing is that vertex parameters are interpolated across the triangles so you get an actual cut off line in between.


If it shouldn't be based on time but another provided value it would work the same way, just use your own shader parameter which you can adjust from a script the way you like.


Note using time directly may not give nice results if the time grows too large the precision drops. So using your own "time" which you.


If your mesh does not use uv coordinates you could use those to encode your "time" value. Otherwise you can use any other value like color, uv2, ... Keep in mind that most vertex values are actually float4 even only 2 are used most of the time.

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 toto007 · Oct 17, 2018 at 06:57 PM 0
Share

Can you give me a code example, please?

avatar image Bunny83 toto007 · Oct 18, 2018 at 01:21 PM 0
Share

No, not really since your question is too abstract. However i've posted an example how such fading can be achieved back then over here. The unitypackage which includes the shader and the example scene can be found in the link below my webgl example.


You probably don't need the fading bit, just a cut off. Ins$$anonymous$$d of transparency you can just use clip / discard in the shader. Writing custom shaders is not that hard but you should get familiar with how shaders and the graphics pipeline works. Note that Untiy Answers is not a place to request other people to do your work for you. We don't get paid for our work here.

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

91 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

Related Questions

Combining Mesh's For Mesh Deformation 1 Answer

Objects Appear in the wrong place when built 1 Answer

Cylinder Variance 0 Answers

Lost Lightmap in Mesh Renderer 0 Answers

how to set the uv of the texture(or mesh renderer) 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