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 palette color shader for Unity game engine. It supports color cycling/palette shifting. | |
| // | |
| // The "index" is a greyscale image where each value is used to look up a color in the "palette" image. | |
| // The palette can be any horizontal gradient. | |
| // | |
| // Blurring indices can look up the wrong color in the palette. So use an index with sharp pixels and no anti-aliasing. | |
| // For mipmaps, generate mipmaps using nearest neighbor filter. Which can be done using GIMP by exporting as a .dds file. | |
| // Or turn off mipmaps in the texture settings, or in this shader using the "filter mode." | |
| // | |
| // This shader is from this post: https://x.com/Vavassor/status/2109723733430517917 |
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. This shader creates a billboard for each point | |
| // in a point cloud. (a mesh using MeshTopology.Points) | |
| // | |
| // This shader is for Unity's built in render pipeline. | |
| // | |
| // MIT License | |
| // Copyright (c) 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 |
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. | |
| // | |
| // For a single billboard, 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. | |
| // | |
| // To use multiple billboards in one mesh choose Vertex as the Pivot Mode. For this you need a mesh that is a bunch of | |
| // separate quads, each scaled down to a point. In Unity mesh import settings, make sure "Weld Vertices" is | |
| // unchecked so they don't get welded together. Then this shader can display the billboards. | |
| // |
NewerOlder