Skip to content

Instantly share code, notes, and snippets.

View Ysovuka's full-sized avatar

Joshua Thompson Ysovuka

View GitHub Profile
@KdotJPG
KdotJPG / K.jpg's Idea Dump.md
Last active October 25, 2022 04:45
K.jpg's Idea Dump

K.jpg's Idea Dump

Game dev, procedural generation, and general coding ideas I come up with and want to make sure others can consider as well. I try to cover a lot of the details / use cases that come to mind, but it would be difficult to cover them all. Not all of these ideas are fully thought through, but they might still be pretty close to usable implementation descriptions. I'll try to update this whenever I think of something to add to it. If you use one of these ideas directly, and you got it here first, credit is appreciated but certainly not required! Credit is whatever, just please stop adding to the development and creativity obstacle minefield that is the sea of software patents.

Noise Generation

Union of reciprocal lattices

  • Generate procedural noise, or perform another function on a particular lattice in N-dimensions, by constructing the lattice as a union of copies of its reciprocal lattice.
  • Look at the points that each reciprocal lattice misses on the original lattice. Keep p
@Vercidium
Vercidium / greedyvoxelmeshing
Last active September 27, 2025 00:00
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)
@jtsiomb
jtsiomb / xsection.c
Last active May 19, 2024 13:50
Example of rendering cross-sections of closed geometry with OpenGL
/* Example of rendering cross-sections of closed non-self-intersecting geometry
* with the stencil buffer. See draw_cross_section for details.
*
* Controls:
* - rotate object by dragging with the left mouse button
* - move cross-section plane back and forth by dragging up/down with the right
* mouse button
*
* Compile with: cc -o xsection xsection.c -lGL -lGLU -lglut
*
@Azure-Agst
Azure-Agst / index.md
Last active July 15, 2025 03:04
How I RE'd Proletariat Inc's Spellbreak.

How I reversed the assets from Proletariat's Spellbreak.

Proof:

screenshot_proof

(I have tons more icons in a OneDrive, just ask Vague Density. I only wanted 3 images to prove myself.)

Summary:

@enghqii
enghqii / Program.cs
Created August 29, 2016 18:15
C# Coroutine example
using System;
using System.Collections;
using System.Collections.Generic;
namespace Generator3
{
class Program
{
// classic Generator
static IEnumerable<string> Script()
@rdavisau
rdavisau / EnumerableStream.cs
Created October 26, 2015 12:18
EnumerableStream.cs
/// <summary>
/// Provides a convenience method for constructing an EnumerableStream<T>.
/// </summary>
public static class EnumerableStream
{
public static EnumerableStream<T> Create<T>(IEnumerable<T> source, Func<T, List<byte>> serializer)
{
return new EnumerableStream<T>(source, serializer);
}
}
using UnityEngine;
using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
public class LSystemGenerator : MonoBehaviour
{
[Serializable]
@jboner
jboner / latency.txt
Last active November 3, 2025 15:05
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD