Skip to content

Instantly share code, notes, and snippets.

View went5's full-sized avatar
🟪
#8491C3

went5 went5

🟪
#8491C3
View GitHub Profile
@went5
went5 / Grayscale.shadergraph
Last active July 17, 2022 09:08
Unityのポストエフェクトに必要なファイル
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "846b720daa234189888e682ef96a9201",
"m_Properties": [
{
"m_Id": "f3154d49096f4a8aa3639b6bb9f1b958"
},
{
"m_Id": "b722c38c97db4218971d2ac3f6ee8964"
import dynamic from "next/dynamic";
import p5Types from "p5";
const Sketch = dynamic(import("react-p5"), {
loading: () => <></>,
ssr: false,
});
const LinearColorSpaceGradient = () => {
let rectHeight: number;
let rectWidth: number;
Shader "Custom/HalfLambert"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
[Toggle(IS_DARK)] _IsDark ("Is Dark", Float) = 0
}
SubShader
{
Shader "Custom/SpriteAnimation"
{
Properties
{
[NoScaleOffset] _MainTex ("Main Texture", 2D) = "white" {}
_Column ("Column",Int) = 0
_Row ("Row",Int) = 0
}
SubShader
{
Shader "Custom/VertexColorAnimation"
{
Properties {}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
@went5
went5 / went5-math.ts
Last active March 21, 2022 05:26
typescript用の数学関数まとめ
const Gravity = 9.8;
export const DegreeToRadian = (degree: number) => {
return degree * (Math.PI / 180);
};
export const ProjectileMotionX = (v0: number, degree: number, time: number) => {
return v0 * Math.cos(DegreeToRadian(degree)) * time;
};
export const ProjectileMotionY = (v0: number, degree: number, time: number) => {
@went5
went5 / FlagAnimation.shader
Last active March 22, 2022 23:02
Flag Animation
Shader "Custom/FlagAnimation"
{
Properties
{
[NoScaleOffset] _MainTex ("Albedo (RGB)", 2D) = "white" {}
_WaveFreq ("Wave Freq",float ) = 1.0
_TimeSpeed ("Time Speed",float ) = 1.0
}
SubShader
{