Skip to content

Instantly share code, notes, and snippets.

View keijiro's full-sized avatar

Keijiro Takahashi keijiro

View GitHub Profile
@keijiro
keijiro / windows-installation-steps.md
Last active December 5, 2022 07:03
This is how I set up a Windows system.
@keijiro
keijiro / ffmpeg.bat
Created October 9, 2016 05:51
ffmpeg cheatsheet
:: Trim from 2″ for 3 seconds, and encode into a "Twitter friendly" format.
ffmpeg -i source.mp4 -pix_fmt yuv420p -an -ss 2 -t 3 temp.mp4
:: Make a palette for GIF.
ffmpeg -i temp.mp4 -vf palettegen=max_colors=24 palette.png
:: Make a GIF with the palette.
ffmpeg -i temp.mp4 -i palette.png -filter_complex "scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse" -r 30 out.gif
@keijiro
keijiro / ubuntu-install-setup.md
Last active November 22, 2022 04:56
This is how I set up a Ubuntu Linux system.
  • Install Ubuntu using rufus and a USB stick.
  • Install the NVIDIA dirver from "Software & Updates" - "Additional Drivers".
  • Install Mozc input method from "Region & Language" - "Input Sources".
  • Install Unity Hub by following these steps.
  • Install Git, Vim and Vulkan.
    • sudo apt install git vim vulkan-tools
  • Sign in to GitHub and add a new SSH key.
    • ssh-keygen -t rsa -b 4096 -C "keijiro@gmail.com"
  • Clone dotfiles and run setup.
@keijiro
keijiro / template.glsl
Last active November 13, 2022 19:13
KodeLife Fragment Shader Template
#version 150
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
uniform vec3 spectrum;
uniform sampler2D texture0;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform sampler2D texture3;
@keijiro
keijiro / 00_blot7.md
Last active November 2, 2022 08:58
KodeLife fragment shader sketch

gif

@keijiro
keijiro / Mobile-Particle-Add.shader
Created April 23, 2015 03:57
Mobile/Particles/Additive shader (Unity built-in shader)
// Simplified Additive Particle shader. Differences from regular Additive Particle one:
// - no Tint color
// - no Smooth particle support
// - no AlphaTest
// - no ColorMask
Shader "Mobile/Particles/Additive" {
Properties {
_MainTex ("Particle Texture", 2D) = "white" {}
}

LASP

LASP is a Unity plugin providing low-latency audio input features that are useful to create audio-reactive visuals.

Demos

gif

using UnityEngine;
sealed class Test : MonoBehaviour
{
float life;
void Test1()
{
(float, int) attack = (3.5f, 8);
life -= attack.Item1 * attack.Item2;
@keijiro
keijiro / 00_AnimationProcessor.md
Last active September 25, 2022 03:47
[Unity] アニメーションのインポート設定を自動化する

アニメーションのインポート設定を自動化する

Unity のアニメーションのインポート設定(下画像)には様々な項目がありますが、これを手動でひとつひとつ設定していくのは、かなりしんどいです。お決まりの設定がある場合には、スクリプトで自動化してしまうのがよいでしょう。この文書では、その自動化の方法を紹介します。

Animation Clip Settings

スクリプトからオプションを変更する

これらのインポート設定は ModelImporter.clipAnimationsModelImporterClipAnimation の配列として格納されています。これを舐める形で変更していけば、一括でお好みの設定を適用できます。

@keijiro
keijiro / UnityStation_BoltMinis.md
Last active August 17, 2022 13:48
BoltとMIDIでグリグリコントロール!UnityでMIDI デバイスを使ってみよう! - Unityステーション