This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
precision highp float; | |
// The PBR shader below is adapted from the Khronos glTF WebGL example: | |
// https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/master/shaders/pbr-frag.glsl | |
struct PBRInfo { | |
float NdotL; // cos angle between normal and light direction | |
float NdotV; // cos angle between normal and view direction | |
float NdotH; // cos angle between normal and half vector | |
float LdotH; // cos angle between light direction and half vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import os | |
import subprocess | |
from glob import glob | |
from wand.image import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Language: Cpp | |
AccessModifierOffset: -2 | |
AlignAfterOpenBracket: false | |
AlignConsecutiveAssignments: false | |
AlignEscapedNewlinesLeft: false | |
AlignOperands: false | |
AlignTrailingComments: false | |
AllowAllParametersOfDeclarationOnNextLine: true | |
AllowShortBlocksOnASingleLine: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "BlockTimer.hpp" | |
using namespace cinder; | |
class FnNode : public audio::Node { | |
std::function<void()> mFunc; | |
protected: | |
void process(audio::Buffer *buffer) override { | |
mFunc(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Largely, these are taken from | |
// http://pouet.net/topic.php?which=7931&page=1&x=28&y=8 and | |
// http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm and | |
// organized here for convenience. | |
// Euler Rotation | |
void rX(inout vec3 p, float t) { | |
float c = cos(t), s = sin(t); vec3 q = p; | |
p.y = c * q.y - s * q.z; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<style> | |
html, body { | |
padding: 0; margin: 0; | |
} | |
#tris > path { | |
stroke: #fff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var derby = require('derby') | |
, app = derby.createApp(module) | |
app.get('/', function(page, model, params, next) { | |
model.subscribe("result", function(err, all) { | |
page.render() | |
}) | |
}) | |
app.ready(function(model) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Middleware Function | |
expressApp.use(function(req, res, next) { | |
req.getModel().subscribe("*", function(err, model) { | |
model.on("set", "*", function(path, value) { | |
console.log("Middleware - %s: %s", path, value) | |
}) | |
next() | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var size = 9; | |
var size_half = Math.floor(size / 2); | |
var offs = []; | |
for(var y = size; --y >= 0;){ | |
for(var x = size; --x >= 0;){ | |
var ox = x - size_half; | |
var oy = y - size_half; | |
var dist = Math.sqrt(ox * ox + oy * oy); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chars = "abcdefghijklmnopqrstuvwxyz"; | |
require("plask").simpleWindow({ | |
init: function(){ | |
this.paint.setFontFamily("Myriad Pro"); | |
this.paint.setColor(255, 255, 255); | |
this.canvas.drawColor(0, 0, 0); | |
this.framerate(60); | |
}, |
NewerOlder