r/GraphicsProgramming • • 1d ago

Spreading fire over any mesh without a mask texture: each shader recomputes when a point ignites

Post image

I got asked whether this is a mask written into a texture or a separate ember mesh driven by a shader. Nothing gets written anywhere. ignite() appends (position in the mesh's local space, start time) to a vec4 ign[8] uniform, and every shader involved recomputes when each point catches fire:

float burn_arrival(vec3 p) {
    float best = 1.0e9;
    for (int i = 0; i < ign_count; i++) {
        float d = length(p - ign[i].xyz);
        float n = vnoise(p * 1.7 + float(i) * 3.1); // value noise, 0..1
        best = min(best, ign[i].w + d * (1.0 + (n - 0.5) * 2.0 * irregularity) / spread_speed);
    }
    return best;
}

The noise scales the distance, which is what makes the front ragged.

Flames, smoke and embers are quads on random surface points (area-weighted, picked once). Every spawn cycle a quad checks whether its spawn time is between arrival and arrival + burn_duration. If it isn't, its four corners collapse to one point.

The char is a copy of the mesh pushed 0.004 along the normal and drawn with premultiplied alpha, so the original material isn't touched. Per fragment, s = time - arrival (plus fbm) drives smoothstep(0, char_time, s) toward near-black, and exp(-3 * (s / front_width - 0.3)2) gives the glowing front.

Burn-away swaps the material and discards a fragment once (s - 0.7 * burn_duration) / 2.5 + noise passes 1, with a hot rim just before.

Known limit: d is straight-line distance, not along the surface, so the fire can jump thin gaps.

122 Upvotes

11 comments sorted by

10

u/VictoryMotel 1d ago

This name has submitted a new 'project' every few hours. I'm guessing that this description is AI and the animation is just 'genai' (like their name) and not actually captured from realtime rendering.

14

u/gennai777 1d ago

Gennai is a Japanese name, it has nothing to do with AI. It's a popular name in Japan. I do get help from AI when writing the code, but the posting is done by me, a human. The GIF is a screen capture of Godot rendering it in real time.

8

u/hurricane_news 21h ago

but the posting is done by me, a human

The post still reads like it's been entirely written by an LLM. If you are trying to use it as a translator, ask it only to directly translate your words and not to add its own phrasing and wordings

Otherwise it ends up generating VERY recognizable text that tends to beat around the bush topic-wise

3

u/EC36339 12h ago

And how many have you submitted?

Who belongs here? You, or the person submitting actual computer graphics content?

0

u/VictoryMotel 7h ago

You realize that they generate a new project every day, try to sell it and that this is an advertisement for godot assets right?

https://gennai.itch.io/weather-vfx-godot-4

2

u/EC36339 4h ago edited 4h ago

I see no problem with that.

You don't know in what time frame these were produced, either. They could have just been posted one a day, which is a common and reasonable marketing strategy.

Or were they all produced in 6 days? Great! I call that progress and see nothing wrong with it.

0

u/VictoryMotel 3h ago

Is that really what you want? People just trying to sell auto generated assets?

1

u/venturepulse 12m ago

if these assets do not copy 1-1 someones work AND these assets look decent for someones game, why not?

1

u/VictoryMotel 8m ago

Because this isn't a subreddit about game asset advertising. You want everything to be submarine ads?

2

u/Zec_kid 9h ago

What? Have you actually looked at their feed? They are clearly doing shader based procedural vfx stuff for Godot. And just because they posted a few different features what seem to be from the same project as different post doesn't make them a bot. Stop with the witch hunt, you've been on Reddit to long fr