Activity

blob blobbing

Started working on the main menu using nuklear.h and quickly realised it’s limitations. Wrote custom text renderer and managed to get it to display some text. Can now go back to working on the main menu, this time from scratch without relying on nuklear and leaving nuklear for whatever follows main menu

Attachment
0
blob blobbing

Got wind working! Encountered way more issues than expected allowing the smoke to flow out of the grid. Next step is gonna be a main menu (even simple one) so I can start building out of that. Many variables in my code are currently hard coded values the user cannot change in the middle of the simulation, so they will go into the main menu

Attachment
0
blob blobbing

Can create and delete obstacles and emitters during the simulation now! While working on it I realised two things: I can make the gui way prettier if I play around with nk_styles and it would be cool to have a way to save / load emitter & obstacle positions. But for the second one, I think I will first have to work on the main menu etc.

Attachment
0
blob blobbing

Tried implementing a spatial hash map and realised how impractical it is with the variying obstacles sizes and other issues, so I decided to see how much performance I can squeeze out by optimizing my already existing shaders with shared memory. That worked out fantastically.

Started working on the emitters and obstacles GUI. Very rudimentary for now, doesn’t allow for deleting / creating new emitters or obstacles. That’s what im gonna work on next.

Attachment
0
blob blobbing

Fixed a vorticity issue that has been bugging me for a while and fixed all the graphical issues that arised with allowing different grid sizes on different axis. With many objects the performance drops are pretty bad, I should implement a spatial grid for the solid objects, so thats what im probably gonna work on next!

Attachment
Attachment
0
blob blobbing

Cleaned up the multigrid implementation and it works wonderfully! Also had to rework a good amount of physics and graphics code due to it not allowing the user to set a non cubic non power of 2 grid (192x100x50 would not have been allowed before for example, only 128x128x128 or 256x256x256 etc)

In the image a 128x1024x128 grid!

Tried working on the ray marcher and investigating more of the pbr world but got only a boring and flattened smoke. Probably messed up formulas, will work on other issues now: velocities draw shader, grid lines shader and objects shader still expect an uniform grid, so they end up being squished. Biggest issue for now is the objects shader doing that: I want objects! and I cannot have them because it’s drawing them based on an uniform grid

Attachment
1

Comments

tunnor
tunnor 12 days ago

Project looks awesome! I can’t even imagine the math required to simulate this…

blob blobbing

Quickly implemented multigrid (so as you can guess the code looks horrible) after uni entrance test with cooked mind (fixing code tomorrow will make me cry) (i am gonna have nightmares tonight) and a 256x256x256 grid runs as good as a 128x128x128 grid with old code.. which is surprising! Take into account that the 256^3 grid is not double the old one it’s way more than that! 16.777.216 (256^3) against 2.097.152 (128^3)!

Pretty surprising performance jump taking into consideration that it was badly implemented.

For now it only works with powers of 2 and with a grid of same size in all axis. Will work onto fixing that issue in the next week. Enjoy a 256x256x256 smoke in the attached image (that would have taken ages before)

Attachment
0
blob blobbing

Was distracted by school these days. Not much changed output wise: Settings got cleaned up, resizing the window actually works now (before it would break as framebuffer would not be updated) and objects can now be hidden.

The next additions should be:
a GUI to spawn / edit / move emitters
a GUI to spawn /edit / move objects
multigrid solver

I do not want, at all, to work on GUIs anymore for at least a week. Because it should not affect too much most of the code I’ll work on the multigrid solver (or at least start working on it) so I can double the current grid size without falling into horrible fps values (Right now a 64^3 grid can be displayed flawlessly at circa 180 fps, which is not bad at all. Move to 128^3 and it drops to 30 fps. 30 fps.. with a timestep of 1/120 thats 4 seconds for 1 in-simulation second. Thats not real time)

Attachment
0
blob blobbing

