Thanks for the reply! I am sad that you won't open source this but I understand you point and that is fair. I still had a few more questions:
I am confused about how exactly you are deleting the edges to make the mesh. You stated:
Removing edges is relatively straightforward. However, we need to be careful to keep track of which edges we have already removed as to not accidentally remove an edge of a face that is already a quad. The rule for this is simple: when we remove an edge between to faces, we can’t remove any of the remaining six edges of the two now merged faces anymore. I solved this by keeping track of a list of edges that are still “available” and only removing edges listed there from the mesh. When I remove an edge from the mesh, I remove the now forbidden six edges from the list.
I don't understand what you mean by the remaining six edges. initially, the sphere will be made up of all triangle faces. Now if we remove an edge from 2 triangle faces, we will get a quad which will have 4 edges, not 6. Assuming you somehow only remove edges that are between 2 triangle faces only, you will end up with a mesh that is filled with triangles and quads. Or are you allowing removing edges between a quad/tri or quad/quad also - because that would give other shapes besides quads and triangles
Also, are you doing all this mesh generation and removing edges via code in Unity? Or do create the whole mesh, remove edges, subdivide it and relax it in blender and THEN import that in unity and do the marching square?
How exactly is the relaxation done? You mentioned an article from andersource.dev who basically finds a square that minimizes the sum of the vertex distance from the quad vertices to their respective square vertices. But then you said you used a "restrictive" Laplacian smoothing (the Wikipedia page was short on this) and then augmented it by "adding forces". I understand you can't share the code, so could you point me to a resource that explains this well? All I come across are abstruse research papers with a lot of math jargon.
The hover effect is still confusing. Here is what I have so far: you used marching squares to generate the effect. When the mouse is over a section of the sphere, I assume you do a raycast to find which point on the grid it is closest to.
Now normally, if you were creating a mesh there, you would look at the surrounding points and based on if they are "on" or "off" you generate the appropriate marching square arrangement and then transform it to match the quad (using the bilinear parametrization method you described) but for the hover effect, I assume you only treat the raycasted point as "on" and the surrounding points as "off" right? Then how do you actually get the hover effect? do you create a separate mesh dynamically that matches the faces of the overlaid faces and add that shader on top of it?
Also, I am curious how you achieve the shader effect as well (with the white border and the semi transparent white fill with a space between the fill and the border)
PS. How do you get the vertices on this type of mesh? If I am looking a vertex p and want to get all the adjacent vertex values to use for marching squares, how did you do that?
Lol sorry for being so nosy but this topic is really fascinating to me and as a beginner I trying understand and implement it so I can understand how it works
I loved this post! I was looking for a in-depth explanation for this for a while!
I have some beginner questions (I am just starting off in game dev)
- I have read about marching squares and cubes (and even saw sebastian lague's video and other tutorials), but could you explain a bit further how it works here for this irregular grid? The blog you mentioned didn't go into detail on this part
- This is unrelated to the algorithms used but how do you get the mouse hover effect (like oskar stalberg) for placing the tile (That white-ish selected/hover effect I mean)
- Third, I didn't see the source code for this in the blog. Is it open source? If not, I would really like to request that you made it open source so beginners like me can understand how you made it practically. Not only that, I have a thousand more questions like what kind of shaders you are using, etc
Dude if u expect people to make AAA quality games on their own then I don't know what to tell you. People here are starting off and showing how they r doing and taking constructive criticism to improve. But here u are saying nothing constructive and just being an a**
Biggest advice I can give you, which even I didn't follow in the beginning : FINISH your projects. If u get bored or stuck, fight through. That's when u truly learn
Is it working now? I faced the same issue when I started. I literally uninstalled all frameworks and then installed 4.7.1. If u still need help, u can msg me personally
If u r using windows, u can search uninstall program in the search bar and then find the .net framework there. And u can uninstall it there. Also, make sure u have the unity snippets vs code extension and the vs code package in unity. If u have these things, then it shouldn't be an issue
Make sure u have the right. Net frame work. Unity uses 4.7.1 by default. If u downloaded new ones, either change that in the project settings or just download 4.7.1
Thanks for the reply! I am sad that you won't open source this but I understand you point and that is fair. I still had a few more questions:
I don't understand what you mean by the remaining six edges. initially, the sphere will be made up of all triangle faces. Now if we remove an edge from 2 triangle faces, we will get a quad which will have 4 edges, not 6. Assuming you somehow only remove edges that are between 2 triangle faces only, you will end up with a mesh that is filled with triangles and quads. Or are you allowing removing edges between a quad/tri or quad/quad also - because that would give other shapes besides quads and triangles
Also, are you doing all this mesh generation and removing edges via code in Unity? Or do create the whole mesh, remove edges, subdivide it and relax it in blender and THEN import that in unity and do the marching square?
Now normally, if you were creating a mesh there, you would look at the surrounding points and based on if they are "on" or "off" you generate the appropriate marching square arrangement and then transform it to match the quad (using the bilinear parametrization method you described) but for the hover effect, I assume you only treat the raycasted point as "on" and the surrounding points as "off" right? Then how do you actually get the hover effect? do you create a separate mesh dynamically that matches the faces of the overlaid faces and add that shader on top of it?
Also, I am curious how you achieve the shader effect as well (with the white border and the semi transparent white fill with a space between the fill and the border)
PS. How do you get the vertices on this type of mesh? If I am looking a vertex p and want to get all the adjacent vertex values to use for marching squares, how did you do that?
Lol sorry for being so nosy but this topic is really fascinating to me and as a beginner I trying understand and implement it so I can understand how it works
I loved this post! I was looking for a in-depth explanation for this for a while!
I have some beginner questions (I am just starting off in game dev)
- I have read about marching squares and cubes (and even saw sebastian lague's video and other tutorials), but could you explain a bit further how it works here for this irregular grid? The blog you mentioned didn't go into detail on this part
- This is unrelated to the algorithms used but how do you get the mouse hover effect (like oskar stalberg) for placing the tile (That white-ish selected/hover effect I mean)
- Third, I didn't see the source code for this in the blog. Is it open source? If not, I would really like to request that you made it open source so beginners like me can understand how you made it practically. Not only that, I have a thousand more questions like what kind of shaders you are using, etc
Looks great! I am a beginner and I wanted to ask, how did you get that sharp edge look on the cubes with the dark outlines?
Dude if u expect people to make AAA quality games on their own then I don't know what to tell you. People here are starting off and showing how they r doing and taking constructive criticism to improve. But here u are saying nothing constructive and just being an a**
Biggest advice I can give you, which even I didn't follow in the beginning : FINISH your projects. If u get bored or stuck, fight through. That's when u truly learn
Is it working now? I faced the same issue when I started. I literally uninstalled all frameworks and then installed 4.7.1. If u still need help, u can msg me personally
If u r using windows, u can search uninstall program in the search bar and then find the .net framework there. And u can uninstall it there. Also, make sure u have the unity snippets vs code extension and the vs code package in unity. If u have these things, then it shouldn't be an issue
Make sure u have the right. Net frame work. Unity uses 4.7.1 by default. If u downloaded new ones, either change that in the project settings or just download 4.7.1
I have been trying to find good resources that teach how to add under water stuff to games. Can u recommend and good resources?
End of this list.
Back to top