- Home /
Hide vertices
Could I do this somehow? How?
Knowing the exact position of the vertex. If I need, I want it not displayed, instead display a biggest polygon between the surrounding other vertices. (So the mesh is still complete, there is no hole). But I want to know the location of the vertex while it is hidden.
Thanks!
Happy New Year! :)
I think we need a visual of what you are trying to do. Unity doesn't display vertices. It displays triangles, and you cannot just remove a vertex without modifying the triangles that use that vertex. You could use a shader that supports vertex colors and set the alpha of the color to 0, but the result will be a hole (which you say you don't want).
I think we dont need a visual we need you to say what your actually trying to do. What I mean is alot of times I notice people have a problem and then they come up with a solution and they come here wanting to know how to implement it, but actually there solution is a bad solution and there is a better one and they should have just asked for help with the problem not the solution.
So Why do you want to remove that vertex?
What is it your trying to achieve.
You could probably try to rebuild that polygon without that vertex and display it over the real one using layers or some other way, but that's just a wild guess.
Answer by HappyMoo · Jan 01, 2014 at 01:50 PM
You want to know all vertices of meshA, so you can scale some meshB so large, that it barely fits meshA? Or you also want to create meshB(That's gonna be harder)?
you can do something like this:
MeshFilter filter = GetComponent<MeshFilter>();
Mesh mesh = filter.sharedMesh;
foreach(Vector3D vert in mesh.vertices)
{
Debug.Log("Jim, we found a Vertex at " + vert + "!");
}
:D
Answer by Balint · Jan 01, 2014 at 03:26 PM
Hi! Thansk for all the comments and answers! I didn't want to tell, why I want to hide vertices, but you all were right, my question didn't have enought information.
So I want to create an automatic cotinous level of detail system. So I want, that the distant object contain fewer polygons, but not with use of different models. I want that there is one mesh, wich is displayed by very few polygons when it is far, and when I go closer, more vertices appear, and therefore more triangles. And I want it happen IN the mesh too, so the closer part of the mesh would be displayed with more polygons, the farther part is displayed with fewer. (It would look like heightmap based adaptive tessellation). I hope, it is clear now, and sorry for language problems.
BTW, Does this exist in any engines?
Happy 2014!
This is actually a hard problem. And believe me, you don't want to go into this if you don't know what you're doing. You need to analyze which Vertex to remove, changes the mesh the least, you need to retesselate the hole you created, you usually don't just want to remove Vertices, but also move others around, or create a whole new $$anonymous$$esh with less vertices, but on top of the high detail mesh etc...
Those algorithms are complex and you don't want to have them run during the game - you rather want something that creates a bunch of meshes for the different LOD levels while in editor and saves them for later use ingame. You can imagine this like baking a light map etc.
You can also go the other way round and start with a low-poly mesh and have tesselation shaders build something more smooth at runtime. Or both ways.
For now, if you need different LODs and want to manage them yourself, I would advise to create them in your favorite 3D software.
I wanted to make an octree based search algorythm, wich removes the vertices, till only on vertex remaina in one cube. Near to the camera, the octree level is higher, far the octree level is lower. I don't want to move the vertices, only remove them, and create a new triange there. ($$anonymous$$aybe It is a bit similyar to voxelise the full visible area in every frame).
So are all of there steps too expensive?
you may be able to remove vertices one by one and also retesselate the hole you open, which is no cheap operation if you do it for every vertex, but... that does'nt make a good LOD algorithm that creates a nice looking mesh with highest likelyhood to the previous mesh.
How do you decide which vertex to remove next? How do you decide that you can't remove the top of a cone if the cone is the only object in the mesh, but can remove the top of a cone if that's just modelling a little detail on the back of a character?
I get that you want what'd be called a continous level of detail system.
So would every single game and engine developer in the world. I don't mean to be discouraging but this problem is basically intractable, at this point were pretty much waiting for either quantum computing to make brute force solving for per vertex removal computationally viable or for PC's to advance to the point that it becomes unnecessary to reduce the poly count even when you have hundreds of high poly objects on screen because the CPU/GPU can process that no problem.
your trying to solve a problem that a whole lot of geniuses have tried and failed to.
Then, raytracing remains... :) It displays only what we need :)
Your answer
Follow this Question
Related Questions
How to use vertex groups in Unity? 0 Answers
How would I display a submesh from a prefab with animations? 0 Answers
Displaying only part of an object 0 Answers
How to hide Cursor on second display? 0 Answers
hypercube animation 2 Answers