Skip to content

Instantly share code, notes, and snippets.

View kaadmy's full-sized avatar

Kaadmy kaadmy

View GitHub Profile
#define BLOOM_LEVELS 6
int bloom_size[BLOOM_LEVELS][2];
GLuint bloom_fbo[BLOOM_LEVELS][2];
GLuint bloom_tex[2];
void bloomInit(void) {
for(int j = 0; j < 2; j++) {
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <pthread.h>
#include <stdatomic.h>
/*
Some terminology:
```c
#define BLOOM_LEVELS 7
int size_bloom[BLOOM_LEVELS][2];
size_bloom[0][0] = MAX(viewport_size_quarter[0], 64);
size_bloom[0][1] = MAX(viewport_size_quarter[1], 64);
for(int i=1; i<BLOOM_LEVELS; i++) {
size_bloom[i][0] = MAX(ize_bloom[i - 1][0] / 2, 1);
extends Spatial
export var interpolate_position = true
export var interpolate_rotation = true
const lerp_duration = 1.0 / Engine.iterations_per_second
var lerp_elapsed = 0.0
var lerp_transform_previous = Transform()
#! /bin/sh
# Set this to "sudo" if you're installing in a root directory eg. /usr/local
SUDO=
#SUDO=sudo
CORES=`nproc`
DEFAULTINSTALLDIR=`pwd`/install
# Meshes are a big endian binary blob.
# Format:
# {header: "LMM"}
# [int:vertcount]
# ([float*3:position], [float*3:normal], [float*2:texcoord]) * vertcount
#
# Limitations:
# Max vertices: 2147483648
# Vertex count MUST be a multiple of 3, may cause fatal errors otherwise
@kaadmy
kaadmy / gist:0ed16c4f12de1f3c19e811580ac60ac5
Last active July 25, 2017 22:56
Joining floating point numbers

Method for joining two floating point numbers together

Conditions:

  1. Both input values must be in the range between 0.0 to 1.0
  2. First value must not have more than 3 digits of accuracy (Changeable)

Python implementation:

@kaadmy
kaadmy / git_rebase.md
Last active July 25, 2017 04:19
Git rebase

Copied from a Stackoverflow answer for posterity

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

// DECORATE; GLDEFS is at the end of this file
Actor MeltRailgunPuff : BulletPuff
{
VSpeed 0
-ALLOWPARTICLES
+ALWAYSPUFF
-RANDOMIZE
+PUFFONACTORS
States