Mr F

Mr F

@guycalledfrank.bsky.social

Graphics programmer, indie game developer. Developed Bakery (a GPU lightmapper) and some other tools. Ex-PlayCanvas engine dev. Working on Faded: https://linktr.ee/fadedthegame Other stuff: https://ndotl.wordpress.com/cv/

1.6K followers109 following215 posts

The corner restaurant has finally opened #gamedev #indiedev

Mr F@guycalledfrank.bsky.social

Improvised a little lampshade shader that imitates scattered light from inside. Code and details in the comments! :) #gamedev

There won't be any quest markers, minimaps and compasses in Faded. Instead you'll need to look at actual maps and building signs or ask around. All streets are named & buildings numbered (don't worry, I'll localize these) Can still be tricky if your goal is tucked inside a multi-layered back alley..

Meanwhile... Bakery v1.985 is out! Full changelog in the pic. Mainly released it now to fix Unity 6.5+ compatibility, but there are also some good performance optimizations. (and it's still on 50% sale, btw) #gamedev

Forgot why, but Bakery (and RTPreview) is on sale again! 👀 #gamedev (Link below) (BTW I'm submitting a new version this week, mainly to resolve issues with Unity 6.5+, and these fixes are also available on github)

Mr F reposted

In ~2007 when coding the ambient lighting of Splinter Cell, I had the idea of storing dynamic SH probes in Voronoi cells, where a) dynamic objects could walk/lerp the face graph, and b) static meshes "palettised" probes per vertex and lerped to give Realtime GI. It never shipped but look how pretty!

Previously Bakery didn't apply AO to light probes or volumes. There was a hidden option... but I didn't like how it worked. Now you can choose to apply it properly.

Mr F reposted

this is such brilliant work. id never have thought to fit toruses, but nicole's explanation below makes it seem so natural in hindsight. and then packs 9000 other awesome connections to other hard problems into one paper. chapeau to her & the co-authors

Nicole Feng@nicole--f.bsky.social

At #SIGGRAPH2026, I presented "points as tori" (PAT) for fast pointwise evaluation of signed distance for point clouds. Some code (Python w/ C++ extensions) and demo up: github.com/nzfeng/point... Contributions from people/LLMs welcome. Explainer thread below for the project: 🧵

Another little feature for today: when baking in full SH mode, you can force Bakery to pack all 3 extra maps in one (with some padding). It avoids using MaterialPropertyBlocks and slightly improves performance on all machines tested (didn't test mobile yet).

I updated Bakery Standard shader (BiRP) and BakeryURPLit to support this feature. Bonus: you don't actually need to rebake your scenes, you can convert separate to triple maps on existing bakes.

Also, since the triple SH map is fed via the directional map slot, it works together with the new "Use LightingDataAsset map/renderer link" option. With these two enabled you can even export full SH bakes and load them without any Bakery scripts at all.

Another feature for today: finally managed to hack-ishly write most of the bake metadata into LightingDataAssets (instead of scripted arrays), you can enable it in project settings now. Didn't benchmark it yet, but it can potentially improve scene loading times.

Added experimental Multivolumes to the github version of Bakery. Long story short, it allows you to read all BakeryVolumes of the scene in 1 texture tap in shaders, so it doesn't break any batching, & sub-volumes can still move/rotate dynamically. Longer explanation is in the pic

Updated Bakery's new OptiX9 version to support baking on multiple GPUs in parallel (on github). Currently only affects raytracing passes (not blend/denoise, but its easy to add later). If you have multiple GPUs, you can try it! (I don't but 1 person tested it successfully so far)

View full thread

This meant that the last year OptiX9 Bakery update didn't have neither driver-provided nor manually implemented multi-GPU support, I just used a simple heuristic to select the most capable GPU in the system. (2/x)

The new patch actually just spawns a separate process for every GPU and bakes its own part of the lightmap there, which is not the most sophisticated approach, but since baking doesn't have real-time presentation constraints, it actually works pretty well...

Updated Bakery's new OptiX9 version to support baking on multiple GPUs in parallel (on github). Currently only affects raytracing passes (not blend/denoise, but its easy to add later). If you have multiple GPUs, you can try it! (I don't but 1 person tested it successfully so far)

