Skip to content

Instantly share code, notes, and snippets.

View h3r's full-sized avatar
🐦

Hermann Plass h3r

🐦
  • UPF-GTI
  • BCN
View GitHub Profile

Installing Cool-Retro-Term on Windows10

First of all, this document is just a recompilation of different resources that already existed on the web previously that I personally tested some ones did work and other not. I liked the idea to make a full guide from start to end so all of you could also enjoy playing with cool-retro-term on windows 10. Personally I installed it on a windows 10 pro version. Fingers crossed!

result

@h3r
h3r / noise.inc
Last active January 7, 2024 14:09
hlsl Noise generator functions
/*
Most of this code hasn't been made by me (maybe partially tweaked to fit) and just collected those snippets from many sources
across the internet. I haven't saved some of the original author names and all the credits
should go to them. I'm pretty some of you may find optimizations to them, feel free to leave a comment.
HPlass (hermann.plass@gmail.com) - 2020
Source:
https://thebookofshaders.com/11/
https://thebookofshaders.com/edit.php#11/lava-lamp.frag
@h3r
h3r / color_snippet.glsl
Last active January 20, 2022 21:50
GLSL Color operations
/*
All components are in the range [0...1], including hue.
Source: http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
*/
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
@h3r
h3r / event.h
Last active July 13, 2020 21:25
C++ Header only Event system
#pragma once
#ifndef INC_ENTITY_MSGS_
#define INC_ENTITY_MSGS_
/*
A super basic event system based on LEvent implementation from @jagenjo.
Some improvements should be done:
* swap to numerical ids instead of strings: https://github.com/mariusbancila/stduuid
* add sorting method to controll the call order on trigger
This is a little example to test it works:
@h3r
h3r / tweening.inc
Created May 23, 2020 13:14
Tweening funcs
/*
This is another set of easing functions I used for VFX, should work in HLSL, GLSL and C/C++, if not leave a comment.
Most of this code hasn't been made by me (maybe partially tweaked to fit) and just collected those snippets from many sources
across the internet. I haven't saved some of the original author names and all the credits
should go to them. I'm pretty some of you may find optimizations to them, feel free to leave a comment.
HPlass (hermann.plass@gmail.com) - 2020
*/
// ------------------------------
@h3r
h3r / matrix_snippet.glsl
Last active May 23, 2020 13:12
GLSL Matrix operations polyfill
/*
None of this code has been made by me and just collected those snippets from many sources
across the internet. I haven't saved any of the original author names and all the credits
should go to them.
HPlass (hermann.plass@gmail.com) - 2020
*/
/*
@h3r
h3r / easing.inc
Created May 23, 2020 13:06
Easing funcs
/*
This is a set of easing functions I used for VFX, should work in HLSL, GLSL and C/C++, if not leave a comment.
Most of this code hasn't been made by me (maybe partially tweaked to fit) and just collected those snippets from many sources
across the internet. I haven't saved some of the original author names and all the credits
should go to them. I'm pretty some of you may find optimizations to them, feel free to leave a comment.
HPlass (hermann.plass@gmail.com) - 2020
*/
@h3r
h3r / angular.h
Last active May 23, 2020 12:57
C/C++ Math snippets for game development
/*
Most of this code hasn't been made by me (maybe partially tweaked to fit) and just collected those snippets from many sources
across the internet. I haven't saved some of the original author names and all the credits
should go to them. I'm pretty some of you may find optimizations to them, feel free to leave a comment.
HPlass (hermann.plass@gmail.com) - 2020
*/
/*
@h3r
h3r / matcap.glsl
Created May 23, 2020 12:55
GLSL Matcap funcs
vec4 matcap(sampler2D sampler, mat4 view_matrix, vec3 normal, float scale){
vec3 vN = (view_matrix * vec4(normal, 0.)).xyz;
float2 uvs = view_N.xy * vec2(1.,-1.) * 0.48 * scale + vec2(.5, .5);
return texture2D(sampler, uvs);
}
@h3r
h3r / generators.inc
Created May 23, 2020 12:44
HLSL Sequence Generators
float2 hammersley(uint index) {
// Compute Hammersley sequence
// TODO: these should come from uniforms
// TODO: we should do this with logical bit operations
const uint numSamples = uint(IBL_INTEGRATION_IMPORTANCE_SAMPLING_COUNT);
const uint numSampleBits = uint(log2(float(numSamples)));
const float invNumSamples = 1.0 / float(numSamples);
uint i = uint(index);
uint t = i;
uint bits = 0u;