Skip to content

Instantly share code, notes, and snippets.

Avatar

Takahiro "Poly" Horikawa thorikawa

View GitHub Profile
@thorikawa
thorikawa / Vortices.shader
Created Jun 8, 2021
Repeat vortices by ray-marching technique.
View Vortices.shader
Shader "Unlit/Vortices"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Loop ("Loop", Range(1, 100)) = 30
_Color ("Color", Color) = (0.5, 0.5, 0.5, 1.0)
_R1 ("Radius1", Float) = 10.0
_R2 ("Radius2", Float) = 2.0
}
@thorikawa
thorikawa / ARCameraBackground.cs
Created Nov 5, 2020
Modified version of ARFoundation 4.1.0 preview9's ARCameraBackground to fix an issue where changes to the CustomMaterial or useCustomMaterial values were not reflected after ARCameraBackground was once set up
View ARCameraBackground.cs
using AOT;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
namespace UnityEngine.XR.ARFoundation
{
/// <summary>
@thorikawa
thorikawa / ARCameraBackground.cs
Last active Jun 17, 2020
Modified version of ARFoundation 4.0.0 preview3's ARCameraBackground to fix an issue where changes to the CustomMaterial or useCustomMaterial values were not reflected after ARCameraBackground was once set up
View ARCameraBackground.cs
using AOT;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
namespace UnityEngine.XR.ARFoundation
{
/// <summary>
View displayinfo.cpp
static char* getDisplayName(CGDirectDisplayID displayID)
{
io_iterator_t it;
io_service_t service;
CFDictionaryRef info;
if (IOServiceGetMatchingServices(kIOMasterPortDefault,
IOServiceMatching("IODisplayConnect"),
&it) != 0)
{
@thorikawa
thorikawa / LastingStateDetector.cs
Created Aug 20, 2018
Unityで状態管理を行うための汎用クラス
View LastingStateDetector.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public delegate void OnStateIsLasting(LastingStateDetector sender, float lastingTime);
public delegate void OnStateEnter(LastingStateDetector sender);
public class LastingStateDetector
{
View circle.py
from PIL import Image, ImageDraw
im = Image.new('RGB', (500, 300), (128, 128, 128))
draw = ImageDraw.Draw(im)
im.save('test.jpg', quality=95)
R_STEP = 4
r = 4
RADIAN_STEP = math.pi * 137.5 / 180.0
View TS3633-CM1.lbr
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="8.3.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.1" unitdist="inch" unit="inch" style="lines" multiple="1" display="no" altdistance="0.01" altunitdist="inch" altunit="inch"/>
<layers>
@thorikawa
thorikawa / varspeedservoslave.ino
Created Feb 28, 2017
Arduino sketch for nanabo
View varspeedservoslave.ino
#include <VarSpeedServoSam.h>
VarSpeedServoSam servos[4];
int MAX_SPEED = 50;
int PIN_NO[] = {2, 3, 4, 5};
int MAX_DEGREE[] = {110, 110, 120, 100};
int MIN_DEGREE[] = {70, 90, 80, 80};
int INITIAL_DEGREE[] = {90, 90, 90, 90};
int flag, sid, degree, speed;
@thorikawa
thorikawa / DynamicIllusionShader.shader
Created Feb 8, 2017
Shader script to gradual appearance.
View DynamicIllusionShader.shader
Shader "Custom/DynamicIllusionShader" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
}
SubShader{
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
Pass{
CGPROGRAM
#pragma vertex vert
@thorikawa
thorikawa / japanese.txt
Last active Sep 30, 2021
日本語の文字コード範囲指定(ascii・ひらがな・カタカナ・頻出漢字)
View japanese.txt
32-128,12288-12543,12448-12543,65280-65519,19968,19971,19977,19978,19979,20013,20061,20108,20116,20154,20241,20808,20837,20843,20845,20870,20986,21147,21313,21315,21475,21491,21517,22235,22303,22805,22823,22825,22899,23376,23383,23398,23567,23665,24029,24038,24180,25163,25991,26085,26089,26376,26408,26412,26449,26519,26657,26862,27491,27671,27700,28779,29356,29577,29579,29983,30000,30007,30010,30333,30334,30446,30707,31354,31435,31481,31992,32819,33457,33609,34411,35211,35997,36196,36275,36554,37329,38632,38738,38899,19975,20024,20132,20140,20170,20250,20307,20309,20316,20803,20804,20809,20844,20869,20908,20992,20998,20999,21069,21271,21320,21322,21335,21407,21451,21476,21488,21512,21516,22238,22259,22269,22290,22320,22580,22768,22770,22799,22806,22810,22812,22826,22969,22985,23460,23478,23546,23569,23721,24037,24066,24112,24195,24215,24339,24341,24351,24369,24375,24403,24418,24460,24515,24605,25144,25165,25945,25968,26032,26041,26126,26143,26149,26172,26178,26228,26332,26360,26397,26469,26481,27005,27468,274