Skip to content

Instantly share code, notes, and snippets.

@elringus
elringus / UIBlured.shader
Last active November 2, 2017 13:29
Blend mode and blur effect combined for UI objects.
// Blend mode and blur effect combined for UI objects.
Shader "BlendModes/Extra/UIBlured"
{
Properties
{
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
_Color("Tint", Color) = (1,1,1,1)
_BlurRadius("Blur Radius", Range(1, 20)) = 7
using UnityEngine;
public class #SCRIPTNAME# : MonoBehaviour
{
private void Awake ()
{
}
private void Update ()
@elringus
elringus / BlendLightedMesh.shader
Created October 31, 2016 21:18
Shader for meshes, which responds to light by applying blend mode effect
Shader "BlendModes/Extra/BlendLightedMesh"
{
Properties
{
_Color ("Tint Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_NormalMap ("Normal Map", 2D) = "bump" {}
_BumpDepth ("Bump Depth", Range(0.0, 1.0)) = 1.0
}
Shader "BlendModes/Extra/DirectSurfMesh"
{
Properties
{
_Color("Tint Color", Color) = (1,1,1,1)
_MainTex("Base (RGB)", 2D) = "white" {}
}
SubShader
{
using System;
using UnityEngine;
namespace UnityStandardAssets.ImageEffects
{
[ExecuteInEditMode]
[RequireComponent (typeof(Camera))]
[AddComponentMenu ("Image Effects/Other/Screen Overlay")]
public class ScreenOverlay : PostEffectsBase
{
@elringus
elringus / Grab.shader
Last active May 8, 2017 10:54
Surf mesh blend mode shader with shadows
Shader "BlendModes/MeshDefault/Grab"
{
Properties
{
_Color("Tint Color", Color) = (1,1,1,1)
_MainTex("Base (RGB)", 2D) = "white" {}
}
SubShader
{
@elringus
elringus / AddEndpoints.ps1
Last active January 15, 2016 20:07
A power shell scripts to batch-add end-points to an Azure VM.
Add-AzureAccount
$vm = Get-AzureVM -ServiceName "example-service-name" -Name "example-vm-name"
for ($i=7000; $i -le 7100; $i++)
{
$EndpointName = "EXAMPLE-"
$EndpointName += $i
Add-AzureEndpoint -Name $EndpointName -Protocol "udp" -PublicPort $i -LocalPort $i -VM $vm
}
$vm | Update-AzureVM
using UnityEditor;
[InitializeOnLoad]
public class AutosaveOnRun
{
static AutosaveOnRun()
{
EditorApplication.playmodeStateChanged = () =>
{
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
@elringus
elringus / vgPlayerCollisionTester.cs
Created September 4, 2015 17:37
PlayerCollisionTester
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Collections;
using System.Collections.Generic;
public class vgPlayerCollisionTester : vgMonoBehaviour
Shader "GrabTexBug"
{
Properties
{
[PerRendererData]
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
}
SubShader