got it working and not breaking my ray marcher. Now gotta make it actually send the new data to the gpu whenever it updates, and gotta make the code more readable. Right now it’s just nuklear calls filling up my main.c

Attachment
0
blob blobbing

Not a lot of cooperation between smoke sim and nuklear :/
I gotta figure out what else is nuklear changing that is breaking my ray marcher

Attachment
0
blob blobbing

cleaned up code and smoke is now affected by the solid objects! In the picture balls fell into the center of emitters so they displaced the smoke around!

Attachment
0
blob blobbing

there’s solid objects and they move now. 2 main problems:

  1. the code looks horrible. I wanted to finish implementing them before going to sleep so you can guess how much “ill fix that later” pieces of code are sitting around the various code files.
  2. the smoke is not really affected by them. It doesn’t move into them but they dont displace the already present smoke with their movement.

I will first work on fixing the first issue as I dont want more confusion in my already confusion-full project and then work onto the second issue.

Attachment
0
blob blobbing

Came back from school trip. Added emitters, cleaned up a lot of code, made everything togglable (right now with keybinds, will later move to ImGUI).

Not many visual updates. Emitters with advect_smoke turned off in picture.

Attachment
0
blob blobbing

Smoke can now be colored! Should make creating emitters easier and should implement wind now

Attachment
0
blob blobbing

actually improved ray marching :) damn does it look good

Attachment
0
blob blobbing

Cleaned up the code, realised vorticity confinement has some bug that leads velocites to explode after a while :/ they don’t explode for the first 10 seconds or so tho so it kinda works there? That will be something I’ll fix after school trip.. it’s headache inducing…

Attachment
0
blob blobbing

No way I just spent an hour looking at all shaders code, trying to understand whats wrong ,double checking math just to realise I was not binding the damn buffers on the gpu before initializing solid map.. how did I not notice from the start.. in the pic velocities are finally properly contained in the grid.. wow what an overlook

Attachment
0
blob blobbing

Ugh.. while working on vorticity confinement i noticed my damn velocities are slipping into solid cells. no idea where this is happening but its making smoke escape..

Attachment
0
blob blobbing

Temperature introduced! now onto vorticity confinement, afterwards i can finally work on tidying code up, adding external forces and making my smoke more smokey

Attachment
0
blob blobbing

Implemented some rudimentary ray marching. I hate pretty much everything about it, how flat it looks, how SAD it looks, but its fine as for now I just need to be able to see what my smoke is doing.. Will work on buoyancy and then I should be done with most of 2d -> 3d port, allowing me to work on a more exciting way to visualize this smoke..

Attachment
0
blob blobbing

finally managed to draw some kind of arrows ( i hate them, but they do their job quite fantastically for debugging purpouses ). Without them i would not have been able to get advection working.. at all. In the attached photo, properly advected +10.0f velocity at P(2,4,4) (grid size: 9^3)

Attachment
1

Comments

YourLocalSatyrFlip
YourLocalSatyrFlip about 1 month ago

SO COOL!

blob blobbing

Well the grid looks good.. time to move into coding the smoke..

Attachment
0
blob blobbing

slowly transitioning to 3d.. got the axis drawn! well, more importantly, started implementing the camera system and everything that could be completely ignored in 2d.

Attachment
0
blob blobbing

Cleaned up some code. Kind of happy with how my smoke behaves. Will now move to 3D! this is gonna be painful and im gonna regret this.. will backup all files because I know many things will break :/
Don’t even know where to start with visualization

Attachment
0
blob blobbing

temperature introduced! cold smoke falls, hot smoke rises!
as always it initially broke everything! had some issues with buffer swapping functions

Attachment
0
blob blobbing

it finally works on the gpu… man did it make me lose my mind… I was sampling incorrectly as i didnt realise how opengl’s texture() works.

1000x1000 grid. Gpu starts getting hot..

Attachment
0
blob blobbing

