Skip to content

Instantly share code, notes, and snippets.

View prideout's full-sized avatar
🎯
Focusing

Philip Rideout prideout

🎯
Focusing
View GitHub Profile
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
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 .
@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_.*'
/**
* 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 / 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]);
@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 / MainActivity.kt
Created April 2, 2020 23:40
getting-started-init
import com.google.android.filament.utils.*
class MainActivity : Activity() {
companion object {
init { Utils.init() }
}
// ...
@prideout
prideout / build.gradle
Last active May 4, 2020 20:16
getting-started-gradle
dependencies {
implementation 'com.google.android.filament:filament-android:1.6.0'
implementation 'com.google.android.filament:filament-utils-android:1.6.0'
implementation 'com.google.android.filament:gltfio-android:1.6.0'
// ...
}
@prideout
prideout / MainActivity.kt
Created April 2, 2020 23:45
getting-started-oncreate
private lateinit var surfaceView: SurfaceView
private lateinit var choreographer: Choreographer
private lateinit var modelViewer: ModelViewer
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
surfaceView = SurfaceView(this).apply { setContentView(this) }
choreographer = Choreographer.getInstance()
modelViewer = ModelViewer(surfaceView)
surfaceView.setOnTouchListener(modelViewer)
@prideout
prideout / MainActivity.kt
Last active May 4, 2020 20:15
getting-started-framevents
private val frameCallback = object : Choreographer.FrameCallback {
override fun doFrame(currentTime: Long) {
choreographer.postFrameCallback(this)
modelViewer.render(currentTime)
}
}
override fun onResume() {
super.onResume()
choreographer.postFrameCallback(frameCallback)