KodeLifeでMIDIコンを使う例です。詳細は以下の記事を参照してください。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 410 core | |
uniform float fGlobalTime; // in seconds | |
uniform vec2 v2Resolution; // viewport resolution (in pixels) | |
uniform float fFrameTime; // duration of the last frame, in seconds | |
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq | |
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients | |
uniform sampler1D texFFTIntegrated; // this is continually increasing | |
uniform sampler2D texPreviousFrame; // screenshot of the previous frame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyTool | |
{ | |
using System; | |
using UnityEditor; | |
using UnityEngine; | |
using System.Linq; | |
using UnityEngine.Rendering; | |
public class ShaderKeywordCollector : EditorWindow | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 410 core | |
uniform float fGlobalTime; // in seconds | |
uniform vec2 v2Resolution; // viewport resolution (in pixels) | |
uniform float fFrameTime; // duration of the last frame, in seconds | |
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq | |
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients | |
uniform sampler1D texFFTIntegrated; // this is continually increasing | |
uniform sampler2D texPreviousFrame; // screenshot of the previous frame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 410 core | |
uniform float fGlobalTime; // in seconds | |
uniform vec2 v2Resolution; // viewport resolution (in pixels) | |
uniform float fFrameTime; // duration of the last frame, in seconds | |
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq | |
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients | |
uniform sampler1D texFFTIntegrated; // this is continually increasing | |
uniform sampler2D texPreviousFrame; // screenshot of the previous frame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @zozuar さんのシェーダーが凄すぎたのでコードリーディング | |
// https://twitter.com/zozuar/status/1441384708441456651 | |
float i, // レイマーチングのループカウンター | |
e, // ボリュームの密度(値が小さいほど密度が濃くなる) | |
s, // fbmのループカウンター | |
g, // レイの進んだ距離(カメラのパースのためにも利用) | |
k = .01;// 0.01の定数 | |
// レイマーチングのループ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #つぶやきGLSL で #tan治郎 の解説 | |
// https://twitter.com/gam0022/status/1339584625929175042 | |
// #つぶやきGLSLとは? | |
// 1ツイートに収まる文字数の制限でGLSLのシェーダーを書く遊びです。 | |
// ハッシュタグを考慮すると 270 文字前後のようです。 | |
// @h_doxas さん開発の https://twigl.app/ を使うと、文字数カウントやGIF出力の機能があるため便利です。 | |
// FCは gl_FragCoord の短縮形です。ピクセル単位の座標が入っています。 | |
// r は resolution の短縮形です。ピクセル単位のキャンバスの解像度が入っています。 |
struct GBufferOut
{
half4 diffuse : SV_Target0; // rgb: diffuse, a: occlusion
half4 specular : SV_Target1; // rgb: specular, a: smoothness
half4 normal : SV_Target2; // rgb: normal, a: unused
half4 emission : SV_Target3; // rgb: emission, a: unused
#ifndef DO_NOT_OUTPUT_DEPTH
float depth : SV_Depth;
shadertoy.com 用のVSCode拡張をforkして、 glslfan.com や glslsandbox.com のコードでも動くように改造した。の導入手順です。
# npmをインストール
# 自分はnodeからnpm入れました
cd ~/.vscode/extensions
git clone -b glslsandbox-uniforms [email protected]:gam0022/shader-toy.git
NewerOlder