Some history: while previous Bakery versions were based on OptiX5/6, the multi-GPU-parallelism was supposedly handled by the driver - but it was done poorly (as it didn't know enough about the tasks), and eventually Nvidia removed this feature from newer versions entirely (1/x)

I don't post WIP content from Faded very often as there're many unfinished/unpolished parts, but as I already mentioned the crowd sim on twitter... here is the test scene. About 800 characters, 56 bones each, animation is 3.5 minutes (!) with random offset, LOD0 is at ~20k verts #indiedev #gamedev

View full thread

Full NPCs can push each other with proper animations and physics, but I also had to make crowd characters somewhat pushable as well. They act like these silly balls. I put them to an implicit grid (one of my fav acceleration structures, can store 1 NPC per bit per row/column!)

From Unity perspective each crowd NPC is just 1 non-skinned gameobject. Could even use instancing, but even without it it's pretty fast with SRP batching. All animation is purely in a vertex shader. Quats are read from an rgba16half texture.

I don't post WIP content from Faded very often as there're many unfinished/unpolished parts, but as I already mentioned the crowd sim on twitter... here is the test scene. About 800 characters, 56 bones each, animation is 3.5 minutes (!) with random offset, LOD0 is at ~20k verts #indiedev #gamedev

They get red when they actually transform to "full" NPCs with proper collision, AI and everything. Obviously in the real game they will look different and not be placed in a grid 😅 They will also have hair (oh god help me)

TIL you can take advantage of anisotropic filtering for directional blurs (!)

I generate mips and use textureGrad with anisotropy to make it a non-uniform blur, needing only 7 taps per pixel. Final result is really good, and cost 0.4ms (downsample, mip, effect, blit back up).

Low-key added a massive new feature to the github version of Bakery. If enabled, it should noticeably improve export & tracing time for scenes with large amounts of copy-pasted objects (e.g. forests). #gamedev

There is a known issue with per-vertex lightmaps and possibly GI correctness from non-lightmapped (receive GI = probes) objects in this mode, will fix it soon.

Do you also dislike how Unity's WheelCollider only casts 1 center ray, so cars jump on every tiny bump? Did you also see 3rd-party assets doing like 16 rays per wheel and thought maybe it's kinda expensive? Did you know that PhysX can actually sweep convex shapes instead of rays? #gamedev

View full thread

...aand somehow it actually WORKED 🤪 Even if you don't have Unity source code, you still have the asm and the pdb, so it's ALMOST like having source code 😂

So yes, the C# code on both top/bottom videos is actually identical. If we had Unity source, it would be a ~10-line change + you need to make UI for the user to add actual colliders to the wheels. But since we don't have it, we do it in arcane ways.

Do you also dislike how Unity's WheelCollider only casts 1 center ray, so cars jump on every tiny bump? Did you also see 3rd-party assets doing like 16 rays per wheel and thought maybe it's kinda expensive? Did you know that PhysX can actually sweep convex shapes instead of rays? #gamedev

View full thread

But it's not going to stop us... us being me and @meetem.bsky.social who wondered if we can just hack it into Unity. And we tried. Thanks to Unity.pdb, Meetem managed to find where it calls PxVehicleSuspensionRaycasts and replace it with a jump to custom mem where he forwarded it to a DLL

And I wrote a DLL that exposes a function with a similar signature, but instead, adds actual wheel shapes to the car and calls PxVehicleSuspensionSweeps. I also had to convert data between raycast/sweep queries.

Do you also dislike how Unity's WheelCollider only casts 1 center ray, so cars jump on every tiny bump? Did you also see 3rd-party assets doing like 16 rays per wheel and thought maybe it's kinda expensive? Did you know that PhysX can actually sweep convex shapes instead of rays? #gamedev

Light has stable world-space size done via this w*w dark magic. I remembered Humus' "phone-wire AA" using w for stable wire thickness, tried it here and it almost worked, but was still off... I squared it because it looked like it needs squaring, and it worked!

...and TBH I'm still not entirely sure why squaring makes it work mathematically. Apart from that the code is pretty simple. Dot gives you a blob, centered around object's pivot; sum of two pows gives a longer tail (GGX-ish, can probably do the same without pows).

Mr F reposted

The people of Ukraine continue to endure ongoing Russian aggression. From February 2 to 9, we’ll donate 100% of the proceeds from our games and DLC on all platforms to People In Need in support of humanitarian aid in Ukraine.