Skip to content

Instantly share code, notes, and snippets.

View prideout's full-sized avatar
🎯
Focusing

Philip Rideout prideout

🎯
Focusing
View GitHub Profile
@prideout
prideout / monograph.py
Created March 25, 2020 20:38
pandoc + puppeteer
from pypandoc import *
import json
import os
print('generating HTML...')
outfolder = '../docs/graceful'
content = open('monograph.md', 'r').read()
HTML_ARGS = ['--filter=html_filter.py']
body = convert_text(content, "html", "md", extra_args=HTML_ARGS)
@prideout
prideout / glfw_filament.cpp
Created March 25, 2020 19:16
GLFW+Filament
static void resizeCallback(GLFWwindow* win, int width, int height) {
void* nsview = platform_get_view(glfwGetCocoaWindow(win));
app.engine->destroy(app.swap_chain);
app.swap_chain = app.engine->createSwapChain(nsview);
app.window_width = width;
app.window_height = height;
glfwGetWindowContentScale(win, &app.dpi_scale[0], &app.dpi_scale[1]);
app.gui->helper->setDisplaySize(width / app.dpi_scale[0], height / app.dpi_scale[1],
app.dpi_scale[0], app.dpi_scale[1]);
/**
* cgltf_write - a single-file glTF 2.0 writer written in C99.
*
* Version: 1.0
*
* Website: https://github.com/jkuhlmann/cgltf
*
* Distributed under the MIT License, see notice at the end of this file.
*
* Building:
@prideout
prideout / filter.py
Created April 24, 2019 19:13
filter out nodes and textures from glTF
#!/usr/bin/env python3
import json
import re
import sys
infile = 'Bistro_Exterior.gltf'
outfile = 'out.gltf'
name_pattern = 'BISTRO_RESEARCH_EXTERIOR_PARIS_BUILDING.*|BISTRO_RESEARCH_EXTERIOR_PARIS_STREET_.*'
https://github.com/KhronosGroup/VK-GL-CTS/blob/master/external/vulkancts/README.md
cd ~/cts
git clone https://github.com/KhronosGroup/VK-GL-CTS.git
cd VK-GL-CTS
python external/fetch_sources.py
python scripts/android/build_apk.py --sdk /Users/prideout/Library/Android/sdk/ --ndk /Users/prideout/Library/Android/sdk/ndk-bundle/ --abis armeabi-v7a
python scripts/android/install_apk.py
cp external/vulkancts/mustpass/1.1.5/vk-default.txt .
filament.js:6 FEngine (32 bits) created at 0x52a290 (threading is disabled)
filament.js:6 prideout BindTexture unit=15 texture=9
filament.js:6 prideout TexStorage texture=34067 internalFormat=0x8058
filament.js:6 prideout BindTexture unit=15 texture=11
filament.js:6 prideout TexStorage texture=3553 internalFormat=0x881b
filament.js:6 prideout BindTexture unit=15 texture=12
filament.js:6 prideout TexStorage texture=34067 internalFormat=0x83f3
filament.js:6 prideout BindTexture unit=15 texture=13
filament.js:6 prideout TexStorage texture=34067 internalFormat=0x8058
filament.js:6 prideout BindTexture unit=15 texture=23
@prideout
prideout / color.vert
Created November 14, 2018 18:15
depth pass and color pass
#version 310 es
#define TARGET_MOBILE
precision highp float;
precision highp int;
invariant gl_Position;
#if defined(TARGET_MOBILE)
#define HIGHP highp
@prideout
prideout / before_dce.glsl
Last active November 13, 2018 16:44
Before_DCE
#version 310 es
// glslc -std=310es -fshader-stage=vertex before_dce.glsl
// spirv-opt -Os a.spv -o b.spv
// spirv-cross b.spv
invariant gl_Position;
uniform FrameUniforms {
mat4 clipFromWorldMatrix;
@prideout
prideout / servewasm.py
Created November 8, 2018 00:44
Python WASM server
#!/usr/bin/env python3
import http.server
import socketserver
PORT = 8000
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map.update({
'.wasm': 'application/wasm',