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 Jens T · Sep 21, 2010 at 06:28 AM · shaderverticesvertexculling

How do I make a vertex invisible if its X value is > myFloat

I am trying to cut off part of a mesh (coming from a 3D scanner, with a lot of unesscessary surface data).

The problem is basically a Mesh and a box , and everything that sticks outside of the box becomes invisible. Can this be done? This could be done by testing the entire mesh (each vertex) on x values, y values and so on.

I tried looking at shaders and colors, but they require special "Particle shaders" to work. This is a little bit above my head at the moment, so I would be immensely grateful if someone could give me a hint.

PS : Another option is to move all the vertexes outside of this boundary downward or away somehow. Is this simpler?

Best regards Jens

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
1

Answer by Jesse Anders · Sep 21, 2010 at 08:45 AM

I don't have a definite answer for you, but I'll offer a couple of comments.

You might be a bit confused about shaders. 'Particle shaders' are just shaders whose parameters are suitable for rendering particle effects; they're not some sort of fundamental feature of Unity, nor do they really have any bearing on the problem at hand. You can certainly make an object translucent or transparent without dealing with 'particle shaders', and most likely without dealing with shaders directly at all.

Now, whether making parts of your mesh transparent is an appropriate solution here, I really can't say, since I don't fully understand what problem you're trying to solve. If the objective is to remove these parts of the mesh permanently, then that's probably not what you want. If however you want to hide parts of the mesh dynamically, you could do this be changing the vertex colors (assuming you're using an appropriate shader, but I believe there are built-in shaders that will handle this). Note that if the mesh is 'smoothed' (that is, vertices are generally shared), triangles that cross the box's boundaries may end up being translucent (and gradated) rather than fully transparent.

As for moving vertices, if you didn't 'disconnect' the moved vertices by deleting triangles, you'd end up with (presumably large) triangles connecting the 'main' part of the mesh with the 'moved' part, which I doubt is what you want.

You can edit the mesh in whatever way you want via the Unity API, so if you wanted to clip the mesh to the box (either roughly by removing triangles, or exactly by clipping triangles), you certainly could. However, what you describe sounds like it would probably be better handled by a dedicated modeling application (unless you specifically want this to be an interactive, in-game process).

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 Eric5h5 · Sep 21, 2010 at 10:52 AM 0
Share

I suspect the reference to particle shaders is due to most of those shaders' ability to use vertex colors, which the rest of the standard shaders don't use.

avatar image Jesse Anders · Sep 21, 2010 at 01:38 PM 0
Share

That makes sense. I was under the impression there was a shader in the Transparent category that used vertex colors, but I must have misremembered.

avatar image
0

Answer by Eric5h5 · Sep 21, 2010 at 10:52 AM

You might be able to use the shaders in this topic on the Unity forums.

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

No one has followed this question yet.

Related Questions

Vertex Shader problem with _WorldSpaceCameraPos 1 Answer

Setting and storing vertex locations in a shader 0 Answers

How to move vertices up/down randomly in shader. 1 Answer

Shader problem: length() en distance() 1 Answer

Moving vertices in shaders 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