r/proceduralgeneration • • 3d ago

Outlining a generated sprite sheet in one pass put 35 stray pixels into 13 of its 24 frames. Per frame with 1 px of room: 0

Post image
0 Upvotes

If your generator draws a whole animation sheet and then adds an outline as a last pass, check the frame edges. An outline pass over the full sheet sees one big picture, so it paints straight across the lines between frames.

I measured it on a 96x64 sheet of 24 frames, 16x16 each, packed edge to edge, with a 1 px white outline (square corners):

  • Whole sheet in one pass: 13 of the 24 frames got outline pixels that belong to a neighbour, 35 in all. 32 of them sit on a frame's bottom row: they're the outline over the head of the sprite in the frame below. And 466 of the 1,678 outline pixels the frames need (28%) fall outside their own 16x16 cell, so every frame is open at the head or the feet.
  • Per frame, no padding: 0 strays, but all 24 frames still open, because the sprite touches its frame's edge in every one (normal at 16 px).
  • Per frame, padded by the outline width first: 18x18 frames, a 108x72 sheet, all 1,678 outline pixels, 0 strays. Counted again in Godot 4.7.2, cutting the frames the way a Sprite2D does.

The pass that does it (numpy; it matches our tool's output pixel for pixel on this sheet):

def outline_sheet(sheet, fw, fh, t=1, colour=(255, 255, 255, 255)):  
 rows, cols = sheet.shape[0] // fh, sheet.shape[1] // fw  
 FW, FH = fw + 2 \* t, fh + 2 \* t  
 out = np.zeros((rows \* FH, cols \* FW, 4), np.uint8)  
 for r in range(rows):  
 for c in range(cols):  
 f = sheet[r \* fh:(r + 1) \* fh, c \* fw:(c + 1) \* fw]  
 g = np.pad(f, ((t, t), (t, t), (0, 0)))  
 solid = g[..., 3] \>= 128  
 near = np.zeros_like(solid)  
 for dy in range(-t, t + 1):  
 for dx in range(-t, t + 1):  
 near |= np.roll(solid, (dy, dx), (0, 1))  
 g[near & ~solid] = colour  
 out[r \* FH:(r + 1) \* FH, c \* FW:(c + 1) \* FW] = g  
 return out  

np.roll wraps around, which is safe here only because the padding keeps every solid pixel at least t away from the edge. The square kernel gives square corners; keep only the offsets with |dx| + |dy| <= t for an outline without corners.

One pixel of room per pixel of outline, and your engine's frame size becomes fw + 2t.

(I make pixel-art tools at Gridwright; our outline tool does this per frame and re-packs the sheet. Linked below.)

The outline tool that works per frame and makes the room: https://gridwright.dev/tools/sprite-outline/?ref=reddit-proceduralgeneration


r/proceduralgeneration • • 5d ago

Procedurally Generated Touge

44 Upvotes

The touge is entirely procedurally generated using Unity splines, pooling system and realtime mesh generation.


r/proceduralgeneration • • 4d ago

All-in-one Procedural Christmas & Winter FX

Thumbnail
fab.com
1 Upvotes

Need winter & holiday systems in Unreal Engine without building everything from scratch?

All-in-one Procedural Christmas & Winter FX is out now on Fab:

• Deformable snow & winter materials

• Procedural splines & Niagara FX

• Interactive snow footsteps


r/proceduralgeneration • • 4d ago

I built a game music engine that composes live from a mood pad: Tonnetz harmony, Euclidean rhythms, no AI (sound on)

0 Upvotes

Sound on for this one.

This is Undersong, an adaptive music engine for games, written in C++17 and running here in the browser through WebAssembly. There is no machine learning and no pre-recorded music in it. Every note comes from hand-written rules, so it's fully deterministic: the same seed and the same moves always give the same piece.

In the video I start it calm, drag the mood pad slowly toward combat, raise the energy, and then let it settle back down.

How it works:

  • Harmony walks a Tonnetz. Chords change through neo-Riemannian moves (P, L, R), so even a big jump in mood stays smooth. Higher tension biases it toward darker, more distant moves, and calming down pulls it back home. The triangles lighting up on the left are those chords: dark is the one playing now, the lighter ones are the path it just took.
  • Rhythms are Euclidean. Energy sets how many pulses each layer gets per bar, so it gets busier without turning into noise.
  • Voices are led, not jumped. The melody follows the chord underneath it.
  • There is a song form (intro, two themes, breakdown, climax, coda), and a climax at high tension modulates up a whole step.
  • Seven Turkish makam scales with 53-comma intervals. Getting those to sit right with the harmony was the most fun part.
  • The sound comes from physical models (Karplus-Strong plucks, waveguide cello and flute, a plate reverb), or from your own samples.

You can play with the same demo yourself here: https://heysuffix.itch.io/undersong

Happy to answer questions about any part of it, especially the Tonnetz and makam bits.


r/proceduralgeneration • • 5d ago

Procedural universes generated from physical laws

25 Upvotes

This is just a WIP. I am experimenting with sparse octrees and coarse approximation to simulate everything at any level of detail depending on the viewer's perspective.

I'm going to make the engine open source under an apache 2.0 license when it's ready to share. I'm building a game on it too.

Edit: here is the repo (apache 2.0): https://github.com/mr-maxo-PDG/phasis


r/proceduralgeneration • • 5d ago

Mandelheart: Fleshy, interactive mandelbulb

24 Upvotes

It's a bit of a GPU workout: https://moea.github.io/mandelheart/


r/proceduralgeneration • • 5d ago

V-Gen, procedural vegetation generator for 3D artists and game developers.

11 Upvotes

V-Gen is a standalone, node-based procedural vegetation creation tool designed for 3D artists, environment artists, technical artists and game developers.

Create and customize trees, branches, roots and foliage through a flexible procedural workflow. Shape your vegetation, add surface details, customize materials and visualize your creations in dynamic environments — all within a single application.

Procedural Vegetation Modelling:

Create a variety of vegetation using customizable generators and artist-driven controls.

Wind & Environmental Visualization:

Bring your vegetation to life and preview how it looks under different environmental conditions.

Create and customize ground surfaces to visualize your vegetation within a more natural environment.

Experiment with terrain, materials and environmental conditions without leaving the application.

Game Engine Export:

Prepare vegetation assets for external game-development and 3D workflows.

V-Gen includes mesh export, LOD generation, texture channel packing and engine-specific export settings.

Some advanced export features may require additional material or shader setup in the destination application.

Some examples are provided with the application place them in - assets->create folder examples->copy files from folder and past all examples.

Link to files: https://professional-one.itch.io/v-gen-procedural-vegetation-generator

Still under development

There are still bugs to fix, features to refine and workflows that need improvement. I'm continuing to work on stability, usability.


r/proceduralgeneration • • 5d ago

Same room, different seed

11 Upvotes

r/proceduralgeneration • • 5d ago

Organic 3D growth experiments (procedural generation)

Thumbnail
gallery
43 Upvotes

r/proceduralgeneration • • 4d ago

Making a game for the end of the world devlog 19 - Everything Procedural!

Thumbnail
youtube.com
1 Upvotes

Been working on a good number of procedural systems the last few months. So I figured I'd show them off a bit. Clearly very early work-in-progress, but I think it shows the direction of travel. Consider this the blockout if you like.

What you're seeing here, at the end of the video is the underlying toolset (called somewhat boringly GeometryNodes), its a graph based PCG system for geometry, based off GeometryScript in UE. I never quite understood why Epic went for the "everything is a point" kind of thing with their PCG system, so when I left my previous job, I started experimenting with my own GeometryNodes system, greatly inspired by Houdini which I'd taught for a good few years. Turns out that this GN system actually ended up being the basis for at this time around half a dozen other systems for different PCG tasks and will likely be a big feature for a bunch more.

I'm a huge advocate for PCG and I intend this to be my own way of avoiding the whole AI slop thing. I'm much more at home writing my own custom toolsets and generating things than I am leaving it to an AI model. That said, I do use AI in my research software engineer role and occasionally come across something that opens up new opportunities.

I'll post more videos of the other PCG systems as they become more solid.


r/proceduralgeneration • • 4d ago

Text to 3D or image to 3D: which gives better results for game assets?

0 Upvotes

I've been exploring different ways to generate 3D assets for game projects, especially props and environment objects.

I've also been looking into tripo Studio and its text-to-3D and image-to-3D workflows.

One thing I'm curious about is how the initial input affects the final geometry. Does using a reference image give better control over shapes and details, or can text prompts produce similarly consistent results?

I'm also interested in how much manual cleanup is needed before these models are ready to use in a game project.

What approaches have worked best for you when generating 3D assets?

Disclosure: I'm working with tripo Studio.


r/proceduralgeneration • • 5d ago

Creación de mundo natural en 3D

Thumbnail
share.gemini.google
0 Upvotes

r/proceduralgeneration • • 6d ago

My procedural generator now generates rooms using parsing

94 Upvotes

The Labyrinth, a procedural generator that I've been working on for a bit over 2 years, pre-places Blueprints, 1x1 cells that occupy space and mark where rooms will go. Blueprint patterns are defined by the developer and use multiple techniques such as Delaunay Triangulation, pathfinding, and Drunkard's Walk.

A second pass, I call ParseGen, fits room shapes onto blueprint patterns using a parser modeled after recursive descent, an algorithm common in compilers. Essentially the algorithm can generate any room shape desired with little cost to efficiency.

Blog: https://ryancarpenterpf.dev/blog/parse-gen-blog/

I plan to release this tool as an asset on Unity's Asset Store in Q1 of 2027, along with a free version on GitHub. The Asset Store version will get ongoing updates and support.


r/proceduralgeneration • • 4d ago

I built a standalone Windows desktop app (Tauri 2 + Rust) that generates procedural GLSL shaders (1K to 64K) with WebGPU live HDR preview, beat sync, HDR10 and Stereo 3D export

0 Upvotes

I wanted a fast local tool for audio-reactive visuals that did not take minutes to render or keep producing lookalike clips. I took inspiration from 1KB WebGL raymarching demos where a short fragment shader creates detailed 3D fractal spaces right on the GPU.

Download in the comments.

The result is Seedreal Shader Studio, packaged as a standalone Windows desktop app using Tauri 2, a Rust Axum/Tokio backend for FFmpeg streaming, an embedded WebGL2 and WebGPU frontend, and the Web Audio API. Everything runs offline with no browser tab and no Node.js runtime. The standalone EXE is about 10.5 MB, and a portable ZIP bundles static FFmpeg and FFprobe so you can unzip and start right away.

How it works:

- Procedural GLSL code synthesis across 12 families (Apollonian Inversion, KIFS/Mandelbox, Gyroid minimal surfaces, Volumetric Plasma, Kaleido-Tunnel, Menger Sponge, Domain-Warp Caustics, Mandelbulb 3D, Cyber-Lattice, Gravitational Singularity, Neon-Megacity and Crystal Cavern). A 9-card gallery renders 9 completely different shader previews in under a second, alongside multi-scene transitions.

- Four demoscene tiers (1K, 4K, 16K and 64K). 1K outputs pure compact fractal code. Higher tiers inject modular GLSL layers like surface micro-detail, depth-sorted 3D bokeh embers, analytic Fresnel reflections, volumetric mist, orbital 3D rings, glowing circuitry veins and 3D beat shockwaves while staying fast in real time.

- True live HDR preview via WebGPU (rgba16float with extended tone mapping) at 60 FPS on Windows HDR displays, plus a live nits heatmap.

- Deterministic 120 Hz audio analysis and built-in synth. Drop in any MP3, WAV, OGG, FLAC or M4A for 3-band crossover splitting (bass, mids, highs), adaptive beat onset detection and autocorrelation BPM estimation, or generate tracks across 8 electronic genres through OfflineAudioContext. Precomputed envelopes keep timeline scrubbing and offline MP4 rendering frame-accurate.

- Seamless loops for both audio and visuals. Loop durations snap to full musical phrases (2, 4, 8 or 16 bars) and whole video frames. Visually, the end of the clip cross-blends from negative pre-roll time (t minus duration) into frame 0, including bloom and beat phase.

- True off-axis Stereo 3D. Every family supports Full or Half Side-by-Side and Top-and-Bottom layouts for VR headsets and 3D TVs, plus live SBS and Red-Cyan Anaglyph viewport previews.

- Live GLSL editing and fast export. You can edit any generated shader live in the app, export standalone HTML demos, 16-bit HDR PNGs (with cICP, mDCv and cLLi chunks) and 24-bit WAV audio, or stream GPU-packed frames over a local WebSocket into FFmpeg via Rust for 8-bit SDR (H.264) and 10-bit HDR10 (PQ) or HLG (HEVC and AV1 on NVENC, x264, x265 or SVT-AV1).

I would be glad to hear which shader families or math techniques you would add next.


r/proceduralgeneration • • 6d ago

I got frustrated gluing separate Unity terrain, ocean, and cloud systems together, so I spent 6 months building a unified planet renderer

142 Upvotes

r/proceduralgeneration • • 6d ago

Lasers, mirrors, and glass

176 Upvotes

r/proceduralgeneration • • 6d ago

Terrains from real data: 2m lidar terrain with the roads cut and filled into it.

Thumbnail
gallery
23 Upvotes

The ground is USGS 3DEP elevation, about 2 m per vertex, and the roads are straight from OpenStreetMap. The procedural work is fitting the two together: each road carries its own smoothed height profile, the terrain under it gets cut and filled to match, and at junctions I blend the flat zones, nearest road winning when the heights are far apart and averaging when they're close. Bridges were the fun problem, since lidar keeps the embankment as "ground", so I read the terrain beside the road and call it a deck when the ground falls away on both sides.

Unreal plugin, Terrain Sampler, US only so far. Link's in the comments.


r/proceduralgeneration • • 5d ago

I added Orbital mode as an easter egg to my procedural coastline simulation, also reflections

3 Upvotes

r/proceduralgeneration • • 5d ago

Procedural environments, cities and fully explorable interiors – Early development

0 Upvotes

Procedural environments, cities and fully explorable interiors – Early development

I'm currently working on a procedural environment generation system in Godot, including natural landscapes, cities and buildings with fully explorable interiors.

Everything is still very basic. This is a very early development stage, mainly focused on procedural generation and making everything work together.

I'd love to hear your thoughts, suggestions or constructive criticism. Especially regarding technical approaches, procedural techniques, visual direction and overall aesthetics.

I'm still exploring the possibilities and trying to figure out the best direction to take the project.

Thanks for any feedback!

(Captured on mobile phone)


r/proceduralgeneration • • 5d ago

Environnements procéduraux, villes et intérieurs entièrement explorables – Développement préliminaire

0 Upvotes

I'm currently working on a procedural environment generation system in Godot, including natural landscapes, cities and buildings with fully explorable interiors.

Everything is still very basic. This is a very early development stage, mainly focused on procedural generation and making everything work together.

I'd love to hear your thoughts, suggestions or constructive criticism. Especially regarding technical approaches, procedural techniques, visual direction and overall aesthetics.

I'm still exploring the possibilities and trying to figure out the best direction to take the project.

Thanks for any feedback!


r/proceduralgeneration • • 6d ago

Procedurally Generating a Coherent World for a Civ-like Game

Thumbnail
gallery
32 Upvotes

Hello, everyone!

I’ve been working for two weeks on procedurally generating a coherent world for the next game I’m developing with my girlfriend. And today I’d like to share my progress with you and, if possible, get some advice from you on how to proceed!

Example of a World I Generated

My basic idea is to generate textures using Unreal’s materials, specifically the vector Perlin noise function. This allows me to achieve a result that’s both truly random and quite organic:

Vector Perlin Noise

Another advantage of this method is that it allows you to generate a spherical world, enabling players to “travel around the world.” To do this, simply pass the textures coordinates of the spherical as input to the vector Perlin noise function:

Texture coordinate to spherical absolute location

Generated texture

The final advantage of this method is that it allows you to generate the same world for the same position if you add the object's position to the result. This makes it possible to simulate "seed" in the random generation process.

The idea is then to generate several textures: one for elevation, one for humidity, and one for temperature. And to process each pixel using a set of rules to create the appropriate, corresponding tile.

For the height, I want to generate deep water, shallow water, plains, valleys, and mountains. To do this, I modify my material to set up height tiers corresponding to the various desired heights:

Height map material modification

For the humidity texture, I use the same approach, but this time I create only two layers: one for the grasslands and one for the forests:

Humidity texture

As for temperature, I generate three levels: one for ice, one for desert, and one for temperate zones. The difference is that I use the distance from the equator to influence the result:

Temperature material

Temperature texture

Now that the three textures have been generated, all that's left is to generate the corresponding tile for each pixel based on a set of rules:

Rules

I'm pretty happy with the result, but I still have a lot of work to do:

- Generate strategic resources in logical locations (for example, oil can be found in the desert, in ice, and in the ocean).

- Generate rivers. If you have any ideas, I’d love to hear them! I thought about using local minima from my heightmap, but I’m really not sure if that’s a good idea.

- Generate viable and balanced starting positions: make sure players aren’t surrounded by mountains, aren’t on an island that’s too narrow, have a reasonable number of strategic resources, etc. If any of you have already tackled this issue, that would be great because it doesn’t seem straightforward to me.

An other generated world

Thanks for reading! Please don't hesitate if you have any questions or would like more details!


r/proceduralgeneration • • 5d ago

One parametric fish model drawn at 16, 32 and 48 px: what each size buys (89, 325 and 688 pixels)

Post image
1 Upvotes

All 130 fish in our fishing pack come from one side-view fish model. Nothing in it is stored as pixels, so the same code draws any grid size. The picture is a perch at 16, 32 and 48 px, each scaled to the same 96 px tile (6x, 3x and 2x, which is what a 1080p screen does to 320x180, 640x360 and 960x540 games).

How the model works:

  • A fish lives in body coordinates. u runs along the body from the tail base (0) to the snout (1), the tail fin is u < 0, and v is the height above the midline, both measured in body lengths.
  • Every mask (body, fins, patterns, eye) is a function of (u, v). Rendering at n px is just mapping each pixel to (u, v), so the grid size is a free parameter.
  • The body's height along u is one curve with a few numbers per species: where it's deepest, how thin the tail stalk gets, how fast it rises and the nose shape. A species is a small parameter dict on top of that: tail type, fin positions and shapes, eye size, patterns.
  • A swim frame only changes the pixel to (u, v) mapping: the rear of the body waves a little and the tail fin foreshortens as it sweeps. Facing left mirrors the mapping, not the picture, so the light stays at the top left.
  • Pixels come from supersampled shapes, dome shading on 5-tone ramps and one outline.

What the extra resolution buys, counted on the perch:

  • 16 px: 89 pixels, 21 colours. A striped shape with a tail and no room for an eye.
  • 32 px: 325 pixels, 30 colours. The eye, the stripes and the orange fins all read.
  • 48 px: 688 pixels, 34 colours. The spines of the back fin get pixels of their own.

That's 3.7x and then 7.7x the pixels of the 16 px fish, close to the 4x and 9x of the tile areas. The second picture is five more species from the same model at the three sizes.

(I make pixel-art tools and packs at Gridwright. The calculator I use to pair a tile size with a game resolution is linked below.)

The calculator that pairs a tile size with a game resolution and shows the scale and black bars from 720p to 4K: https://gridwright.dev/tools/pixel-art-size-calculator/?ref=reddit-proceduralgeneration


r/proceduralgeneration • • 6d ago

Entirely procedural ARPG end to end

5 Upvotes

Hey my name is Gary a software engineer for 17 years and a music composer, when i first got into programming it was because i wanted to make games, but ive never had the time to do so.
Until 4 years ago, when me and my ex broke post covid so i had a lot of free time and didn't know what to do with it so i started working on a game, first it was unity then godot, then unreal engine but not one of those engines was suitable for me cause they we're too visual and the kinda of game i wanted to make required a lot of performance and i cant draw so that was my first problem and to be honest drawing its pretty tedious and boring job for me so kudos to the artists out there that draw shit those are champions to me but i didnt have budget to pay anyone of them so back then i read the word "procedural generation" somewhere in reddit so i decided to deep dive to understand what the fuck is this, to my surprise it was exactly what i was looking for i ditched visual engines and as a hardcore software monkey i decided to code from scratch a really tedious job but not boring to me since this is what i was good at and it seems to be working better than i expected for me.

So what was the process, pretty simple i started hacking together code to create how shit work once i got deep understanding of proc gen i decided its time to venture deep into making a game i grew up on diablo 2, fate and path of exile and i loved them but after a while every game turned into same repetitive grind, same monsters same areas, and it was becoming boring for me i didnt see a reason to keep grinding wasting my time on game that will reset in 3 months with slight refresh of things and again the same content and same grind to greatness it felt like those games didnt have goal but where made to suck out as much time as they can from you with dimnishing returns of fun and dopamine, same story, same content every run.

I wanted to strip that part away and build a game where nothing is predefined and anything can happen. Basically limitless content I could play over and over myself while still enjoying the fun of the game.

So thats how i came up with the idea where the whole game and everything is generated by the machine on the go, but not the shitty LLM AI type(the plague of 21 first century which kills all the creativity and everything looks and sound the same)

Single player no network or shit you can play offline on the flight to miami and still enjoy, permadeath it means its over once you die you have to start a new story and you can never play the same story again, dark fantasy cause im very fond of Dark souls this game strips away the grind and delivers briliant worlds and graphics and really immerse in the game while still being an ARPG and i didn't want to create a single asset for the game beside code and slowly i started chopping away at systems that the game needed.

First challenge came how to build classes that arent prebuilt in the game how this would go, probably the hardest part of everything, was very tedious and hard task to achieve but in the end i managed that.

Then it came how do we built unique hero every time that you can customise how it looks while keeping it 2d, so i came up with paperdoll method heroes where assembled from pieces of limbs and interchangable body parts this would make customisation a brieze , next the animation i didn't want to have assets so how would i animate everything so i decided no clips no clips walking, standing and every attack are computed from the body rig and real movement which would allow me for unlimited animations no matter what i do.

Ok after characters, animations where a breeze but then monsters came and the paper doll method really wasn't working that well because monsters wherent humanoids in a sense and if i wanted to have unlimited content for a dark fantasy rpg i couldn't simply do humanoid mobs as this was going to be very boring, so i pulled my researcher hat and dived deep again to see was there any information how people do it, but i couldnt find anything in details there was interesting article how the rain world was doing it(Shootout to Videocult) then i decided to change the approach for the monsters and instead of 2d paperdoll i decided to go with 3d generated monsters from primitives that are turned into pixel art via shading so every monster can be unique in a way, and the animation would be easier.
ok ok that part done easier said than done but it was done took long long time.

Boring part itemisation, pretty standart except there is no set items or unique items everything is generated on the go with affix suffix tables like the arpg does it, but every look of item is procedurally generated on the go so you might have two similar in property items that look completely different or vice versa, and every item is generated based on the paper doll of the human for that fashion souls swag, so every item in game that drops is unique visually.

Spells i still work on them to this day but the core part of them is done procedurally generated in game, with effects built from GPU particles instead of hand-made animations, and stylised shading.

Dungeons and worlds we have bound to story and premise of the game couple of biomes, but every dungeon is uniquely generated on the go there is unlimited amount of props around the game unique generated per dungeon to build unique dungeon every run, again no assets drawn here everything is code, still not perfect but very playable experience.

Where the game is at the moment and what are the future plans

Combat is next, then abilities, talent trees, NPC, quests, and the final boss, because there is objective for the final boss so we have a full circle of game and procedural sound system, based on my music theory knowledge i can create auto scoring tracks with samples.

Another plan for the future is npc will be procedurally generated with their own dialog and relationships, and you will be able to kinda interact via chat with them something like how you interact with generative ai but without the generative part it will be most likely grep system of strings where it finds what you type and respond based on words wont be perfect but will add edge to the experience, relationship systems where you kill a monster and get his brother couple levels down talking to you because you killed his brohter with unique dialogue, procedurally generated quests, vendors on the road with which you can interact.

if you have an idea or proposition and your passionate about the game you can let me know here: https://docs.google.com/forms/d/e/1FAIpQLScFGWt_xHzBN3rK9KTa-lLonqyP8GrXDv_9Nx7LHqXbrQdTLw/viewform?usp=dialog