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
| // Wire shader that prevents prevent thin wires from becoming disconnected pixels at a distance. | |
| // | |
| // The wire drawing method is based on "Phone-wire AA" by Emil Persson aka Humus. | |
| // https://www.humus.name/index.php?page=3D&ID=89 | |
| // | |
| // MIT License | |
| // Copyright © 2025 Andrew Dawson | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| // |
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 UdonSharpEditor; | |
| using UnityEditor; | |
| using UnityEngine; | |
| [CustomEditor(typeof(PropManager)), CanEditMultipleObjects] | |
| public class PropManagerEditor : UnityEditor.Editor | |
| { | |
| public override void OnInspectorGUI() | |
| { | |
| if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) 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
| using UdonSharp; | |
| using UnityEngine; | |
| using VRC.SDKBase; | |
| [UdonBehaviourSyncMode(BehaviourSyncMode.Manual)] | |
| public class IntSetting : UdonSharpBehaviour | |
| { | |
| [SerializeField, UdonSynced] private int valueSync; | |
| public void SetValue(int newValue) |
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 is a lit shader example that doesn't use surface shaders. | |
| // It supports forward rendering in the Built-in render pipeline. (BiRP) | |
| // | |
| // Annoyingly, it's not possible to support baked emission without a custom inspector, | |
| // because there's no other way to set globalIlluminationFlags. So if baked emissions are required, | |
| // switch the inspector to debug mode and change the flags manually. | |
| Shader "Orchid Seal/Lit Shader Template" | |
| { | |
| Properties | |
| { |
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
| // Photoshop Blend Modes in HLSL | |
| #ifndef OSP_BLEND_MODE_HLSL_ | |
| #define OSP_BLEND_MODE_HLSL_ | |
| // The following blend modes are trivial! "s" is the backdrop and "t" is the top color. | |
| // Add (Linear Dodge): s + t | |
| // Darken: min(s, t) | |
| // Divide: s / t | |
| // Lighten: max(s, t) | |
| // Multiply: s * t |
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
| Photoshop blend modes in Unity ShaderLab | |
| About Blend Modes | |
| https://docs.unity3d.com/6000.0/Documentation/Manual/SL-Blend.html | |
| The following modes are used for combining the output of a shader to the framebuffer. (the screen, basically) If you wish to blend colors within a shader, instead see this article "Photoshop Blend Modes in HLSL" by Ryan Juckett. https://www.ryanjuckett.com/photoshop-blend-modes-in-hlsl/ | |
| // Additive (aka Linear Dodge) | |
| Blend One One |
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; | |
| public static class TransformUtilities | |
| { | |
| /* | |
| Transforms represent a position, orientation (rotation), and scale of an object. They also | |
| represent a translation, rotation, and dilation relative to position (0, 0, 0), | |
| rotation (0, 0, 0, 1), and scale (1, 1, 1). | |
| When a transform is applied to another, it is translated, rotated, and dilated. It combines transformations. |
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
| // Billboards are a flat image or sprite that always face the camera. | |
| // | |
| // Put the material on Unity's Quad mesh. You may want to try enabling GPU instancing on the material, because this | |
| // shader disables batching! Billboarding uses the object pivot, but batching combines meshes so they all have one pivot. | |
| // | |
| // This shader is for Unity's built in render pipeline. | |
| // | |
| // MIT License | |
| // Copyright (c) 2025 Andrew Dawson | |
| // |
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
| /** | |
| * Linearly interpolate, or produce a point that is a given fraction of the way | |
| * between two other points. | |
| * | |
| * This is equivalent to the weighted arithmetic mean of the two points, | |
| * where t is the weight. | |
| * | |
| * @param {number} v0 the starting bound, returned when t=0 | |
| * @param {number} v1 the ending bound, returned when t=1 | |
| * @param {number} t the fraction between the given data points, also called the interpolant |
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
| #include <math.h> | |
| #include <stdio.h> | |
| typedef union Float2 | |
| { | |
| struct | |
| { | |
| float x; | |
| float y; | |
| }; |