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
| %YAML 1.1 | |
| %TAG !u! tag:unity3d.com,2011: | |
| --- !u!2058629511 &1 | |
| VisualEffectResource: | |
| m_ObjectHideFlags: 0 | |
| m_CorrespondingSourceObject: {fileID: 0} | |
| m_PrefabInstance: {fileID: 0} | |
| m_PrefabAsset: {fileID: 0} | |
| m_Name: StretchAndOrientByVelocity | |
| m_Graph: {fileID: 114350483966674976} |
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
| //============================================================================== | |
| // Rounded Box Outline SDF | |
| //============================================================================== | |
| float roundedBoxSDF(vec2 CenterPosition, vec2 Size, float Radius) | |
| { | |
| return length(max(abs(CenterPosition)-Size+Radius,0.0))-Radius; | |
| } | |
| float roundBoxOutline(vec2 size, float thickness, float radius) |
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
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
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
| import Time from 'Time'; | |
| /** | |
| * The Update class manages subscriptions to snapshot items and provides an update method that can be overridden by subclasses. | |
| * | |
| * import Scene from 'Scene'; | |
| * import Update from './Update'; | |
| * | |
| * class OtherClass extends Update { | |
| * private _mySceneObject: Scene.SceneObjectBase = Scene.root.findFirstSync('plane0'); | |
| * |
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
| // Remember to put the script you choose inside a folder called Editor inside your Assets folder. | |
| using UnityEditor; | |
| public static class CompileBeforePlay | |
| { | |
| [InitializeOnLoadMethod] | |
| public static void Initialize() | |
| { | |
| if (EditorApplication.isPlaying) return; |
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
| int numbers[10] = { 31599, 25751, 25255, 25230, 23241, 31118, 14826, 29257, 11242, 15306 }; |
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
| //============================================================================== | |
| // Shadow | |
| //============================================================================== | |
| #import <utils> | |
| using namespace std; | |
| vec4 main() { return vec4(vec3(0.0), smoothstep(0.5, 0.0, safeDistance(fragment(getVertexTexCoord()), vec2(0.5)))); } |
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
| //============================================================================== | |
| // MatCap Shader | |
| // via https://www.clicktorelease.com/code/spherical-normal-mapping/ | |
| //============================================================================== | |
| using namespace std; | |
| #import <utils> | |
| export vec2 calculateNormal( optional<std::Texture2d> normalTex, | |
| mat3 tangentFrame, |
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
| //============================================================================== | |
| // Simple Displacement Shader | |
| // make sure to add 'Vertex Texture Fetch' to Capabilities | |
| //============================================================================== | |
| void main(optional<std::Texture2d> displace, optional<std::Texture2d> tex, float depth, out vec4 Color, out vec4 Position) { | |
| vec2 uv = std::getVertexTexCoord(); | |
| vec4 texturePos = displace.sampleLod(uv, 0.0).valueOr(vec4(1.0)); | |
| vec4 outPosition = std::getVertexPosition() + vec4(std::getVertexNormal()*texturePos.rgb*depth, 0.0); | |
| Color = tex.sampleLod(fragment(uv), 0.0).valueOr(vec4(1.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
| function setup() { | |
| createCanvas(256, 256); | |
| } | |
| function draw() { | |
| for (let i = 0; i < width ; i++) { | |
| for (let j = 0; j < height; j++) { | |
| let c = color(i & j, i | j, i ^ j); | |
| set(i, j, c); | |
| } |
NewerOlder