Skip to content

Instantly share code, notes, and snippets.

Pentan / arraybench.swift
Created Sep 10, 2018
Swift Array with Dispatch concurrent performance somparison
View arraybench.swift
import Foundation
print("array bench")
print(" -o : output rendered image as \"result.ppm\"")
print(" -w Number : render image width")
print(" -h Number : render image height")
print(" -p Number : number of points")
var width = 4096
View nonono.glsl
precision mediump float;
#extension GL_OES_standard_derivatives : enable
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
#define PI 3.141592653589793
//#define PI2 6.283185307179586
View blob.glsl
#define PI05 1.570796326795
#define PI 3.1415926535898
#define kNumVertX 15.0
#define kNumVertY 15.0
//#define kNumVertZ
#define kScale 0.2
#define kTranslate vec3(-1.5)
vec3 hash3(vec3 v) {
View plasmagica.osl
Blender Advent Calendar 2015
day 16
by Pentan
Shader code is distributed under MIT license.
Plasmagica and It's logo are part of SHOW BY ROCK!! (c)SANRIO.
Pentan / feel_like_debris.glsl
Last active Dec 9, 2015 に投稿したものに日本語でコメントをつけたもの
View feel_like_debris.glsl
#define PI05 1.570796326795
#define PI 3.1415926535898
// 適当なハッシュ関数.よくあるやつですが投稿したバージョンではカッコの位置を間違えているので注意
vec3 hash3(vec3 v) {
return fract(sin(v) * vec3(43758.5453123, 12345.6789012,76543.2109876));
// 回転関連
vec3 rotX(vec3 p, float rad) {
Pentan / gpuprng.glsl
Created Mar 1, 2015
The mysterious random number generator that was used in Toshiya Hachisuka's seminar at Tokyo Demo Fest 2015.
View gpuprng.glsl
The mysterious random number generator that was used in Toshiya Hachisuka's seminar at Tokyo Demo Fest 2015.
He said that don't know detail of this algorithm.
origin (404)
#ifdef GL_ES
precision mediump float;
Pentan /
Last active Aug 29, 2015
Strange shapekey utility W.I.P.
bl_info = {
"name": "Nakawari Shapekey Utilities",
"author": "Pentan",
"version": (0, 1),
"blender": (2, 70, 0),
"location": "Object > Nakawari",
"description": "This addon makes Nakawari shapekeys for 2D hand drawn like motions.",
"warning": "experimental",
"wiki_url": "",
"category": "Animation"}
Pentan /
Last active Nov 24, 2018
Dump Blender key config as HTML.
import bpy
from bpy_extras import keyconfig_utils
import sys
# Dump Blender keyconfig as HTML.
# How to use
# 1. Open this file in Blender's Text Editor.
# 2. Do "Run Script".
# 3. New Text "keyconfigs.html" will be added.
# save it somewhere and open in web browser (recommends Safari, Chrome or Firefox).
Pentan /
Created Aug 24, 2012
Blender's script to create Envelope display type Armature like mesh.
import bpy
import math
import mathutils
from mathutils import Vector
from mathutils import Matrix
for selobj in bpy.context.selected_objects:
#print("{} is {}".format(, selobj.type))
if selobj.type == 'ARMATURE':
arm =
Pentan / ao_gcd.c
Created Aug 7, 2012
aobench ( with Grand Central Dispatch.
View ao_gcd.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <Block.h>
#include <dispatch/dispatch.h>