Skip to content

Instantly share code, notes, and snippets.

View sugi-cho's full-sized avatar
😪
zzz

Hironori Sugino sugi-cho

😪
zzz
View GitHub Profile
@sugi-cho
sugi-cho / Extentions.cs
Created June 16, 2014 03:59
拡張メソッド
using UnityEngine;
using System.Collections;
static class Extentions
{
public static Vector2 XY (this Vector3 vec3)
{
return new Vector2 (vec3.x, vec3.y);
}
@sugi-cho
sugi-cho / TestWindow.cs
Created June 24, 2014 13:22
create background editor process
using UnityEngine;
using UnityEditor;
using System.Collections;
public class TestWindow : EditorWindow
{
[MenuItem("Window/Test")]
public static void Init ()
{
EditorWindow.GetWindow (typeof(TestWindow));
@sugi-cho
sugi-cho / CheckUV.shader
Last active August 25, 2019 19:05
ato de matomeru!!!
Shader "Custom/CheckUV" {
CGINCLUDE
sampler2D _MainTex;
struct Input {
float4 vColor;
float2 tex;
};
void vert (inout appdata_full v, out Input o){
UNITY_INITIALIZE_OUTPUT(Input,o);
o.vColor = v.color;
Shader "Custom/YokoMieru" {
Properties {
_MainTex("texture", 2D) = "white" {}
_T ("mieru",Float) = 0
}
CGINCLUDE
sampler2D _MainTex;
uniform half _T;
struct Input {
float4 vColor;
@sugi-cho
sugi-cho / MobileBlur.shader
Created August 5, 2014 09:02
アルファチャンネルもブラーする!
Shader "Hidden/FastBlur" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Bloom ("Bloom (RGB)", 2D) = "black" {}
}
CGINCLUDE
#include "UnityCG.cginc"
@sugi-cho
sugi-cho / AfterEffects.cs
Last active August 25, 2019 18:58
しんぷる
using UnityEngine;
using System.Collections;
public class AfterEffect : MonoBehaviour {
public Material m,
public Material[] targetMats;
public string propName = "_Tex";
RenderTexture rt;
@sugi-cho
sugi-cho / TileAnimattor.shader
Created August 13, 2014 06:59
タイルアニメーションする、シェーダ
Shader "Custom/TextureSheetAnimator" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_TileX ("tile x", Float) = 1
_TileY ("tile y", Float) = 1
_T ("t",float) = 0
}
CGINCLUDE
#include "UnityCG.cginc"
@sugi-cho
sugi-cho / getBulurTex.cs
Created August 13, 2014 10:38
generate blur renderTexture
public void GetBlurTex(RenderTexture targetTexture, int iteration, int ds){
RenderTexture rt = targetTexture;
float
widthMod = 1f / (1f * (1 << ds));
int
rtW = rt.width,
rtH = rt.height;
for(int i = 0; i < iteration; i++){
float iterationOffs = (float)i;
@sugi-cho
sugi-cho / SetCamRect.cs
Created August 18, 2014 10:03
カメラのcamera.rectを設定することができる。カメラの後ろに、黒でクリアするカメラかなにかを置いた方が良い。
using UnityEngine;
using System.Collections;
public class SetCamRect : MonoBehaviour
{
public Camera[] cams;
string
propRectMinX = "RectMinX",
propRectMinY = "RectMinY",
propRectMaxX = "RectMaxX",
@sugi-cho
sugi-cho / FragmentLit.shader
Last active August 29, 2015 14:06
v2f shader with lighting in unity simple
Shader "Custom/FragmentLit" {
CGINCLUDE
#include "UnityCG.cginc"
sampler2D _MainTex;
fixed4 _Color;
struct v2f {
float4 pos : SV_POSITION;
fixed4 color : COLOR;