10h in im losing my mind. It’s way smoother on the gpu, but my advection program was wrong: it was for whatever reason advecting diagonally (??!!??!!) so I tried to fix it, just to end up with velocities completely disappearing (?!?!?!). Because of that i can’t even show how smooth it was, so this devblog will just be a high resolution grid being drawn…
I liked cuda way more. way more.

Attachment
0
blob blobbing

With velocity advection figured out I finally implemented smoke which is the main point of the simulation. Looks good, and as expected FPS are horrible and we’re still in 2d with an extremerly small resolution. I will start learning about opengl compute shaders now and will port most of the code to those.

I hope they are similar to CUDA ones otherwise this is gonna be rough

Attachment
0
blob blobbing

Arrows are drawn properly and divergence is finally being resolved.. fixed the math issues

Attachment
0
blob blobbing

Working on some arrows, I understood my grid was being drawn incorrectly. It took me 5 whole hours for one of my dumbest mistakes ever.. this was a headache (10x10 grid was drawn as 8x8. Now its properly drawn)

Attachment
0
blob blobbing

Got a way to visualise divergence. Will work on 2d until math works, then Ill port to 3d.

Attachment
0
blob blobbing

Got to transformations, textures. So far enjoying the OpenGL learning experience. Should soon start working on the smoke sim!

Attachment
0
blob blobbing

Shipped this project!

Hours: 1.12
Cookies: 🍪 26
Multiplier: 23.32 cookies/hr

Made a 40 pieces SODIMM / DIMM holder as the maximum I could find online was 25! Works pretty well

blob blobbing

Got to the rainbow triangle, implemented shader source parser

Attachment
0
blob blobbing

This will be a fun transition from my previous fluid sim project. Decided to drop WinGDI which I previously used as it proved to be painfully slow (I mean, part of the reason I chose wingdi was because I knew it was painfully slow) and CUDA as I want it to be usable on as many platforms as possible (Even if I really enjoyed CUDA programming!). I know NOTHING about openGL so my first project hours will probably be spent on learning opengl. So far? Set it up and got a window running! Good start. As soon as opengl clicks in I will start working on the smoke simulation math. First CPU; then slowly will transition it to GPU.

Attachment
0
blob blobbing

Someone might have accidentally swapped the mosfet’s gate and source in the pcb.. got it today with this pretty surprise. Fixed it…

And got the friendzone! Feeling so free now

Attachment
0
blob blobbing

did some work on jst connectors holders and started thinking about how to make the screen + buzzer assembly. Asked the girl I like if she wants to go out this thursday and she said yes. Idc if she ends up saying no or yes to my declaration what i want is to get out of this grey zone im in with her where i dont understand if she shares my same feelings

Attachment
0
blob blobbing

I should work on the radiator.. but I dont even know how to make it in the first place with my limited resources and tools. So I worked on the pc’s keyboard, to procrastinate that.. Simple 3 keys keyboard. Will have up, down, confirm.

The more I go forward with this project the more I realise the limitations of working with copper and limited space when having no dedicated tools. The water block is a pain I still did not figure out, and so is the radiator.. and then? the silicone tubes will be bent so much that they will exert a force I dont know my radiator and water pump holders will handle.. Dont know really how to proceed.

Attachment
0
blob blobbing

Printed everything that had to get tested:
-Water tank
-Back plate sliding mechanism
-PCB PSU
-Water pump a little bit extended holder
-JST holders

  • worked on water heatsink holder
Attachment
0
blob blobbing

Designed and printed. Works well! Made both SODIMM and normal ram versions.

Attachment
Attachment
0
blob blobbing

As said, I reworked the left panel of the case so it supports both 30mm and 40mm PSUs.

Attachment
0
blob blobbing

Worked on the PCB-using PSU.
Will now change left panel so it works with different PSUs without having to change it every time.

Attachment
0
blob blobbing

