Show more

I really wish I could write code without bugs in it. It would save me so much time.

Also, the "Ask the Experts" section of the source report from WalletHub has some great advice for entrepreneurs too.

Show thread

Finally got a world-space technique for ambient occlusion working in my molecule renderer! The extra darkening at corners really helps with depth perception and makes the objects easier to visually parse.

Been working on lighting shaders lately. Found a good intro to physically-based rendering here:

It starts with a simple Lambert BRDF. The author glosses over some important bits, but there's enough detail there to get the main idea.

Of course, I decided to go for analytical solutions to the integrals because I'm apparently a masochist. But it was fun!

More progress on my interactive molecule app for work, called MolScope. It's built using Kludge, my and wrapper for .

"A language that doesn't affect the way you think about programming is not worth knowing"

-- Alan J. Perlis

Apparently I'm going to be gushing about the ecosystem for some time now...

But cargo makes fork-and-fix for libraries super easy! Just clone the git repo, and add a `[patch]` to your cargo toml file and you can edit library sources just like they were in your own project.

Although, sometimes I really know more than rustc does. Especially when I'm reasoning about the C libs I'm using. For those cases, I'm allowed to break the rules and be "unsafe".

But the coolest part is I only have to be "unsafe" when I really need it. And since rustc makes me think twice as hard about "unsafe" code, I think I'm less likely to get it wrong in those cases.

Show thread

The compiler continues to amaze me.

I've been writing a multi-threaded app that interfaces with other C libs. And so many times now, I've wanted to write my inter-thread communication in a certain way, and rusc often tells me no.

And when I think about the communication some more, rustc is usually right! And then I change my design to make rustc happy, and that bug goes away.

Haha, and here's the commit from Jan 31 that is exactly the same as the hack I just made to the kernel last night. It's pretty fun I can look at the commit history like that. Open source development is awesome! Thanks, Andrzej!

Show thread

Oooh!! Apparently the features I want were added to later versions of the FunctionFS kernel module! Maybe I should back-port those changes to the source tree I'm stuck working with.

It's fascinating that my quick hack is almost exactly reproduced in current linux kernel sources!

Show thread

Might just have to "bite the bullet" and write a proper kernel module for my device. But staying in userspace is soooo much more convenient!

Show thread

Oi! The FunctionFS system in the Linux Kernel is really cool for creating USB devices in userspace, but it's not quite as configurable as I'd like it to be.

It doesn't seem to support USB 3 speeds at all, and if you try for USB 2 "HighSpeed", FunctionFS limits you to "FullSpeed" instead. Womp womp.

It took a custom hack to the FunctionFS kernel module, but I finally got my USB device working at the speeds I want. =) (for now).

Not sure if that's the right solution long-term, but it'll do for now.

In other rendering news, I'm keeping my eye on the DriftFX project. It integrates with other rendering technologies like D3D and OpenGL.

Maybe someday I can integrate it with Kludge and allow JavaFX GUIs. In addition to ImGUI.

Show more
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!