View Selectable.cs
This file contains 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
// Improved navigation code | |
using System; | |
using System.Collections.Generic; | |
using UnityEngine.Serialization; | |
using UnityEngine.EventSystems; | |
namespace UnityEngine.UI | |
{ | |
[AddComponentMenu("UI/Selectable", 35)] | |
[ExecuteAlways] |
View PhotoshopMathFP.hlsl
This file contains 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
// https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/ | |
/* | |
** Photoshop & misc math | |
** Blending modes, RGB/HSL/Contrast/Desaturate | |
** | |
** Romain Dura | Romz | |
** Blog: http://blog.mouaif.org | |
** Post: http://blog.mouaif.org/?p=94 | |
*/ |
View aaStepFastBoth.hlsl
This file contains 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
// Smooth equivalent to step(a, b) and both a and b can have their value change. | |
float aaStepFastBoth(float a, float b) { | |
return saturate((b - a) / max(fwidth(b), fwidth(a))); | |
} |
View BlurEffect.compute
This file contains 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
#pragma kernel Downscale | |
#pragma kernel GaussianBlurVertical | |
#pragma kernel GaussianBlurHorizontal | |
#pragma kernel BoxBlur | |
Texture2D<float4> _Source; | |
RWTexture2D<float4> _Dest; | |
float _Amount; | |
float2 _Size; |
View ExtendedScriptableObjectDrawer.cs
This file contains 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
// Developed by Tom Kail at Inkle | |
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT | |
// Must be placed within a folder named "Editor" | |
using System; | |
using System.Reflection; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; |
View fbfetch.shader
This file contains 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 "UnityCG.cginc" | |
#pragma vertex vert | |
#pragma fragment frag | |
// in practice: only compile for gles2,gles3,metal | |
#pragma only_renderers framebufferfetch | |
struct appdata_t { | |
float4 vertex : POSITION; | |
float2 texcoord : TEXCOORD0; | |
}; |
View DebugUtil.cs
This file contains 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 DebugUtil | |
{ | |
public static void DumpRenderTexture(RenderTexture rt, string pngOutPath) | |
{ | |
var oldRT = RenderTexture.active; | |
var tex = new Texture2D(rt.width, rt.height); | |
RenderTexture.active = rt; | |
tex.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0); |
View ComputeGunLead.cs
This file contains 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
/// <summary> | |
/// Computes a point for a gun to aim at in order to hit a target using linear prediction. | |
/// Assumes a bullet with no gravity or drag. I.e. A bullet that maintains a constant. | |
/// velocity after it's been fired. | |
/// </summary> | |
public static Vector3 ComputeGunLead(Vector3 targetPos, Vector3 targetVel, Vector3 ownPos, Vector3 ownVel, float muzzleVelocity) | |
{ | |
// Extremely low muzzle velocities are unlikely to ever hit. This also prevents a | |
// possible division by zero if the muzzle velocity is zero for whatever reason. | |
if (muzzleVelocity < 1f) |
View Distortion.shader
This file contains 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 "Distortion" | |
{ | |
Properties | |
{ | |
_Refraction ("Refraction", Range (0.00, 10.0)) = 1.0 | |
_Power ("Power", Range (1.00, 10.0)) = 1.0 | |
_AlphaPower ("Vertex Alpha Power", Range (1.00, 10.0)) = 1.0 | |
_BumpMap( "Normal Map", 2D ) = "bump" {} | |
_Cull ( "Face Culling", Int ) = 2 |
NewerOlder