Skip to content

Instantly share code, notes, and snippets.

Avatar

Shunsuke_Ishimoto TheStoneBook

View GitHub Profile
@TheStoneBook
TheStoneBook / PostEffect.cs
Created Oct 21, 2018
【Unity】ポストエフェクトの適用
View PostEffect.cs
using UnityEngine;
//[ExecuteInEditMode]
public class PostEffect : MonoBehaviour {
[SerializeField]
private Material _material;
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
@TheStoneBook
TheStoneBook / SobelEdge.shader
Last active Oct 14, 2018
【Unity】ソーベルフィルターでエッジ検出【Shader】
View SobelEdge.shader
Shader "Unlit/SobelEdge"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Width("Width",float)=1920
_Height("Height",float)=1080
}
SubShader
{
@TheStoneBook
TheStoneBook / TransitionGrayScaleToColor.shader
Last active Nov 3, 2018
【Unity】テクスチャトランジション(グレイスケールからカラー。もしくはその逆)【Shader】
View TransitionGrayScaleToColor.shader
Shader "Unlit/TransitionGrayScaleToColor"
{
Properties
{
_MainTex ("MainTexture", 2D) = "white" {}
_Pattern("Pattern",2D)="white"{}
_Threshold("Threshold",Range(0.0,1.0))=0.5
}
SubShader
{
@TheStoneBook
TheStoneBook / StencilShield.shader
Last active Oct 9, 2018
【Unity2D】遮蔽物と重なった部分をシルエットにするシェーダー【Shader】
View StencilShield.shader
Shader "Unlit/Stencil"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
@TheStoneBook
TheStoneBook / TexBlend.shader
Last active Oct 9, 2018
【Unity】2つのテクスチャをブレンドする【Shader】
View TexBlend.shader
Shader "Unlit/TexBlend"
{
Properties
{
_MainTex ("MainTex", 2D) = "white" {}
_SubTex("SubTex", 2D) = "white" {}
_Blend("Blend", Range(0.0,1.0)) = 0.0
}
SubShader
{
@TheStoneBook
TheStoneBook / GrayScale.shader
Last active Oct 9, 2018
【Unity】テクスチャグレイスケール変換【Shader】
View GrayScale.shader
Shader "Unlit/GrayScale"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
@TheStoneBook
TheStoneBook / PolygonToBoxel.shader
Last active Sep 18, 2018
【Unity】ポリゴンをボクセルに【Shader】
View PolygonToBoxel.shader
Shader "Geometry/PolygonToBoxel"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_MainColor("Color",Color)=(1,1,1,1)
_BoxScale("BoxScale",Range(0.0, 0.1)) = 0.01
}
SubShader
{
@TheStoneBook
TheStoneBook / PolygonScaling.shader
Last active Sep 10, 2018
【Unity】ポリゴンの拡大縮小【Shader】
View PolygonScaling.shader
Shader "Geometry/PolygonScaling"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_MainColor("Color",Color)=(1,1,1,1)
_ScaleFactor("Scale Factor", Range(0.0, 1.0)) = 1.0
//_ScaleFactor("Scale Factor", Range(0.0, 2.0)) = 1.0
}
@TheStoneBook
TheStoneBook / FaceExtrude.shader
Last active Sep 10, 2018
【Unity】ポリゴン面押し出し【Shader】
View FaceExtrude.shader
Shader "Geometry/FaceExtrude"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Factor ("Factor", Range(0., 2.)) = 0.2
}
SubShader
{
Tags { "RenderType"="Opaque" }
@TheStoneBook
TheStoneBook / Reversible.shader
Created Sep 7, 2018
【Unity】表裏両面に別々のテクスチャを貼っつけるシェーダ【Shader】
View Reversible.shader
Shader "Unlit/Reversible"
{
Properties
{
_MainTexA ("TextureA", 2D) = "white" {}
_MainTexB ("TextureB", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }