Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
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.Generic; | |
| namespace Gist | |
| { | |
| public sealed class ReverseComparer<T> : IComparer<T> | |
| { | |
| public static readonly ReverseComparer<T> Default = new ReverseComparer<T>(Comparer<T>.Default); | |
| public static ReverseComparer<T> Reverse(IComparer<T> comparer) | |
| { |
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
| #ifndef __QUATERNION__ | |
| #define __QUATERNION__ | |
| #define HALF_DEG2RAD 8.72664625e-3 | |
| float4 quaternion(float3 normalizedAxis, float degree) { | |
| float rad = degree * HALF_DEG2RAD; | |
| return float4(normalizedAxis * sin(rad), cos(rad)); | |
| } | |
| float4 qmul(float4 a, float4 b) { |
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
| in vec2 v_texcoord; // texture coords | |
| in vec3 v_normal; // normal | |
| in vec3 v_binormal; // binormal (for TBN basis calc) | |
| in vec3 v_pos; // pixel view space position | |
| out vec4 color; | |
| layout(std140) uniform Transforms | |
| { | |
| mat4x4 world_matrix; // object's world position |
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
| Shader "Name" { | |
| Properties { | |
| name ("display name", Range (min, max)) = number | |
| name ("display name", Float) = number | |
| name ("display name", Int) = number | |
| name ("display name", Color) = (number,number,number,number) | |
| name ("display name", Vector) = (number,number,number,number) |
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
| /// | |
| /// Draw lines at runtime | |
| /// by Nothke | |
| /// unlicensed, aka do whatever you want with it | |
| /// made during Stugan 2016 :) | |
| /// ..(it's midnight, and Robbie clicks A LOT, LOUDLY!) | |
| /// | |
| /// Important: | |
| /// - Should be called in OnPostRender() (after everything else has been drawn) | |
| /// therefore the script that calls it must be attached to the camera |
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.Diagnostics; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Windows.Forms; | |
| namespace wcclitedumper | |
| { | |
| class Program |
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
| // yMap is the Y texture, uvMap is the CrCb texture | |
| vec4 capturedImageTextureY = texture2D(yMap, uv); | |
| vec4 capturedImageTextureCbCr = texture2D(uvMap, uv); | |
| mat4 transform = mat4( | |
| 1.0000, 1.0000, 1.0000, 0.0000, | |
| 0.0000, -0.3441, 1.7720, 0.0000, | |
| 1.4020, -0.7141, 0.0000, 0.0000, | |
| -0.7010, 0.5291, -0.8860, 1.0000 | |
| ); |
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
| public static class Lz77 | |
| { | |
| private const int RingBufferSize = 4096; | |
| private const int UpperMatchLength = 18; | |
| private const int LowerMatchLength = 2; | |
| private const int None = RingBufferSize; | |
| private static readonly int[] Parent = new int[RingBufferSize + 1]; | |
| private static readonly int[] LeftChild = new int[RingBufferSize + 1]; | |
| private static readonly int[] RightChild = new int[RingBufferSize + 257]; | |
| private static readonly ushort[] Buffer = new ushort[RingBufferSize + UpperMatchLength - 1]; |
