This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Lookup Tables for Transvoxel's Modified Marching Cubes | |
| // | |
| // Unlike the original paper (Marching Cubes: A High Resolution 3D Surface Construction Algorithm), these tables guarantee | |
| // a closed mesh "whose connected components are continuous and free of holes." | |
| // | |
| // Rotations are prioritised over inversions so that 3 of the 6 cases containing ambiguous faces are never added. 3 extra | |
| // cases are added as a post-process, overriding inverses through custom-build rotations to eliminate the rest. | |
| // | |
| // Uses the exact same co-ordinate system as https://gist.github.com/dwilliamson/c041e3454a713e58baf6e4f8e5fffecd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //This API to create new nodes has been deprecated in early 2019. | |
| //This means that if you are on a more recent version of Shader Graph and Universal Render Pipeline, you should use instead a pre-made node, which acts like a container that allows you to inject custom HLSL code into Shader Graph without the need to create a node from scratch. | |
| //Please use the new node, not the C# API described here. | |
| // | |
| //You can find more details about that node in the Docs: https://docs.unity3d.com/Packages/com.unity.shadergraph@6.7/manual/Custom-Function-Node.html | |
| //I also blogged about it here: https://connect.unity.com/p/adding-your-own-hlsl-code-to-shader-graph-the-custom-function-node | |
| // | |
| //If you are still on a very old version of Lightweight Render Pipeline (you shouldn't!!), you can still see the C# code for this custom node by rolling back to a previous version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [RequireComponent(typeof(MeshFilter))] | |
| public class GenerateMesh02 : MonoBehaviour { | |
| /* scratchpad */ | |
| private MeshFilter mf; | |
| void Start () { | |
| mf = GetComponent<MeshFilter> (); | |
| GenerateMesh (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |