Skip to content

Instantly share code, notes, and snippets.

View Luomu's full-sized avatar

Kimmo Kotajärvi Luomu

  • Vancouver, Canada
View GitHub Profile
@Luomu
Luomu / main.rb
Last active January 14, 2024 00:05
Clouds!
require 'app/noise.rb'
# Layered cloud demo using seamless noise generated into pixel arrays
# Composited on screen using render targets
# Size of the fractal texture
Size = 128
def rgba_to_hex r, g, b, a
return [r,g,b,a].pack('C*').unpack('L').first
@Luomu
Luomu / main.cpp
Created November 24, 2018 03:08
A simple monophonic synth using sdl/imgui
#include "imgui.h"
#include "imgui_impl_sdl.h"
#include "imgui_impl_opengl3.h"
#include <stdio.h>
#include <SDL.h>
#include <GL/gl3w.h>
#include <string>
#include <iostream>
//A simple "analog" monophonic synthesizer!
<html>
<head></head>
<body>Hello!</body>
</html>
https://www.google.com/fonts#UsePlace:use/Collection:Economica
mogrify -format jpg -path tn -thumbnail 250x250^ -gravity center -extent 250x250 *.png
<html>
<head>
<style>
body {
background-color: black;
color: white;
text-transform: uppercase;
overflow: hidden;
}
I keep forgetting the url.
http://index.gl/
@Luomu
Luomu / gist:6908895
Created October 9, 2013 21:38
Vector swizzles :)
#http://stackoverflow.com/questions/16446374/generating-all-permutations-with-repetition
alphabet = [ 'x', 'y', 'z', 'w' ]
def symbolic_increment( symbol, alphabet, num_items):
## increment our "symbolic" number by 1
symbol = list(symbol)
## we reverse the symbol to maintain the convention of having the LSD on the "right"
symbol.reverse()
place = 0;
while place < len(symbol):
@Luomu
Luomu / lutgen
Created August 15, 2013 14:48
Identity color look-up table generator
import PIL
from PIL import Image
import os
from os import path
filename = "lut32.bmp"
lutSize = 32;
incr = 255.0 / (lutSize - 1)
img = Image.new("RGB", (lutSize * lutSize, lutSize))
@Luomu
Luomu / gist:5941894
Created July 7, 2013 01:25
RTT test in MV
diff --git a/src/ModelViewer.cpp b/src/ModelViewer.cpp
index 3145ce0..011cc8d 100644
--- a/src/ModelViewer.cpp
+++ b/src/ModelViewer.cpp
@@ -105,6 +105,14 @@ ModelViewer::ModelViewer(Graphics::Renderer *r, LuaManager *lm)
animSlider = 0;
onModelChanged.connect(sigc::mem_fun(*this, &ModelViewer::SetupUI));
+
+ Graphics::RenderTargetDesc rtd(256, 256, Graphics::TEXTURE_RGB_888, Graphics::TEXTURE_DEPTH, false);