Skip to content

Instantly share code, notes, and snippets.

Avatar

Florian Dormont Eiyeron

View GitHub Profile
@Eiyeron
Eiyeron / pico-8.txt
Last active May 26, 2020
Pico-8 themed Dwarf Fortress palette (using extra colors)
View pico-8.txt
[BLACK_R:0]
[BLACK_G:0]
[BLACK_B:0]
[BLUE_R:29]
[BLUE_G:43]
[BLUE_B:83]
[GREEN_R:0]
[GREEN_G:135]
[GREEN_B:81]
[CYAN_R:18]
@Eiyeron
Eiyeron / imgui-gruvbox.cpp
Created May 10, 2020
Gruvbox theme for dear imgui
View imgui-gruvbox.cpp
void gruvboxDark()
{
auto &style = ImGui::GetStyle();
style.ChildRounding = 0;
style.GrabRounding = 0;
style.FrameRounding = 0;
style.PopupRounding = 0;
style.ScrollbarRounding = 0;
style.TabRounding = 0;
style.WindowRounding = 0;
@Eiyeron
Eiyeron / ffmpeg_rencode_gpu.bat
Created May 6, 2020
Batch file to reencode video files in an hopefully Twitter-compatible way
View ffmpeg_rencode_gpu.bat
@echo off
set /p quality="Quality: "
ffmpeg -hwaccel nvdec -c:v h264_cuvid -i %1 -c:v h264_nvenc -rc:v vbr_hq -cq:v %quality% -b:v 2500k -maxrate:v 5000k -profile:v high -pix_fmt yuv420p out.mp4
REM Here's the version without GPU-accelerated encoding
REM ffmpeg -i %1 -crf %quality% -b:v 2500k -maxrate:v 5000k -pix_fmt yuv420p out.mp4
View affine.glsl
#version 150
// Using Kodelife for the realtime preview/test environment but it should work fine on any shader that
// - offers the output's resolution
// - a time clock in seconds
// - an UV mapped on screenspace from [0,0] to [1,1]
uniform float time;
uniform vec2 resolution;
View fire_fine.lua
-- accumulative random
-- allows for progressively
-- variating value instead
-- of pure random
function vrnd()
local start = 50
return function()
start = start + rnd(1)* (flr(rnd(2)) == 1 and 1 or -1)
start = mid(40,start,100)
return start
@Eiyeron
Eiyeron / eb_shader.glsl
Last active Apr 22, 2020
Earthbound-ish background shader
View eb_shader.glsl
/*
Copyright © 2019, Florian Dormont
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders X be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the
@Eiyeron
Eiyeron / CustomSound.hx
Last active Feb 10, 2019
Haxe/Heaps custom Sound/Data class pair to generate sound on the fly. Beware, it's experimental and prone to crash if you tweak the wrong knobs.
View CustomSound.hx
import hxd.snd.Data;
import hxd.res.Sound;
// This class should work like a Sound. Jsut create one and call play and a lo-fi generated tune should ring.
// You can check out a bit more about bytebeat there : http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
class CustomSound extends Sound {
public function new() {
super(null);
data = new SoundDataGenerator();
}
View gist:aefcf491a2549ad309cffbd9543805f9
https://modarchive.org/module.php?117240 - Nice ambiance
https://modarchive.org/module.php?1433 - TAAAAKE OOOOON MEEEEEE
https://modarchive.org/module.php?158865
https://modarchive.org/module.php?72054 - I like how it sounds
https://modarchive.org/module.php?34032 - Suggested by DJ PIE, I REGRET NOTHING
https://modarchive.org/module.php?85382
https://modarchive.org/module.php?158294
https://modarchive.org/module.php?55638
https://modarchive.org/module.php?72635 - I think I enjoy all those drum loop samples.
https://modarchive.org/module.php?93118
@Eiyeron
Eiyeron / reflect.glsl
Created Oct 1, 2017
Love2D shader for realtime palette swap + EB-like sine-based distorsions
View reflect.glsl
#define PALETTE_SIZE 4
uniform float time = 0;
// Good old wave effect
uniform vec2 amplitude = vec2(0 / 128., 8/128.);
uniform vec2 speed = vec2(1., 2.);
uniform vec2 frequency = vec2(1, 3);
uniform float sampling_factor = 0.5;
uniform vec3 palette[PALETTE_SIZE+1];
uniform bool inverse = false;
View Class.hx
class LanguageSelectionState extends FlxFSMState<BattleEngine> {
var localeButtons:Array<FlxButton>;
var localeFlags:Array<FlxSprite>;
var locales:Array<String>;
var background:FlxSprite;
var okButton:FlxButton;
public function new()
{
super();
You can’t perform that action at this time.