Skip to content

Instantly share code, notes, and snippets.

@onotchi
onotchi / ToonLit.shader
Created May 11, 2017 13:48
ToonシェーダーでPhong Tessellation
Shader "Onoty3D/Toon/Phong Tessellation/Lit" {
Properties {
_Color ("Main Color", Color) = (0.5,0.5,0.5,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Ramp ("Toon Ramp (RGB)", 2D) = "gray" {}
[Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", int) = 2 //OFF/FRONT/BACK
_EdgeLength("Edge length", Range(2,50)) = 5
_Phong("Phong Strengh", Range(0,1)) = 0.5
}
@onotchi
onotchi / EquipmentsChanger2
Created May 11, 2017 13:43
プロ生ちゃんのスパッツ・靴下・靴以外も切り替えられるようにする(Unity向けFBX用)
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace PronamaChan
{
public class EquipmentsChanger2 : MonoBehaviour
{
public Material TransparentMaterial;
@onotchi
onotchi / DepthImageEffect.cs
Created May 11, 2017 13:40
距離感主義みたいなエフェクト
using UnityEngine;
namespace Onoty3D
{
[ExecuteInEditMode]
public class DepthImageEffect : MonoBehaviour
{
public enum YDirectionType
{
Forward,
@onotchi
onotchi / OnePointColorEffect.cs
Created May 11, 2017 13:36
指定色を残すイメージエフェクト
using UnityEngine;
namespace Onoty3D
{
[ExecuteInEditMode]
public class OnePointColorEffect : MonoBehaviour
{
public Material Material;
public Color TargetColor = Color.white;
@onotchi
onotchi / EquipmentsChanger.cs
Created May 11, 2017 13:23
Unityでプロ生ちゃん新モデルのスパッツ・靴下・靴の表示を切り替え(Unityに取り込んだMMD版用)
using System;
using System.Collections.Generic;
using UnityEngine;
namespace PronamaChan
{
public class EquipmentsChanger : MonoBehaviour
{
public Material TransparentMaterial;
public SkinnedMeshRenderer SkinnedMesh;
@onotchi
onotchi / ToonBasicCutout.shader
Created May 11, 2017 13:20
おきゅらすたんのスカート用シェーダー
Shader "Onoty3D/Toon/Basic Cutout" {
Properties{
_Color("Main Color", Color) = (.5,.5,.5,1)
_MainTex("Base (RGB)", 2D) = "white" {}
_ToonShade("ToonShader Cubemap(RGB)", CUBE) = "" { }
_Cutoff("Alpha Cutoff", Range(0,1)) = 0.5
}
SubShader{
@onotchi
onotchi / ChromaKey.shader
Created May 11, 2017 13:06
クロマキーシェーダー(RGBベースとHSVベース)
Shader "Onoty3D/ChromaKey" {
Properties{
_KeyColor("Key Color", Color) = (0,1,0)
_Near("Near", Range(0, 2)) = 0.2
_MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader{
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
LOD 200
@onotchi
onotchi / EyeRotator.cs
Created May 11, 2017 12:58
IK Passの間で目の回転を制御する
using UnityEngine;
public class EyeRotator : MonoBehaviour
{
public Vector3 RotationL;
public Vector3 RotationR;
private Animator _animator;
// Use this for initialization
@onotchi
onotchi / SubMeshExporter.cs
Last active January 18, 2018 03:44
SubMesh単位でMeshを作り直す
using System.Linq;
using UnityEditor;
using UnityEngine;
public class SubMeshExporter : ScriptableObject
{
// Use this for initialization
private void Start()
{
}
@onotchi
onotchi / ToonLit.shader
Created May 11, 2017 12:51
白枠を表示させるシェーダー
Shader "Onoty3D/Toon/Lit" {
Properties {
_Color ("Main Color", Color) = (0.5,0.5,0.5,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_Ramp ("Toon Ramp (RGB)", 2D) = "gray" {}
[Enum(OFF,0,FRONT,1,BACK,2)] _CullMode("Cull Mode", int) = 2 //OFF/FRONT/BACK
_StencilRefMain("Stcl Ref Main", Range(0, 255)) = 128
}
SubShader {