If you are interested in fluids in video games, this series of articles gives a great introduction for those who are competent programmers, but are new to CFD. Dr. Gourlay uses the discrete vortex method (DVM) for the first 16 articles, and then discusses Smoothed Particle Hydrodynamics (SPH), from article 17 onward. DVM is more applicable to gases and swirling flows, while SPH is more applicable to liquids.
Beware: this is likely a more significant undertaking than what you have accomplished so far. My research is in CFD, and I have some knowledge of how fluids can be implemented in 3D games. If you want to know how far the rabbit hole goes, let me know.
Oysi's 3D Rendering & Physics Engine
-
- Prole
- Posts: 11
- Joined: Thu Aug 22, 2013 5:39 pm
- Location: Canada
- Someguynamedpie
- Citizen
- Posts: 71
- Joined: Wed Mar 31, 2010 10:59 pm
Re: Oysi's 3D Rendering & Physics Engine
Nice job! Out of curiosity, do you offload any of the work onto separate threads?
Re: Oysi's 3D Rendering & Physics Engine
I've always been interested in water physics in 2D games.
-
- Prole
- Posts: 11
- Joined: Thu Aug 22, 2013 5:39 pm
- Location: Canada
Re: Oysi's 3D Rendering & Physics Engine
That's cool you guys are interested, but this thread is taking a pretty big detour. I will start a new, general discussion on the topic containing more info when I have some free time (hopefully within 48h).
Re: Oysi's 3D Rendering & Physics Engine
@Nautical Mile
Those articles look very intriguing. I have done similar things, but not quite like that. It will be a good read, once I get around to it. =P And it would be very helpful if you would make that thread. =)
Those articles look very intriguing. I have done similar things, but not quite like that. It will be a good read, once I get around to it. =P And it would be very helpful if you would make that thread. =)
Nope, Lua doesn't even have multithreading, so I don't see how you could. The only thing that runs on separate "threads" is the shader stuff, the GLSL code (which runs on the GPU). But my demos sometimes use it and sometimes don't. For all the physics videos, I don't use any shaders. The shading there is done by Lua code. What uses shaders in my demos, are: diffuse & specular shading, z buffer (& shadows), god rays, texture/normal mapping, color interpolation. Generally stuff where all the pixels on a polygon aren't the same.Someguynamedpie wrote:Nice job! Out of curiosity, do you offload any of the work onto separate threads?
Follow the potato. Achieve enlightenment.
Re: Oysi's 3D Rendering & Physics Engine
I'm sure it wouldn't be too hard to add threads.Oysi wrote: Nope, Lua doesn't even have multithreading, so I don't see how you could.
Your screen is very zoomed in...
Re: Oysi's 3D Rendering & Physics Engine
Interesting. I didn't know Love2D did that. But still, my statement stands. Lua really doesn't support multithreading. Best they could do is run 2 versions of Lua at the same time, on different CPU threads. And coroutines have nothing to do with multithreading. They let you do many things, as well as mimic the appearance of multithreading, but it's not actual multithreading.
But I will try this out. Experiment. It has some clear limitations, due to (again, like I said) lua not supporting multithreading, so I will have to change up my stuff a bit and do some tedious stuff as well. But I will try. =)
But I will try this out. Experiment. It has some clear limitations, due to (again, like I said) lua not supporting multithreading, so I will have to change up my stuff a bit and do some tedious stuff as well. But I will try. =)
Follow the potato. Achieve enlightenment.
Re: Oysi's 3D Rendering & Physics Engine
After further consideration, I realize that I can't really use the thread system. I rely too much on multidimensional tables, and those aren't supported. Splitting up the data would be tedious, and will slow it down so much that it might not give a speed increase at all. For now I will stick to one thread.
On the other hand, I was trying to optimize my god rays, when something very strange happened.
(Currently I have no idea what is going on, but it looks pretty)
On the other hand, I was trying to optimize my god rays, when something very strange happened.
(Currently I have no idea what is going on, but it looks pretty)
Follow the potato. Achieve enlightenment.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Oysi's 3D Rendering & Physics Engine
A typical use for threads in games is to have some sort of job system, where you have a pool of a handful of threads waiting for jobs, and you send a few jobs off (via a channel or whatever) and then get the results back when you need them. The jobs would be some kind of self-contained calculation or other kind of workload.Oysi wrote:After further consideration, I realize that I can't really use the thread system. I rely too much on multidimensional tables, and those aren't supported.
- Someguynamedpie
- Citizen
- Posts: 71
- Joined: Wed Mar 31, 2010 10:59 pm
Re: Oysi's 3D Rendering & Physics Engine
I added you on steam to go through some of the things you could shove into threads.
Who is online
Users browsing this forum: Bing [Bot] and 2 guests