Skip to content

Instantly share code, notes, and snippets.

View abidanBrito's full-sized avatar

Abidán Brito abidanBrito

  • UPV
  • Canary Islands
View GitHub Profile
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 9, 2024 08:26
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@mmozeiko
mmozeiko / win32_webgpu.c
Last active February 19, 2024 20:20
setting up and using WebGPU in C using Dawn
// example how to set up WebGPU rendering on Windows in C
// uses Dawn implementation of WebGPU: https://dawn.googlesource.com/dawn/
// download pre-built Dawn webgpu.h/dll/lib files from https://github.com/mmozeiko/build-dawn/releases/latest
#include "webgpu.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define _USE_MATH_DEFINES
@mmozeiko
mmozeiko / upng.h
Last active February 25, 2024 08:08
uncompressed png writer & reader
#pragma once
// uncompressed png writer & reader
// supports only 8-bit and 16-bit formats
// Performance comparison for 8192x8192 BGRA8 image (256MB)
// Compiled with "clang -O2", AVX2 requires extra "-mavx2" or "/arch:AVX2" argument
//
// For libpng (compressed) uses default libpng/zlib compression settings
// For libpng (uncompressed) case following two functions are used:
@mmozeiko
mmozeiko / !README.md
Last active May 5, 2024 00:02
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone 64-bit MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for 64-bit native desktop app development.

Run python.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.32.17.2 and v10.0.22621.0.

You can list available versions with python.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe from output folder, first run setup.bat - after that PATH/INCLUDE/LIB env variables will be setup to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@jdah
jdah / .vimrc
Created June 14, 2021 11:54
jdh's NeoVim .vimrc
call plug#begin()
Plug 'drewtempelmeyer/palenight.vim'
Plug 'vim-airline/vim-airline'
Plug 'wlangstroth/vim-racket'
Plug 'sheerun/vim-polyglot'
Plug 'rust-lang/rust.vim'
Plug 'preservim/tagbar'
Plug 'universal-ctags/ctags'
Plug 'luochen1990/rainbow'
Plug 'vim-syntastic/syntastic'
@ld100
ld100 / ArchLinuxWSL2.md
Last active April 27, 2024 18:05
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 7, 2024 19:39
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@malustewart
malustewart / imgui_consultas_2020_1C.md
Last active September 2, 2023 19:53
Consultas de ImGui para EDA 1er cuatrimestre 2020

ImGui consultas 2020 1C

> ¿Cómo cambio el tamaño de las fonts?

En DemoWindow > Configuration > Fonts :

  • Para cambiar el tamaño de la font de una sola ventana, existe ImGui::SetWindowFontScale(window_scale), donde window_scale es un float que va desde 0.0 (tamaño casi invisible) a 2.0 (tamaño doble que el normal).
  • Para cambiar el tamaño de una font en todas las ventanas, alcanza con modificar io.FontGlobalScale. io es el contexto de ImGui que se obtiene en la inicialización. FontGlobalScale es un float que va desde 0.0 (tamaño casi invisible) a 2.0 (tamaño doble que el normal).

Ver líneas 3324 a 3327 de imgui_demo.cpp

> ¿Cómo fijo la posición de las ventanas?

This note simply gathers some info and thoughts on building Node Editor, especially in an
immediate mode setting.
Q: How does imgui render rounded rects?
Check imgui AddRectFilled
Imgui drawing api is closer to nanoVG
- Path is kept
- Contents are modified based on path
@Wumpf
Wumpf / cfd.md
Last active April 10, 2024 22:39
Notes on CFD