Mr F's Avatar

Mr F

@guycalledfrank

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,309
Followers
106
Following
149
Posts
16.08.2023
Joined
Posts Following

Latest posts by Mr F @guycalledfrank

I polished the dll part a few days ago, but as for actually binary patching it's up to @meetem.bsky.social . It's a bit tricky to do for all platforms and Unity versions.

04.03.2026 08:30 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Thank you, and I like what you baked! 😍

15.02.2026 11:57 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

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.

15.02.2026 11:23 πŸ‘ 7 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

...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 πŸ˜‚

15.02.2026 11:22 πŸ‘ 6 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

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.

15.02.2026 11:22 πŸ‘ 4 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

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

15.02.2026 11:22 πŸ‘ 6 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Post image

...but not in Unity. As it turns out, PhysX supported non-ray wheels for about 10 years. It's mentioned in 2017 on Unity forum... discussions.unity.com/t/physx-v3-4...

Yet Unity never exposed this abiltiy (even though they kept updating PhysX version).

15.02.2026 11:21 πŸ‘ 6 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Video thumbnail

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

15.02.2026 11:21 πŸ‘ 37 πŸ” 3 πŸ’¬ 6 πŸ“Œ 0
Post image

Introducing FragCoord: My ultimate shader editing tool!

13.02.2026 02:20 πŸ‘ 290 πŸ” 84 πŸ’¬ 11 πŸ“Œ 8

Unity, but as long as you can access world (aka model) matrix and view-projection matrix, you should be able to use the same code

13.02.2026 08:10 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Video thumbnail

I've been working with Spherical Gaussians recently as a representation for irradiance in realtime raytracing.

Ended up deriving quite a few new approximations relating to SGs and diffuse lighting. Ended up with something both cheap and accurate. Check it out:

www.shadertoy.com/view/WX3fRB

11.02.2026 14:50 πŸ‘ 77 πŸ” 10 πŸ’¬ 1 πŸ“Œ 1

You can try it yourself fairly quickly. but with w=1 the "light" will be fixed in screen space, unconnected from object's distance; with non-squared w it will appear to shrink with distance, but with a different speed from the object itself. Single pow is just too harsh like a basic phong highlight

10.02.2026 18:50 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

It's probably because pow doesn't scale the dot linearly, so I need to square the power... but often I just do the first intuitive thing looking at the image and how it responds.

10.02.2026 13:25 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Do you mean with one dot or without w-squaring?... or just more different lamps? πŸ˜…

10.02.2026 13:00 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

...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).

10.02.2026 12:57 πŸ‘ 3 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Post image

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!

10.02.2026 12:56 πŸ‘ 11 πŸ” 0 πŸ’¬ 3 πŸ“Œ 0
Video thumbnail

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

10.02.2026 12:56 πŸ‘ 117 πŸ” 11 πŸ’¬ 5 πŸ“Œ 0

Hmmm I only read whom I follow and I guess I don't follow annoying people, because my experience here and there is pretty similar...

08.02.2026 08:32 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Video thumbnail

New post on how to do real-time diffuse global illumination using surfels and #WebGPU: juretriglav.si/surfel-based... #threejs

29.01.2026 12:22 πŸ‘ 164 πŸ” 30 πŸ’¬ 1 πŸ“Œ 2
Post image

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.

02.02.2026 13:36 πŸ‘ 289 πŸ” 120 πŸ’¬ 8 πŸ“Œ 11
Post image Post image Post image Post image

Marcin Zalewski informed me that his blog post on real-time hair rendering using ray tracing is now available:
mmzala.github.io/blog/hair-ge...
This is nice work, in which he compares NVidia's hardware accelerated hair to several alternatives, including Reshetov's Phantom Ray Hair Intersector.

02.02.2026 15:29 πŸ‘ 40 πŸ” 13 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - pm4rtx/Unity-FrustumCulling: An example frustum culling implemented using Unity Burst compiler and native plugin An example frustum culling implemented using Unity Burst compiler and native plugin - pm4rtx/Unity-FrustumCulling

There’s also so called AoSoA layout which has benefits of the both (and some GPUs support that 10+ years but APIs never exposed). An example of AoSoA use on CPU also shows pretty solid perf (e.g. : github.com/pm4rtx/Unity...)

03.02.2026 02:25 πŸ‘ 3 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Post image

Slapped together a dialogue editor for my game in ~3 days, based on imgui-node-editor from thedmd (github.com/thedmd/imgui...). They were previously all just hardcoded inside NPC behaviours and it was a mess to read (+ nobody else could write them), so hopefully it was worth it!

31.01.2026 10:39 πŸ‘ 12 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Lovely results!

10.01.2026 10:48 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Aand the new Bakery patch is now available on the Asset Store! (and it's still 50% off)
assetstore.unity.com/packages/too...

#gamedev

24.12.2025 00:49 πŸ‘ 8 πŸ” 4 πŸ’¬ 0 πŸ“Œ 0

If you had an issue on a 50xx GPU after that patch, please try patching again - I've just updated it.
Many thanks to @imlexz.bsky.social for testing!

23.12.2025 18:47 πŸ‘ 4 πŸ” 0 πŸ’¬ 0 πŸ“Œ 1
Post image

The black friday sale is over, but now there's a new one! Because Christmas is near or something? I guess!
#gamedev

(And if you're on a >= 590 driver, please try the github patch! It's almost ready for the Store release)

21.12.2025 14:18 πŸ‘ 12 πŸ” 5 πŸ’¬ 0 πŸ“Œ 0
Preview
No Graphics API β€” Sebastian Aaltonen Graphics APIs and shader languages have significantly increased in complexity over the past decade. It’s time to start discussing how to strip down the abstractions to simplify development, improve pe...

My "No Graphics API" blog post is live! Please repost :)
www.sebastianaaltonen.com/blog/no-grap...

I spend 1.5 years doing this. Full rewrite last summer and another partial rewrite last month. As Hemingway said: "First draft of everything is always shit".

16.12.2025 18:51 πŸ‘ 467 πŸ” 191 πŸ’¬ 19 πŸ“Œ 12

New Bakery version uses OptiX9 library instead 6.
OptiX9 API is massively different to OptiX6. The "fix" was comparable to porting a DX9 game engine to DX12 πŸ˜…
But on the other hand, it's now much more efficient and in retrospect I see why NV wanted to deprecate 6...

15.12.2025 16:58 πŸ‘ 7 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Bakery has been updated to support the new drivers!

Please try updating via github/patcher. If no issues are reported within the next week, I'll update the Asset Store version.

The new version should also bake faster (!)

15.12.2025 16:50 πŸ‘ 14 πŸ” 2 πŸ’¬ 1 πŸ“Œ 1