Skip to content

Instantly share code, notes, and snippets.

View AugustoMoura's full-sized avatar
🏡
Doing UE4 blueprint programming

Augusto P. Moura AugustoMoura

🏡
Doing UE4 blueprint programming
View GitHub Profile
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@AugustoMoura
AugustoMoura / synchsafe.lua
Last active December 27, 2017 08:47
Lua 5.3 - Synchsafe
-- https://en.wikipedia.org/w/index.php?title=Synchsafe&oldid=414914246
function synchsafe(i)
local ss = 0x00
local shift = 0
while i > 0 do
ss = ss | ((i & 0x7F) << shift)
i = i >> 7
shift = shift + 8
@AugustoMoura
AugustoMoura / pbr.glsl
Last active September 27, 2016 14:54 — forked from galek/pbr.glsl
PBR GLSL SHADER
#version 400
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
return {
{ `foo/b/a/r`, "name1", {145.6, 789.2, 124.12}, {1, 0, 0, 0}, { propertiex = "abc", propertiefoo = false } };
{ `foo/b/a/rxx`, "name2", {145.6, 789.2, 124.12}, {1, 0, 0, 0}, { propertiex = "abc", propertiefoo = false } };
}
local c = {
[1] = `fo/ba`;
[2] = `ba/fo/b`;
[3] = `foo/bar`
};
obj c[2] (14.2, 7878.3, 656.5) { orientation = quat(1, 0, 0, 0), name = "randomname1568" }
obj c[2] (14.2, 4545.3, 2311.5) { orientation = quat(1, 0, 0, 0), name = "randomname1569" }
obj c[1] (521.2, 1212.3, 545.5) { orientation = quat(1, 0, 0, 0), name = "randomname1570" }
obj c[2] (575.2, 554.3, 2.5) { orientation = quat(1, 0, 0, 0), name = "randomname1571" }
obj c[3] (121.2, 45.3, 10.5) { orientation = quat(1, 0, 0, 0), name = "randomname1572" }