Skip to content

Instantly share code, notes, and snippets.

@togucchi
togucchi / DepthFlare.shader
Last active August 5, 2023 10:38
Unity URP depth based LensFlare shader
Shader "Toguchi/DepthFlare"
{
Properties
{
[HDR] _Color ("Color", COLOR) = (1, 1, 1, 1)
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags
@togucchi
togucchi / RuntimePipelineSwitcher.cs
Created February 11, 2021 15:25
Switching Render Pipeline at runtime
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
public class RuntimePipelineSwitcher : MonoBehaviour
{
[SerializeField]
private RenderPipelineAsset pipelineAsset;
using System;
using UnityEngine;
using UnityEngine.Events;
using UniRx;
namespace uOSC
{
public class uOscObservableServer : MonoBehaviour
{
@togucchi
togucchi / SerialPortHandler.cs
Last active July 25, 2019 14:54
[Unity]非同期処理(Task)の利用例(UDP送受信,SerialPortのRead) ref: https://qiita.com/togucchi/items/45cf6e65c883e6f47d3d
using UnityEngine;
using UnityEngine.Events;
using System.Collections;
using System.IO.Ports;
using System.Threading;
using System.Threading.Tasks;
public class SerialPortHandler : MonoBehaviour
{
[System.Serializable]
@togucchi
togucchi / CubismSimpleLipSync.cs
Last active June 29, 2018 05:52
【Unity】Live2DCubismでシンプルなリップシンク
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Live2D.Cubism.Framework.MouthMovement;
[RequireComponent(typeof(CubismMouthController))]
public class CubismSimpleLipSync : MonoBehaviour {
[SerializeField]
CubismMouthController mouthController;
@togucchi
togucchi / WebCamToRenderTexture.cs
Last active March 19, 2021 03:44
UnityでWebCamTextureをRenderTextureに突っ込むスクリプト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WebCamToRenderTexture : MonoBehaviour {
public int index;
public RenderTexture targetTexture;
//カメラの解像度,FPS
public int width = 1920, height = 1080, fps = 30;
int prevIndex;