After some small final changed to the PSU pcb I ordered it. I decided I will not be using screw connectors or any sort of connectors for practical reasons. I made the pcb longer so the solder connections poke out and so soldering to it would be easier while having the PSU assembled.

I did not devblog much lately as I have been working, or at least trying to, on the heatsink. Spent a whole day using a handsaw to cut copper, soldering with heatgun + plumber solder, using epoxy putty… just for it to leak at inflow / outflow connections. Tried asking some family friends if they have cnc machines at their factories but no one does sadly. My next attempt will be by using a 1 inch copper tube as the main chassis to which I’ll solder bottom and top plates with oxygen + acetylene (that is, if, I get access to oxygen + acetylene from plumber father friend). If I fail in doing that because of the small size of the object I’ll try to invent something else. So far I have low expectations :(

But I will not give up.

Attachment
0
blob blobbing

Many changes, most notably:
Reworked front panel,
Decided to work on a PCB for the PSU as I have an expiring grant from High Seas.
Reworked button holder,
Reworked back panel and its attachments, so also top and bottom case parts,
Reworked how front and left panels attach by doubling the amount of screws
Reworked pump holder

Attachment
Attachment
Attachment
Attachment
0
blob blobbing

Reworked on the front mesh panel. I could not stand the old one

Attachment
0
blob blobbing

Finished front panel. Not particularly satisfied with it, so might change it in the future.

Attachment
0
blob blobbing

Printed most of the panels, they fit in a weird way but they do fit. Got a few more things to fix. Will then work on back side panel and finally figure out front mesh. Then it will be time to work on the heatsink..

Attachment
0
blob blobbing

First print showed many problems.
-The space taken by the rails for the side panels makes it hard to screw in the screws without bending the top or bottom of the case.
-The middle panel warped where the PSU should go.
-I completely, completely forgot clearance on the top and bottom of the middle panel. Inserting it into the top and bottom pieces was extremerly hard.
-In standoffs the space left for the screws head isn’t enough. They don’t fit.

Spent the time fixing these issues

Attachment
0
blob blobbing

Started working on the mesh. Will leave it unfinished as I have to decide what button to use (mechanical kb one or simple one). Will now work on the back side panel.

Attachment
0
blob blobbing

top plate finished, its turning out great! Cant wait to print it and have nothing fit correctly 😭

Attachment
0
blob blobbing

Decided to split the case from a single object to the different panels that screw in together.. Printing the case as a single object would have generated way too many supports and would have made prototyping a hassle. Bottom of the case in the pic

Attachment
0
blob blobbing

Might have forgotten a screw terminal in the old design.. well that’s fixed. Also had to change it a little bit to make it fit the now smaller psu.

Attachment
0
blob blobbing

More work on the case. Need to make the airflow cutout for the back and then I can move to the front panel.

Added the 3 slots which will be needed for the 2 extensions (oled screen, keyboard) + empty one for more ideas

Attachment
0
blob blobbing

Working on the case I decided to scale down the PSU.
The main issue were the screw connectors I was using taking up most of the space height wise, and I cut and filed down the excess plastic in them to make them 2/3 of the original size they were.

Attachment
0
blob blobbing

Final changes to water pump holder, kept working on the case while the prototypes were printing.

Attachment
Attachment
0
blob blobbing

Final change to psu connector. Started working on water pump holder but I took wrong measurements and have to measure everything again. Oh how much I hate not finding data sheets

Attachment
0
blob blobbing

Added one more screw to secure psu cover to the body. Fixed various tight fits. Changed the breakout board holder as I didn’t like how the old one barely held the breakout board inside.

Attachment
0
blob blobbing

Designed the PSU + screw terminals connector, will now print to check if everything fits as it should.

Attachment
Attachment
0
blob blobbing

Measured and recreated all the components I will use in the project to get a rough idea on how to design the case and the various modules around them.

Attachment
1

Comments

Cheetah
Cheetah 4 months ago

cool!