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
// Copyright (c) Valve Corporation, All rights reserved. ====================================================================================================== | |
// Modified to support vertex colors, vertex color linearization, vertex ao (through vertex alpha), up to 4 detail textures as well as tighter mask packing | |
// | |
// The mask texture is laid out like this: | |
// R - Metalness | |
// G - Roughness | |
// B - Ambient occlusion | |
// A - Detail mask, where: | |
// 0-25% intensity = Detail map 1 | |
// 25-50% intensity = Detail map 2 |
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
// Copyright (c) Valve Corporation, All rights reserved. ====================================================================================================== | |
#if ( UNITY_EDITOR ) | |
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
namespace UnityEditor | |
{ |
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
using UnityEngine; | |
using UnityEditor; | |
using System.Reflection; | |
[InitializeOnLoad] | |
public static class ScrollableEditorCameraSpeed | |
{ | |
static ScrollableEditorCameraSpeed() | |
{ | |
float cameraSpeed = 10.0f; |
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 |
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
#ifndef TRICUBIC_INCLUDED | |
#define TRICUBIC_INCLUDED | |
float4 Cubic(float v) | |
{ | |
float4 n = float4(1.0, 2.0, 3.0, 4.0) - v; | |
float4 s = n * n * n; | |
float x = s.x; | |
float y = s.y - 4.0 * s.x; | |
float z = s.z - 4.0 * s.y + 6.0 * s.x; |
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 "FX/PixelDot" | |
{ | |
Properties | |
{ | |
[NoScaleOffset] _MainTex ("Texture", 2D) = "white" {} | |
_Color ("Color", Color) = (1, 1, 1, 1) | |
_Size ("Pixel Size", Range(1, 64)) = 1 | |
} | |
SubShader | |
{ |
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
// Uniform random distribution. | |
// Great for effects with a limited number of samples, like SSAO. | |
public static Vector4[] UniformKernel(int n, bool hemisphere) | |
{ | |
Random.State state = Random.state; | |
// Set the random seed so repeat calls with n samples always returns the same result | |
Random.InitState(0); | |
Vector4[] result = new Vector4[n]; | |
for (int i = 0; i < n; i++) |
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 "Wireframe" | |
{ | |
Properties | |
{ | |
_Color ("Color", Color) = (1, 1, 1, 1) | |
_WireColor ("Wire Color", Color) = (0, 0, 0) | |
_Smoothing ("Smoothing", Range(0, 10)) = 1 | |
_Thickness ("Thickness", Range(0, 10)) = 1 | |
} |
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
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetAssembly(typeof(SceneView)); | |
System.Type logEntries = assembly.GetType("UnityEditor.LogEntries"); | |
logEntries.GetMethod("Clear").Invoke(new object (), null); |
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
using UnityEngine; | |
public static class HaltonSequenceGenerator | |
{ | |
public static void GenerateHaltonSequence(float[] result) | |
{ | |
for (int i = 0; i < result.Length; i++) | |
{ | |
result[i] = Halton(2, i); | |
} |
OlderNewer