Skip to content

Instantly share code, notes, and snippets.

View sgnm's full-sized avatar

asagi_tokyo sgnm

View GitHub Profile
@sgnm
sgnm / glsl2gif_mp4.sh
Last active November 16, 2023 13:27
convert fragment shader to gif and mp4 file
#!/bin/sh
GIF_DIR="gif"
VIDEO_DIR="video"
convert_glsl2gif_mp4()
{
if [ ! -e ${OUTPUT_DIR}/${GIF_DIR}/${FILE_NAME}.gif ]; then
echo "exporting gif file to '${OUTPUT_DIR}/${GIF_DIR}/${FILE_NAME}.gif'"
glsl2gif $INPUT_FILE_DIR.frag -o ${OUTPUT_DIR}/${GIF_DIR}/${FILE_NAME}.gif -s 512x512 -r 30 -l 5
@sgnm
sgnm / SemiTransparent.shader
Created October 2, 2018 15:04
correct transparent effect
Shader "Custom/SemiTransparent" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Transparent" "Queue"="Transparent"}
LOD 200
Pass{
@sgnm
sgnm / setup.sh
Last active September 10, 2018 12:30
setup for Unity
#!/bin/sh
function make_directory()
{
if [ -n "$1" ]
then
mkdir $1
cd $1
fi
@sgnm
sgnm / change_resolution.sh
Last active July 19, 2018 04:26
change resolution to 1080p
#!/bin/bash
SCRIPT_NAME=`basename $0`
if [ $# -ne 2 ]; then
echo "usage: $SCRIPT_NAME input_path/ output_path/"
exit 1
fi
INPUT_DIRECTORY_PATH=$1
OUTPUT_DIRECTORY_PATH=$2
@sgnm
sgnm / export-formatted-json.sh
Created April 9, 2018 11:57
export formatted json
if [ ! -e ./out ]; then
echo "Making out directory..."
mkdir out
fi
for file in `\find . -maxdepth 1 -type f`; do
jq . $file > 'out/'${file:2}
done
echo "Finished to export formatted json!"
@sgnm
sgnm / deeplab_demo.py
Last active April 5, 2018 11:38
[WIP] deeplabのデモコード改変
# coding: utf-8
# # DeepLab Demo
#
# This demo will demostrate the steps to run deeplab semantic segmentation model on sample input images.
#
# ## Prerequisites
#
# Running this demo requires the following libraries:
@sgnm
sgnm / cut-out-graphic.cpp
Created March 14, 2018 08:06
Draw cut-out graphic using graphic
ofPath path;
int w = 250;
int h = 250;
//--------------------------------------------------------------
void ofApp::setup()
{
// set color
path.setFillColor(ofColor::black);
}
@sgnm
sgnm / easy-bloom-effect.cpp
Last active March 14, 2018 08:07
Easy bloom effect using ofxBlur
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup()
{
ofBackground(0);
ofSetFrameRate(60);
ofDisableBlendMode();
blur.setup(ofGetWidth(), ofGetHeight(), 10, .2, 4);
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1",
"${workspaceRoot}/../../../libs/openFrameworks",
@sgnm
sgnm / ofxTrueTypeFontUC.cpp
Last active February 17, 2016 01:11
oF0.9.0でofxTrueTypeFontUCが"freetype2/freetype/freetype.h not found"になるエラー ref: http://qiita.com/SuganumaShimpei/items/85061c969c94e5a3f971
#include "freetype.h"
#include "ftglyph.h"
#include "ftoutln.h"
#include "fttrigon.h"