tsherif
tsherif on Hacker News
Posted by
tsherif on Tuesday August 16, 2022 @09:28AM
from the tsherif.github.io dept.
Thanks! Nothing against SDL. It's a great library, and I referenced its source code a lot while writing the platform layers. But I did find it incredibly satisfying to write everything myself. If you do ever decide to take a crack at it, I highly recommend Handmade Hero as a starting point:
https://handmadehero.org/
Thanks for the tip! I'll try to figure out if something similar is happening on either of the machines I'm using. That's a bummer that an in-place update function would be allocating behind the scenes...
Thanks! My first child was born last year, and I started a new job 3 months earlier, so time was definitely not an abundant resource! But between the stress of all that and the pandemic, I found squeezing in an hour or two for this project here and there was one of the few things keeping me sane, and that's what got me through it.
Ack! Right I hadn't thought of that. I'll have to decide if I'm ok with breaking the "written in standard C" constraint on this project...
Thanks! I definitely tried to focus on only using as much abstraction as was actually helpful in getting it to work the way I wanted it to.
Sweet, thanks for sharing! I'll definitely take a look.
Thanks! This was a revelation for me on a few levels:
1. That memory management doesn't have to be scary with a little forethought, at least for programs where you can set a reasonable upper bound on the resource requirements.
2. That it's possible to structure at least a subset of programs in such a way that error states can only be entered during initialization, and that makes the rest of the program much easier to reason about.
> i even found out that a call like glBufferSubData will call malloc or related functions. so doing that on each frame seems to be a bad idea as well.
That's interesting and not what I'd expect at all! Is there documentation you could point me to or did you find that out with some tooling? And is there a better way to update attribute buffers for instanced draw calls?
Hadn't seen this before, but that's a flattering comparison. Thanks!
That's an interesting idea. Probably won't change the format for this project, but something I might consider in future ones. Thanks for the tip!
In a sense, I did use SDL. The source code of SDL, along with GLFW and Sokol, were my primary references when writing the platform layers.
For now, it's Windows/Linux only. I hope to write a Mac platform layer eventually. I just don't currently have a Mac machine to work on...
Posted by
tsherif on Tuesday January 05, 2021 @09:39AM
from the github.com dept.
Posted by
tsherif on Wednesday July 01, 2020 @08:31AM
from the tsherif.github.io dept.
Posted by
tsherif on Monday May 04, 2020 @07:36AM
from the tsherif.github.io dept.
Posted by
tsherif on Monday January 06, 2020 @10:00AM
from the github.com dept.
Posted by
tsherif on Tuesday December 03, 2019 @08:22AM
from the github.com dept.
Posted by
tsherif on Monday August 14, 2017 @08:09AM
from the tsherif.wordpress.com dept.
Yeah, I was fiddling with the parameters until I found something I kind of liked. A couple of important factors:
1. Stiffness of the cloth depends on the number of particles vs. the number of iterations you do to resolve the constraints (maybe there's a way to speed this up?). So making things stiffer (at the same grid resolution) does take more time.
2. The faster things are moving, the higher the likelihood that that collisions will be missed. You can already see this if you move the ball very quickly, it can pass through the cloth. With higher gravity, I found the cloth would often get pushed through the ball.
If you want to fiddle around with it, you can clone and tweak the physics parameters here:https://github.com/tsherif/picogl.js/blob/master/examples/cl... and the simulation parameters here: https://github.com/tsherif/picogl.js/blob/master/examples/cl...
Totally! And it's still crazy to me that you can just send out a link to share this kind of thing with people.
Yeah, for sure. Not doing any self-collision detection. If you know of any good references for how to that on the GPU, I'll give it a shot.
It looks like this might be an issue with Apple's AMD driver, since everyone who's having problems seems to be on Mac/AMD setup. I'll look into this when I get my hands on a machine to test on.
Transform feedback is great, but I'm not actually using it for this because I need access to adjacent positions in the grid. I'm using float textures to store the positions and normals.
Posted by
tsherif on Wednesday June 21, 2017 @08:09AM
from the tsherif.github.io dept.
Posted by
tsherif on Monday May 01, 2017 @02:19PM
from the tsherif.github.io dept.