Video from jsturgis gist
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
| // David Evans @phosphoer | |
| // Feel free to use this in your commercial projects | |
| // Let me know if you do cause it will make me feel good and stuff | |
| using UnityEngine; | |
| using System.Collections.Generic; | |
| using System; | |
| #if UNITY_EDITOR | |
| using UnityEditor; |
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
| // 2 sided standard surface shader (using 2 passes), with fixed normals for flipped faces | |
| Shader "Custom/TwoSided (FixedNormals)" | |
| { | |
| Properties | |
| { | |
| _Color ("Color", Color) = (1,1,1,1) | |
| _MainTex ("Albedo (RGB)", 2D) = "white" {} | |
| _Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
| _Metallic ("Metallic", Range(0,1)) = 0.0 |
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
| using UnityEngine; | |
| using System.Collections; | |
| // This is not need but I just wanted to make the point clear. | |
| public class AnimatedComponent : MonoBehaviour | |
| { | |
| } |
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
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| [CustomEditor(typeof(PrefabNode))] | |
| public class PrefabNodeEditor | |
| : Editor |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using UnityEditor; | |
| using UnityEditor.Compilation; | |
| using UnityEngine; | |
| [InitializeOnLoad] | |
| public class AsmdefDebug | |
| { |
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
| // | |
| // ContentView.swift | |
| // MetalSwiftUI | |
| // | |
| // Created by Zach Eriksen on 9/8/20. | |
| // Copyright © 2020 oneleif. All rights reserved. | |
| // | |
| // Inspired [MetalUI](https://github.com/0xLeif/MetalUI) | |
| import SwiftUI |
Minimal sprite rendering example written in C with SDL2 for windowing, sokol_gfx for graphics API using WebGL2/GLES3, stb_image for loading image, compiled in WebAssembly with Emscripten.
- Clone the repositories
sokolandstbin thedepsfolder - Add an image (sky.png) in
assetsdirectory - Compile and build with the following command (need Emscripten installed):
Doable in real time with a compact pipeline and a small nonlinear solver per frame. I'll give a complete, practical approach you can implement right away:
-
assumptions I’ll make (don’t worry if some don’t hold; I include fallbacks):
- camera intrinsics (K) are known (focal length (f), principal point). If not, I show a fallback.
- each bead has known physical radius (R) and the known center-to-center spacing sequence (s_i).
- each bead has a unique color and the colors appear in the same sequence left→right in the string (you said sequence is known).
OlderNewer
