Skip to content

Instantly share code, notes, and snippets.

View gam0022's full-sized avatar
😇
なの

がむ gam0022

😇
なの
View GitHub Profile
@gam0022
gam0022 / ShaderKeywordCollector.cs
Last active March 13, 2024 06:33 — forked from rngtm/ShaderKeywordCollector.cs
Unityプロジェクト内に存在するすべてのマテリアルのシェーダーキーワードをShaderVariantCollectionへ登録するツール (Unity2022 / URP14.0.10)
namespace MyTool
{
using System;
using UnityEditor;
using UnityEngine;
using System.Linq;
using UnityEngine.Rendering;
public class ShaderKeywordCollector : EditorWindow
{
@gam0022
gam0022 / sender_inerciaroyale_gam0022.glsl
Created December 2, 2023 00:15
GLSL LiveCoding@Inércia 2023
#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
@gam0022
gam0022 / livecoding_2023_11_04.glsl
Created November 8, 2023 13:27
GLSLライブコーディング@新千歳空港国際アニメーション映画祭
#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
@gam0022
gam0022 / README.md
Last active December 11, 2021 07:36
[TDF2021] Lightning Tunnel

Lightning Tunnel

25分でライブコーディングしたシェーダーです。

This shader was coded in 25 minutes.

Shader showdown quarter-final at #TokyoDemoFest

#GLSL #Bonzomatic #Shader #LiveCoding

@gam0022
gam0022 / zozuar-cloud.glsl
Last active October 24, 2021 07:07
@zozuar さんのシェーダーが凄すぎたのでコードリーディング
// @zozuar さんのシェーダーが凄すぎたのでコードリーディング
// https://twitter.com/zozuar/status/1441384708441456651
float i, // レイマーチングのループカウンター
e, // ボリュームの密度(値が小さいほど密度が濃くなる)
s, // fbmのループカウンター
g, // レイの進んだ距離(カメラのパースのためにも利用)
k = .01;// 0.01の定数
// レイマーチングのループ
@gam0022
gam0022 / tanjiro.glsl
Last active December 21, 2020 06:22
#つぶやきGLSL で #tan治郎 の解説
// #つぶやきGLSL で #tan治郎 の解説
// https://twitter.com/gam0022/status/1339584625929175042
// #つぶやきGLSLとは?
// 1ツイートに収まる文字数の制限でGLSLのシェーダーを書く遊びです。
// ハッシュタグを考慮すると 270 文字前後のようです。
// @h_doxas さん開発の https://twigl.app/ を使うと、文字数カウントやGIF出力の機能があるため便利です。
// FCは gl_FragCoord の短縮形です。ピクセル単位の座標が入っています。
// r は resolution の短縮形です。ピクセル単位のキャンバスの解像度が入っています。
@gam0022
gam0022 / fragmentShader.glsl
Created December 7, 2016 18:06
three.js r82の組み込みuniform/attribute
precision highp float;
precision highp int;
#define SHADER_NAME ShaderMaterial
#define GAMMA_FACTOR 2
#define NUM_CLIPPING_PLANES 0
#define UNION_CLIPPING_PLANES 0
uniform mat4 viewMatrix;
uniform vec3 cameraPosition;
#define TONE_MAPPING
#define saturate(a) clamp( a, 0.0, 1.0 )
@gam0022
gam0022 / vscode-glslfan.md
Last active May 29, 2019 12:46
shadertoy用のVSCode用の拡張をglslfanやglslsandbox用に改造したので導入手順
@gam0022
gam0022 / memo.md
Last active November 3, 2018 06:35
uRaymarching
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;