Skip to content

Instantly share code, notes, and snippets.

View hiroyuki's full-sized avatar

hiroyuki hori - horristic hiroyuki

View GitHub Profile
@Matt54
Matt54 / MetalWavyPlaneView.swift
Created July 31, 2024 04:23
RealityView comparing a wave plane animation of a LowLevelMesh between a pure Swift and a Metal shader implementation
import SwiftUI
import RealityKit
import Metal
struct MetalWavyPlaneView: View {
@State private var phase: Float = 0.0
@State private var mesh: LowLevelMesh?
@State private var timer: Timer?
let resolution = 250
@Matt54
Matt54 / WavyPlaneView.swift
Created July 29, 2024 04:05
RealityView with a plane (modulated by a sine wave) and a point light
import SwiftUI
import RealityKit
struct WavyPlaneView: View {
@State private var phase: Float = 0.0
@State private var mesh: LowLevelMesh?
@State private var timer: Timer?
let resolution = 60
var body: some View {
@keijiro
keijiro / 00_blot7.md
Last active July 13, 2024 01:09
KodeLife fragment shader sketch

gif

@mantissa
mantissa / TextureArrayShader.frag
Last active May 14, 2022 10:17
GL_TEXTURE_2D_ARRAY in OpenFrameworks
#version 150
#define MAX_TEXTURES 2
uniform sampler2DArray textures;
uniform int texID;
in vec2 vTexCoord;
@dot
dot / main.cc
Created September 6, 2011 09:25
messagepack with raw_ref
// g++ -g -O0 -Wall -fPIC -I/usr/local/include/ -L/usr/local/lib/ -lmsgpack main.cc -o main
#include <iostream>
#include <msgpack.hpp>
struct Result {
public:
msgpack::type::raw_ref message;
Result() {}
MSGPACK_DEFINE( message);
@mizutomo
mizutomo / msgpack_pointer.cpp
Created June 7, 2010 03:01
MessagePackによるポインタ型のシリアライズ/デシリアライズ
#include <msgpack.hpp>
#include <vector>
#include <map>
#include <iostream>
#include <cstdio>
struct point_t {
float x;
float y;
float z;