Skip to content

Instantly share code, notes, and snippets.

@aras-p
aras-p / ComputeOcclusionFromDepth.shader
Last active April 15, 2022 17:50
Unity command buffer that modifies screenspace shadow mask
Shader "Hidden/ComputeOcclusion"
{
Properties
{
_MainTex ("", 2D) = "white" {}
}
SubShader
{
Pass
{
@bkaradzic
bkaradzic / orthodoxc++.md
Last active May 28, 2024 13:41
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

// A C++11 constexpr implementation of xxhash32
// Jonathan Adamczewski / https://twitter.com/twoscomplement
// A reimplementation of code from https://github.com/Cyan4973/xxHash
// Foundation functions / commonly used patterns
// Read four chars and construct uint32_t (little endian)
constexpr uint32_t xxh_read32(const char* input)
{
@andyneff
andyneff / Hybrid_files.md
Last active May 16, 2024 15:45
Hybrid script files

Hybrid files

  • A short compilations of hybrid files I've used/modifies whats out there for my use.

What do I mean by hybrid files? A file that can be parsed by two or more scripting lanauges and run (without or minimal error messages)

Batch and python

I copied this from here There are many different versions out there, of varying degrees of difficulty out there. However this is my favorite

@carloscarcamo
carloscarcamo / hello.s
Created September 10, 2015 20:12
Hello world in GNU Assembler (GAS)
# -------------------------------------------------------------
#
# Using Linux System calls for 64-bit
# to run:
# gcc -c hello.s && ld hello.o && ./a.out
# o
# gcc -nostdlib hello.s && ./a.out
#
# --------------------------------------------------------------
anonymous
anonymous / mapgen.js.coffee
Created February 15, 2015 19:32
Core algorithm for procedural city generation article (http://www.tmwhere.com)
# author: tmwhere.com
# --- third party dependencies
PIXI = require('pixi.dev')
_ = require('lodash')
noise = require('perlin').noise
Quadtree = require('quadtree').Quadtree
seedrandom = require('seedrandom')
# ---
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 28, 2024 19:15
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);
@Cyan4973
Cyan4973 / gist:5b835641c134b8d6e7c3
Created June 19, 2014 21:55
Takayuki's Streaming example 2 (simplified)
// LZ4 streaming API example 2 (ring buffer)
#define _CRT_SECURE_NO_WARNINGS // for MSVC
#include "lz4.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@XVilka
XVilka / TrueColour.md
Last active May 28, 2024 17:42
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!