Skip to content

Instantly share code, notes, and snippets.

@yasuakiohama
yasuakiohama / MaskVertex.shader
Created June 20, 2015 03:01
MaskVertex.shader
Shader "MaskVertex" {
Properties {
_Color ("Main Color", Color) = (1,1,1,0)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Mask ("Culling Mask", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range (0,1)) = 0.1
}
SubShader {
Tags { "RenderType"="Opaque" }
using UnityEngine;
using System.Collections;
public class sample : MonoBehaviour {
private float MAP_RADIUS = 10.0f;
public Transform target;
// float Z {
// get {
@yasuakiohama
yasuakiohama / MaskedLightTexture.shader
Last active August 29, 2015 14:23
MaskedLightTexture.shader
Shader "MaskedLightTexture" {
Properties {
_Color ("Main Color", Color) = (1,1,1,0)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.01, 1)) = 0.7
_MainTex ("Base (RGB)", 2D) = "white" {}
_Mask ("Culling Mask", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range (0,1)) = 0.1
}
@yasuakiohama
yasuakiohama / Mirror.cs
Last active August 29, 2015 14:23
Mirror.cs
using UnityEngine;
using System.Collections;
public class Mirror : MonoBehaviour
{
private float MAP_RADIUS = 10.0f;
public Transform target;
void Start()
{
@yasuakiohama
yasuakiohama / MaskedTexture.shader
Last active August 29, 2015 14:23
MaskedTexture
Shader "MaskedTexture"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_Mask ("Culling Mask", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range (0,1)) = 0.1
}
SubShader
{
@yasuakiohama
yasuakiohama / VertexLit.shader
Created July 4, 2015 17:11
VertexLit.shader
Shader "VertexLit" {
Properties {
_Color ("Main Color", Color) = (1,1,1,0)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.01, 1)) = 0.7
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
@yasuakiohama
yasuakiohama / Example-Diffuse Texture.Shader
Created July 20, 2015 12:23
Example-Diffuse Texture.Shader
Shader "Example/Diffuse Texture" {
Properties {
_MainTex ("Texture", 2D) = "white" { }
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float2 uv_MainTex;
@yasuakiohama
yasuakiohama / Example-Diffuse Texture SimpleLambert.Shader
Created July 20, 2015 12:25
Example-Diffuse Texture SimpleLambert.Shader
Shader "Example/Diffuse Texture2" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf SimpleLambert
half4 LightingSimpleLambert (SurfaceOutput s, half3 lightDir, half atten) {
@yasuakiohama
yasuakiohama / Example-Diffuse ShadowColor.shader
Last active August 29, 2015 14:25
Example-Diffuse ShadowColor.shader
Shader "Example/Diffuse ShadowColor" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_ShadowColor ("ShadowColor", Color) = (0,0,1,1)
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf SimpleLambert
@yasuakiohama
yasuakiohama / CleateShadowColorPlane.cs
Last active August 29, 2015 14:25
CleateShadowColorPlane.cs
using UnityEngine;
using System.Collections;
public class CleatePlane : MonoBehaviour
{
public GameObject shadowColorPlanePrefab;
void Start ()
{
for (int h = 0; h <= 360; h++) {