Skip to content

Instantly share code, notes, and snippets.

View thennequin's full-sized avatar

Thibault Hennequin thennequin

  • Kylotonn
  • Paris, France
View GitHub Profile
@jakubtomsu
jakubtomsu / octviz.odin
Last active November 20, 2023 11:11
Odin program for visualizing spherical/hemispherical octahedral mapping with Raylib
// Octahedral mapping visualization in Odin and Raylib
// by Jakub Tomšů (@jakubtomsu_)
//
// Build and run with 'odin run octsphere.odin -file'.
// No additional dependencies required.
//
// Sources:
// https://gpuopen.com/learn/fetching-from-cubes-and-octahedrons/
// https://knarkowicz.wordpress.com/2014/04/16/octahedron-normal-vector-encoding/
@bblanchon
bblanchon / Open with Sublime Merge.reg
Last active September 1, 2023 13:53
Add "Open with Sublime Merge" to Windows Explorer context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\smerge]
; %PROGRAMFILES%\Sublime Merge\sublime_merge.exe
"Icon"=hex(2):25,00,50,00,52,00,4f,00,47,00,52,00,41,00,4d,00,46,00,49,00,4c,\
00,45,00,53,00,25,00,5c,00,53,00,75,00,62,00,6c,00,69,00,6d,00,65,00,20,00,\
4d,00,65,00,72,00,67,00,65,00,5c,00,73,00,75,00,62,00,6c,00,69,00,6d,00,65,\
00,5f,00,6d,00,65,00,72,00,67,00,65,00,2e,00,65,00,78,00,65,00,00,00
@="Open with Sublime Merge"
@crypticsea
crypticsea / opus.c
Created February 23, 2021 06:30
opus build
// cl /I celt /I silk /I silk/float /I include /c opus.c
// lib opus.obj
#define OPUS_CPU_X64
#define USE_ALLOCA
#define OPUS_BUILD
#include "celt/bands.c"
#include "celt/celt.c"
#include "celt/celt_encoder.c"
@soufianekhiat
soufianekhiat / DearImGui.cpp
Last active April 16, 2024 19:03
Slider 2D & Slider 3D
bool InputVec2(char const* pLabel, ImVec2* pValue, ImVec2 const vMinValue, ImVec2 const vMaxValue, float const fScale /*= 1.0f*/)
{
return SliderScalar2D(pLabel, &pValue->x, &pValue->y, vMinValue.x, vMaxValue.x, vMinValue.y, vMaxValue.y, fScale);
}
bool InputVec3(char const* pLabel, ImVec4* pValue, ImVec4 const vMinValue, ImVec4 const vMaxValue, float const fScale /*= 1.0f*/)
{
return SliderScalar3D(pLabel, &pValue->x, &pValue->y, &pValue->z, vMinValue.x, vMaxValue.x, vMinValue.y, vMaxValue.y, vMinValue.z, vMaxValue.z, fScale);
}
@simonbroggi
simonbroggi / AmbientOcclusionDirection.osl
Created November 22, 2019 11:01
Calculates AO and the average direction where the ambient light came from.
/*
* Ambient Occlusion and Direction.
*
* Calculates AO and the average direction where the ambient light came from.
*
* Original AO code from https://github.com/sambler/osl-shaders/blob/master/ramps/BaAmbientOcclusion/BaAmbientOcclusion.osl
*
*/
void rng_seed(output int rng, int seed)
@galloscript
galloscript / FObjectPool.h
Last active January 26, 2019 10:48
C++ Raw Pool and Object Pool Implementation in my Sandbox Library
/*
* @file FObjectPool.h
* @author David Gallardo Moreno
*/
#ifndef __SBX_OBJECT_POOL_H__
#define __SBX_OBJECT_POOL_H__
#include <Library/FRawPool.h>
@d7samurai
d7samurai / .readme.md
Last active June 9, 2024 15:15
Minimal D3D11

Minimal D3D11

Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube

hollowcube

Also check out Minimal D3D11 pt2, reconfigured for instanced rendering and with a smaller, tighter, simplified overall code structure, or Minimal D3D11 pt3, with shadowmapping + showcasing a range of alternative setup and rendering techniques.

@ChemistAion
ChemistAion / Nodes.cpp
Created January 25, 2018 15:02
Prototype of standalone node graph editor for ImGui
// Prototype of standalone node graph editor for ImGui
// Thread: https://github.com/ocornut/imgui/issues/306
//
// This is based on code by:
// @emoon https://gist.github.com/emoon/b8ff4b4ce4f1b43e79f2
// @ocornut https://gist.github.com/ocornut/7e9b3ec566a333d725d4
// @flix01 https://github.com/Flix01/imgui/blob/b248df2df98af13d4b7dbb70c92430afc47a038a/addons/imguinodegrapheditor/imguinodegrapheditor.cpp#L432
#include "Nodes.h"
@joethephish
joethephish / Exp_for_zooming.md
Last active March 12, 2018 01:36
Using Mathf.Exp for zooming

Using Exp for zooming

One of the things I’m happiest to have learned in the past few months is a great use for Log + Exp in games when zooming in and out.

You may have already know that linear speeds work horribly for zooming, e.g.:

void Update() {
    scale = scale + speed * Time.deltaTime;
}