Skip to content

Instantly share code, notes, and snippets.

@endrift
endrift / golfed.py
Created October 15, 2016 01:22
mGBA Python bindings example
from mgba import core,image
c=core.loadPath('ruby.gba')
i=image.Image(*c.desiredVideoDimensions())
c.setVideoBuffer(i)
c.reset()
for x in range(800): c.runFrame()
with open("out.png", "w") as f: i.savePNG(f)
@Vercidium
Vercidium / greedyvoxelmeshing
Last active June 10, 2024 12:21
Greedy Voxel Meshing ported to C#
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
// Note this implementation does not support different block types or block normals
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/
const int CHUNK_SIZE = 32;
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0)
@Wenzy--
Wenzy-- / gist:8520443b107d60ca19b6cfb3e7e2529f
Created February 3, 2020 12:05 — forked from DuncanF/gist:353509dd397ea5f292fa52d1b9b5133d
Unity lockless (no GPU readback) marching cubes via Graphics.DrawProceduralIndirect - some slight faffing because compute shader must append full triangle (3 verts) at a time to render correctly, but this means the appendbuffer count is 3 times smaller than it needs to be, so we have to invoke a very short compute shader (FixupIndirectArgs) just…
MarchingCubesGPU.cs:
...
// DrawProceduralIndirect
ComputeBuffer argsBuffer;
[StructLayout(LayoutKind.Sequential)]
struct DrawCallArgBuffer
{
public const int size =
sizeof(int) +
sizeof(int) +
@valiant-code
valiant-code / IronMon-Rules.md
Last active July 5, 2024 20:32
IronMon Rules

The IronMON Challenge

The IronMon challenge is a Pokémon Randomizer Challenge run created by Iateyourpie. Designed to make experiencing the randomizer fun and challenging, while taking away the wild Pokémon grind that come with some other challenges. It was originally made for Fire Red / Leaf Green but the rules can be applied/adjusted for other games as well. If you're interested to find out more about IronMon, join our Discord community!

IronMon has varying levels of difficulties, to keep it more approachable but also provide the toughest challenge possible for those who want it.

using System.Collections.Generic;
using UnityEngine;
namespace Code
{
/// <summary>
/// The simplest example to show how to use Graphics.DrawProceduralIndirect
///
/// What it does:
///