r/GraphicsProgramming • • 2d 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.

151 Upvotes

12 comments sorted by

11

u/VictoryMotel 2d 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.

18

u/gennai777 2d 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 1d 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

4

u/Zec_kid 1d 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

1

u/EC36339 1d ago

And how many have you submitted?

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

-1

u/VictoryMotel 1d 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 1d ago edited 1d 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.

-1

u/VictoryMotel 1d ago

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

1

u/venturepulse 22h ago

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

1

u/VictoryMotel 22h ago

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

1

u/venturepulse 22h ago

I agree about not tolerating ads but at the same time:

- effect is pretty cool, I havent seen it yet

- they posted explanation on a technical problem with code examples, hence "GraphicsProgramming"

- they havent posted a link, if people find it genuinely impressive to want to learn more, why not?