Oysi's 3D Rendering & Physics Engine

Showcase your libraries, tools and other projects that help your fellow love users.
Nautical Mile
Prole
Posts: 11
Joined: Thu Aug 22, 2013 5:39 pm
Location: Canada

Re: Oysi's 3D Rendering & Physics Engine

Post by Nautical Mile »

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. ;)
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by Someguynamedpie »

Nice job! Out of curiosity, do you offload any of the work onto separate threads?
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by badfitz66 »

I've always been interested in water physics in 2D games.
Nautical Mile
Prole
Posts: 11
Joined: Thu Aug 22, 2013 5:39 pm
Location: Canada

Re: Oysi's 3D Rendering & Physics Engine

Post by Nautical Mile »

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).
User avatar
Oysi
Prole
Posts: 48
Joined: Fri May 02, 2014 11:18 pm
Location: Earth

Re: Oysi's 3D Rendering & Physics Engine

Post by Oysi »

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

Someguynamedpie wrote:Nice job! Out of curiosity, do you offload any of the work onto separate threads?
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.
Follow the potato. Achieve enlightenment.
User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: Oysi's 3D Rendering & Physics Engine

Post by mickeyjm »

Oysi wrote: Nope, Lua doesn't even have multithreading, so I don't see how you could.
I'm sure it wouldn't be too hard to add threads.
Your screen is very zoomed in...
User avatar
Oysi
Prole
Posts: 48
Joined: Fri May 02, 2014 11:18 pm
Location: Earth

Re: Oysi's 3D Rendering & Physics Engine

Post by Oysi »

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. =)
Follow the potato. Achieve enlightenment.
User avatar
Oysi
Prole
Posts: 48
Joined: Fri May 02, 2014 11:18 pm
Location: Earth

Re: Oysi's 3D Rendering & Physics Engine

Post by Oysi »

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)

Image
Follow the potato. Achieve enlightenment.
User avatar
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

Post by slime »

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.
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.
User avatar
Someguynamedpie
Citizen
Posts: 71
Joined: Wed Mar 31, 2010 10:59 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by Someguynamedpie »

I added you on steam to go through some of the things you could shove into threads.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests