Skip to content

Instantly share code, notes, and snippets.

View armadillu's full-sized avatar

Oriol Ferrer Mesià armadillu

View GitHub Profile
@soma-arc
soma-arc / gltf-metallic-roughness.brdf
Last active June 15, 2019 11:57
glTF 2.0 PBR materials metaric-roughness shader for BRDF Explorer
analytic
# glTF 2.0 PBR Materials
# metallic-roughness
# Reference:
# glTF Specification, 2.0
# https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#metallic-roughness-material
# glTF 2.0: PBR Materials by Saurabh Bhatia. May 2017
# https://www.khronos.org/assets/uploads/developers/library/2017-gtc/glTF-2.0-and-PBR-GTC_May17.pdf
# glTF-WebGL-PBR
@victor-shepardson
victor-shepardson / pytorch-glumpy.py
Last active February 23, 2025 17:12
using pycuda and glumpy to draw pytorch GPU tensors to the screen without copying to host memory
from contextlib import contextmanager
import numpy as np
import torch
from torch import Tensor, ByteTensor
import torch.nn.functional as F
from torch.autograd import Variable
import pycuda.driver
from pycuda.gl import graphics_map_flags
from glumpy import app, gloo, gl
@HalfdanJ
HalfdanJ / alphafbo.cpp
Created May 25, 2016 19:00
ofFbo with premultiplied alpha
// Kudos to armadilly
fbo.begin();
///pre-multiply background color of the fbo for correct blending!
ofClear(ofColor(fboBgColor * (fboBgColor.a / 255.) , fboBgColor.a));
//Set this blending mode for anything you draw INSIDE the fbo
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
//your draw code here!
fbo.end();
@kylemcdonald
kylemcdonald / SeeneViewer.cpp
Last active October 11, 2017 18:20
Seene Viewer with C++ in openFrameworks.
// Based on https://github.com/detunized/seene-viewer
#include "ofMain.h"
inline bool ends_with(std::string const & value, std::string const & ending)
{
if (ending.size() > value.size()) return false;
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
}
@roddds
roddds / gist:a1f42bae598028ac7809
Last active December 8, 2020 22:46 — forked from raddevon/gist:67935d320ee9b726d19d
Adobe tries to strong-arm me into keeping Creative Cloud

To everyone who got here through Twitter or Facebook or Hacker News or whatever: THIS IS NOT ME.

The "Me" in this transcript is @raddevon, who shared his story first on reddit.


List of incompetent jackasses who can't check a source if their lives depended on it:

@kylemcdonald
kylemcdonald / build-caffe.md
Last active March 26, 2024 05:52
How to build Caffe for OS X.

Theory of Building Caffe on OS X

Introduction

Our goal is to run python -c "import caffe" without crashing. For anyone who doesn't spend most of their time with build systems, getting to this point can be extremely difficult on OS X. Instead of providing a list of steps to follow, I'll try to explain why each step happens.

This page has OS X specific install instructions.

I assume:

@jbergler
jbergler / .gitignore
Last active April 9, 2024 19:49
Acestream on Mac
.vagrant
@kylemcdonald
kylemcdonald / Voyager 1 Decode.ipynb
Created August 7, 2015 16:46
Voyager 1 Decoding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kureta
kureta / CMakeLists.txt
Last active October 2, 2015 15:27
openFrameworks CLion OS X CMake files
cmake_minimum_required(VERSION 2.8.4)
cmake_policy(SET CMP0042 NEW)
project(emptyExample)
set(APP_NAME emptyExample)
set(BUNDLE_NAME "emptyExample")
# ===================== oF Directory =====================
set(OF_DIRECTORY "!!!!!!!!!!! ENTER YOUT OPENFRAMEWORKS DIRECTORY !!!!!!!!!!!")
# ========================================================
@roxlu
roxlu / Uploader.php
Last active December 12, 2015 08:19
Highly configurable (auto) file uploader. A util/application which makes HTTP POSTS based on entries of a table from a database and upload specified fields as file-posts. Contact me on twitter (twitter.com/roxlu or by mail info[.......]roxlu[....]com for more info and/or binaries for windows, mac and linux)
<?php
/**
* Version 0.0.1
* -------------
*
* Uploader handler for uploader util.
* ----------------------------------
* Example class which handles a file upload from the
* uploader utility. This class doesn't do a lot, except