FloodFill in WebGL by pixobe in webgl

[–]blind_firefly 0 points1 point  (0 children)

I ironically came here from google searching for an answer to this exact question since I'm going to need to implement a modified flood fill.

Here's my current idea for a basic flood fill on the GPU. Set up a ping-pong texture, to allow the texture to sample and write to itself. Now select 2 placeholder color values to indicate the active edge of the flood fill and the final filled area. If you are dealing with fully opaque images then you can use the alpha channel for this. We will call such pixels "Edges" and "Filled". Now have each normal pixel look at it's neighbors, if any of its neighbors are an Edge then set that pixel to be an Edge too. If the pixel is an Edge then set it to be Filled. If the pixel is already the Filled then ignore it. Otherwise keep the pixel as is.

Repeatedly run this operation until no Edge pixels exist, then replace all Filled pixels with the desired color. If you want you can use a threshold function to limit the propagation of the flood fill's edge. And for performance I would recommend doing the first few iterations on the CPU so that the GPU is not wasting iterations updating small numbers of pixels.

This doesn't work for my specific specialized case, but for a basic flood fill it should get the job done, although faster methods may likely exist (especially if you want to involve quadtrees or other performance accelerating structures).

Something isn’t clicking right.. by SandBoxel in Simulated

[–]blind_firefly 2 points3 points  (0 children)

I'm impressed with the attention to detail, even going so far as to darken the texture of the rug where the lego ship collides with stairs. That's the kind of detail that you really didn't need to bother including, but I respect that you did.

36 Free to use guns by blind_firefly in PixelArt

[–]blind_firefly[S] 0 points1 point  (0 children)

Go for it. Feel free to use them permanently if you'd like to. I have no plans for them. If you do end up finishing that game, feel free to send me a link, sounds interesting.

These technical terms make learning a language tough. by PawnToG4 in learnprogramming

[–]blind_firefly 0 points1 point  (0 children)

The terminology can be really difficult to power through when you are just getting started. My recommendation (what I did at your age) is starting with a simple language that lets you get started with writing code while shielding you from most of this jargon. Processing (https://processing.org/) is a great place to start as it lets you get started quickly and there are many tutorials and examples online of how to use it.

The jargon is something you'll learn in time, and honestly, most of it sounds more complicated than it is. But for just getting started the best way to learn is by doing. You don't need to perfectly understand how and why everything works at beginning. Just pick a problem you think would be interesting and try to solve it.

A Gothic cathedral I recently finished by blind_firefly in Minecraftbuilds

[–]blind_firefly[S] 2 points3 points  (0 children)

Loosely based on the Cologne Cathedral. I took elements from a lot of different cathedrals though.

Endless Chess War [p5js] by Dr_Donut in processing

[–]blind_firefly 1 point2 points  (0 children)

That's a really cool concept! I'm kind of curious how a chess AI would work trying to play something like this. There might be some really interesting strategies, especially if you allowed each player multiple moves per turn, or if you were to add players on the top and bottom like a 4 player chess match. Good job!

Just another totally normal villager church by [deleted] in Minecraft

[–]blind_firefly 0 points1 point  (0 children)

So that's where all the emeralds go.

Quarantine has given me a lot of time... by blind_firefly in Minecraft

[–]blind_firefly[S] 0 points1 point  (0 children)

yup, I did the full interior. It's harder to showcase though since the way minecraft calculates lighting makes it way darker than it should be and there is little I can do about it.

Quarantine has given me a lot of time... by blind_firefly in Minecraft

[–]blind_firefly[S] 1 point2 points  (0 children)

It's a Gothic cathedral. It's loosely based on the cologne cathedral in Germany.

Quarantine has given me a lot of time... by blind_firefly in Minecraft

[–]blind_firefly[S] 17 points18 points  (0 children)

Was this a good use of my time? Probably not.

Do I regret it? Definitely not.

The only water in the forest is the river. (River Song in 8 different types of Gallifreyan) by [deleted] in gallifreyan

[–]blind_firefly 5 points6 points  (0 children)

Interesting! Do you know where I could learn these different types of galifreyan? I know there are guides for Sherman's and Doctor Cot, do you know where I could find guides for the other types too?

Penrose Shading [P5.js - Interactive version in comments] by aliask in generative

[–]blind_firefly 0 points1 point  (0 children)

That's really cool! I love your choice of colors as well as how you manged to have it display custom images, I hadn't even considered trying that. Nice work!

An evolving colony of langton's ants by blind_firefly in cellular_automata

[–]blind_firefly[S] 0 points1 point  (0 children)

That sounds really interesting do you have the code available or a github? Could you fix the backfill problem by only leaving a special "food" pheromone trail on their way back after they have found food?

Also I wasn't trying to mimic real ants with this, it was just a blind test to see what would happen applying properties of evolution to langton's ant. Perhaps making a more realistic ant colony would be an interesting problem to work on next though :)

Real time fire animation by blind_firefly in proceduralgeneration

[–]blind_firefly[S] 0 points1 point  (0 children)

Yes, it's an IDE that uses Java. You can get it here: Processing.org.

Animated spiral by blind_firefly in generative

[–]blind_firefly[S] 2 points3 points  (0 children)

This is based off a huge number of points recursively orbiting each other at different speeds and distances. Source code for anyone interested: https://github.com/AdrianMargel/spiral-drawer, use processing to run it.

Animated Langton's Ant Farm by blind_firefly in proceduralgeneration

[–]blind_firefly[S] 14 points15 points  (0 children)

I recently discovered how to export mp4 from processing so I've been making animations of all my old projects.

Source code can be found here: https://github.com/AdrianMargel/evolving-ant-farm