Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

rngtm rngtm

💭
I may be slow to respond.
View GitHub Profile
@rngtm
rngtm / MobiusRing
Last active Feb 1, 2021
Houdini VEX でメビウスの輪
View MobiusRing
// tの分割数
int tDiv = 200;
// r
float rMin = -1; // rの最小値
float rMax = 1; // rの最大値
int rDiv = 2; // rの分割数
// t
float tMin = 0; // tの最小値
@rngtm
rngtm / HexagonTile.hlsl
Last active Dec 27, 2020
Unity ShaderGraphのCustomFunctionで六角形タイルを作るためのHLSLファイル
View HexagonTile.hlsl
void HexagonTile_float(
float2 UV,
float Scale,
out float Hexagon, // 六角形
out float2 HexPos, // 六角形の位置
out float2 HexUV, // 六角形内のUVを出力
out float2 HexIndex // 六角形の番号
)
{
///////////////////////////////////////////////////////////////////
@rngtm
rngtm / TimeFrameConverter.cs
Last active Mar 5, 2020
時間 <->フレーム数 の相互変換ツール
View TimeFrameConverter.cs
using UnityEngine;
using UnityEditor;
namespace Tools
{
public class TimeFrameConverter : EditorWindow
{
static private Color darkColor = new Color(216f , 222f , 226f, 255f) / 255f;
static private GUIStyle rowStyle = null;
static private GUIStyle valueBoxStyle = null;
@rngtm
rngtm / Particle-AlphaBlended-Clamp.shader
Created Jan 9, 2020
TEXCOORD0.zで2値化するParticleSystem用シェーダー。 Unity2017.4.24f1で動作確認済み
View Particle-AlphaBlended-Clamp.shader
Shader "Custom/Particles/Alpha Blended - Clamp(TEXCOORD0.z)" {
Properties{
_MainTex("Grayscale Texture", 2D) = "white" {}
}
Category{
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane" }
Blend SrcAlpha OneMinusSrcAlpha // Alpha Blended
ColorMask RGB
Cull Off Lighting Off ZWrite Off
@rngtm
rngtm / random_walk_spread.pde
Last active Jan 5, 2019
ランダムウォークを複数回描画してpng出力するprocessingコード(.pde)
View random_walk_spread.pde
final boolean isSave = true; // save as png
final int FrameN = 4;
final int N = 5000; // random walk number
final int alpha = 15; // line alpha
// random walk parameter
final float startRadius = 45;
final float addRadius = 45;
@rngtm
rngtm / TriangleNode.cs
Last active Oct 6, 2020
正三角形タイルを出力するShaderGraphカスタムノード
View TriangleNode.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.ShaderGraph;
using System.Reflection;
[Title("Distance", "Triangle")]
public class TriangleNode : CodeFunctionNode
{
public TriangleNode()
@rngtm
rngtm / GenerateManyPlane.cs
Created Dec 21, 2018
板を1メッシュで大量に生成するC#スクリプト
View GenerateManyPlane.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
/// <summary>
/// エディター拡張
/// </summary>
@rngtm
rngtm / HexagonNode.cs
Last active Jan 30, 2021
六角形タイルを作るShaderGraphカスタムノード
View HexagonNode.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.ShaderGraph;
using System.Reflection;
[Title("Distance", "Hexagon")]
public class HexagonNode : CodeFunctionNode
{
public HexagonNode()
@rngtm
rngtm / RaymarchingSphereNode.cs
Last active Dec 30, 2018
レイマーチングで球をたくさん表示するシェーダーグラフカスタムノード
View RaymarchingSphereNode.cs
using System.Reflection;
using UnityEditor.ShaderGraph;
using UnityEngine;
/// <summary>
/// レイマーチングで球をたくさん表示するカスタムノード
/// </summary>
[Title ("Raymarching", "Raymarch Sphere")]
public class RaymarchingSphereNode : CodeFunctionNode {
public RaymarchingSphereNode () {
@rngtm
rngtm / GenerateBezierTube.cs
Last active Nov 28, 2018
ベジエ曲線に沿ったチューブ型メッシュを生成するスクリプト
View GenerateBezierTube.cs
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
[CustomEditor(typeof(GenerateBezierTube))]
public class GenerateBezierTubeInspector : Editor
{
public override void OnInspectorGUI()
{
var bezierTube = target as GenerateBezierTube;