Oysi's 3D Rendering & Physics Engine

Showcase your libraries, tools and other projects that help your fellow love users.
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 » Tue Jul 08, 2014 1:17 am

This is where the fine line between actual graphics and haxy 2d 3d graphics comes in again. Because the way it's done in actual graphics is that each vertex of an object is transformed all nice and well, and then it goes through the faces and looks up the already transformed vertices. This means that for a cube, you transform 8 points and not something like 4*6=24 or 2*3*6=36. But what I have found is that the overhead of storing stuff in tables and such actually eliminates the speed you gain. By doing it like this, it will still be a bit faster, but it's more work to code, and becomes quite a lot slower when you do stuff like individual triangles (not part of a mesh or anything).

That z-sorting issue doesn't really go away until you implement something like a depth buffer (which I still haven't found a way to do). BUT, you can at least eliminate it for all convex models (for example a cube). By just culling back faces, you effectively take away any sort of artifacts (not your definition of artifact =P) that an object may create with itself, while essentially doubling your speed with barely any difference to the final result.
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 » Tue Jul 08, 2014 6:05 pm

I got something very interesting in this video, which doesn't really have too much to do with 3D, but it's still in 3D, so hey, why not. =P



As you can see, loading the video took roughly 5 seconds, and it's a 16 second video. So theoretically, I could put the loading into a separate thread and sort of stream the video bit by bit, which would essentially make it completely dynamic. =D
Follow the potato. Achieve enlightenment.

User avatar
Sheepolution
Party member
Posts: 254
Joined: Mon Mar 04, 2013 9:31 am
Location: The Netherlands
Contact:

Re: Oysi's 3D Rendering & Physics Engine

Post by Sheepolution » Tue Jul 08, 2014 6:46 pm

I didn't even know you could put videos in LÖVE.

It's basically a 2D video of a 2D video of a 3D world in a 3D world made in a 2D framework.

jjmafiae
Party member
Posts: 1333
Joined: Tue Jul 24, 2012 8:22 am

Re: Oysi's 3D Rendering & Physics Engine

Post by jjmafiae » Tue Jul 08, 2014 8:39 pm

when I saw it at first I was like no way this is löve, I don't have words worthy of describing this.

you are doing stuff I thought was impossible to do with this engine, you did the impossible.

User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Oysi's 3D Rendering & Physics Engine

Post by substitute541 » Thu Jul 10, 2014 1:49 am

Sheepolution wrote:I didn't even know you could put videos in LÖVE.

It's basically a 2D video of a 2D video of a 3D world in a 3D world made in a 2D framework.
My brain hurts.
Currently designing themes for WordPress.

Sometimes lurks around the forum.

User avatar
ArchAngel075
Party member
Posts: 317
Joined: Mon Jun 24, 2013 5:16 am

Re: Oysi's 3D Rendering & Physics Engine

Post by ArchAngel075 » Thu Jul 10, 2014 3:04 am

Why doesn't Oysi get hired by slime and the Love2D creators i don't know. He is head developer of cool things that make love more than love (lust ?!?!?!) :P

Im too tired for this...

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 » Tue Jul 15, 2014 3:03 am

Haha, thanks folks. Much appreciated! =D

And I have a new update. Mesh physics! Which really it has been capable of for quite some time, but I just haven't made a video of it. Actually, the video is a few weeks old as well, so... Yeah. Anyway, here it is, using the lovely teapot. =)

Follow the potato. Achieve enlightenment.

jjmafiae
Party member
Posts: 1333
Joined: Tue Jul 24, 2012 8:22 am

Re: Oysi's 3D Rendering & Physics Engine

Post by jjmafiae » Tue Jul 15, 2014 11:08 am

my mind is blow, this is amazing

badfitz66
Prole
Posts: 29
Joined: Sat Jun 07, 2014 10:30 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by badfitz66 » Fri Jul 18, 2014 6:07 pm

oysi is a bot ok
What a wonderful caricature of intimacy

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 » Fri Jul 18, 2014 8:29 pm

A little non-video update: I've optimized my thing quite a lot. I tested the garbage that my thing was outputting, and the result was quite crazy. It was spitting out like 10 mb per sec for a scene of around 10k triangles. I was creating tables and then ditching them, every frame. Which makes for some easy coding, but not very ideal in terms of memory, even for Lua with fully automatic garbage collection. So I did some testing, re created my engine in a very simple way to do some simple benchmarking without all the shader stuff and normal stuff and texture and bla bla...

Image

Went from that inconsistent spiky piece of madness, to this smooth piece of awesomeness:

Image

You can also notice that the actual memory used is a whole lot less. The only garbage from that second pic is really all from the love.run function, which is only around 1 kb per sec, which is essentially nothing. I could literally just disable the garbage collector and run the program for ages without any problems (as opposed to previously, where it would quickly get to 2 GB and then crash xD (when I disabled the gc, that is)).

On top of that, I changed the core parts of my engine a bit, to put more emphasis on reference. So instead of creating objects everywhere, just create them at first, send them in by reference and change accordingly. Which gave me a pretty huge fps boost as well (although for some reason it syncs to 30 fps). I was able to render 100k polygons at 10 fps:

Image

That's 100 teapots (rendering all faces). And it's also completely dynamic. I could move them around and rotate and scale and whatever, which would add some time to the processing, but not much. I should note though, that this is without depth sorting and coloring. When I added those, the fps went from 10 to 3. But it's still a whole lot faster than what I had previously.
Follow the potato. Achieve enlightenment.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests