Skip to content

Instantly share code, notes, and snippets.

View seb776's full-sized avatar
🚀
Experimenting

z0rg seb776

🚀
Experimenting
View GitHub Profile
@BeRo1985
BeRo1985 / octahedralmap.glsl
Last active December 3, 2023 05:01
GLSL Octahedral Texture Mapping with Edge Mirroring and Bilinear Interpolation
// GLSL Octahedral Texture Mapping with Edge Mirroring and Bilinear Interpolation (by Benjamin 'BeRo' Rosseaux)
ivec2 wrapOctahedralTexelCoordinates(const in ivec2 texel, const in ivec2 texSize) {
ivec2 wrapped = ((texel % texSize) + texSize) % texSize;
return ((((abs(texel.x / texSize.x) + int(texel.x < 0)) ^ (abs(texel.y / texSize.y) + int(texel.y < 0))) & 1) != 0) ? (texSize - (wrapped + ivec2(1))) : wrapped;
}
vec4 textureOctahedralMap(const in sampler2D tex, vec3 direction) {
direction = normalize(direction); // just for to make sure that it is normalized
vec2 uv = direction.xy / (abs(direction.x) + abs(direction.y) + abs(direction.z));
@Wumpf
Wumpf / gist:4a7bf26971e8cac434ee994a246f4a7e
Last active October 2, 2021 12:47
ffmpeg cheatsheet for pic->vid
H264, 25fps:
."C:\Users\andre\ffmpeg.exe" -i %d.png -c:v libx264 -pix_fmt yuv420p output.mp4
H264, 60fps:
."C:\Users\andre\ffmpeg.exe" -framerate 60 -i screenshot%d.png -r 60 -c:v libx264 -pix_fmt yuv420p output.mp4
H265 (windows can't play it!)
."C:\Users\andre\ffmpeg.exe" -i %d.png -c:v libx265 -pix_fmt yuv420p output.mp4
@FriendSea
FriendSea / CubeMapRenderer.cs
Last active October 18, 2023 08:58
A wizard to render a scene and create a cubemap image
using UnityEngine;
using UnityEditor;
using System.IO;
public class CubeMapRenderer : ScriptableWizard {
[SerializeField]
Shader TransformShader;
[SerializeField]
Camera RenderCamera;
[SerializeField]
@Erkaman
Erkaman / taa.frag
Last active April 25, 2023 02:32
rudimentary temporal anti-aliasing solution, that is good as a starting point for more advanced TAA techniques.
/*
The MIT License (MIT)
Copyright (c) 2018 Eric Arnebäck
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
@m3g4p0p
m3g4p0p / watch-your-back.js
Last active April 4, 2024 17:11
Capture a video stream and play it with some delay
const DELAY = 2000
const videos = []
const hide = el => el.style.display = 'none'
const show = el => el.style.display = 'block'
const showAndHideOthers = ({ target }) => {
window.requestAnimationFrame(() => {
videos.forEach(hide)
show(target)
@chunter
chunter / pageant-autoload-keys-at-startup.txt
Created June 20, 2017 10:51
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.
@humbletim
humbletim / index.html
Last active April 22, 2023 09:59
glm-js source test page
<!-- for gist purposes this BASE HREF makes everything load relative to the current live web examples -->
<!-- note: save this file in a subfolder off the the project root and remove the BASE HREF to experimental locally -->
<base href='https://humbletim.github.io/glm-js/code/test/index.html' />
<!-- glm-js core scripts -->
<script src="../src/glm.common.js" type="text/javascript"></script>
<script src="../src/glm.buffers.js" type="text/javascript"></script>
<script src="../src/glm.experimental.js" type="text/javascript"></script>
<!-- specific vendor back-end (variations exist for tdl-fast and gl-matrix as well) -->
@omgwtfgames
omgwtfgames / A set of Unity3D extension methods
Last active March 2, 2024 17:44
Some useful extension method for Unity3D
A collection of useful C# extension methods for the Unity engine.
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 3, 2024 08:26
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@usrlocalben
usrlocalben / stackblur.cpp
Created October 1, 2012 02:24
stackblur - c++, floating-point, vectorized
/*
* "stackblur"
* originally, Mario Klingemann, mario@quasimondo.com
* this implementation, Benjamin Yates (benjamin@rqdq.com)
* http://incubator.quasimondo.com/processing/stackblur.pde
*
* this blur routine seems to be quite popular.
*
* unfortunately, mario didn't comment anything.
* but, it's easy to see it's just a flavor of a two-pass