Page 11 of 13

Re: Oysi's 3D Rendering & Physics Engine

Posted: Tue Jul 08, 2014 1:17 am
by Oysi
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.

Re: Oysi's 3D Rendering & Physics Engine

Posted: Tue Jul 08, 2014 6:05 pm
by Oysi
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

Re: Oysi's 3D Rendering & Physics Engine

Posted: Tue Jul 08, 2014 6:46 pm
by Sheepolution
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.

Re: Oysi's 3D Rendering & Physics Engine

Posted: Tue Jul 08, 2014 8:39 pm
by jjmafiae
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.

Re: Oysi's 3D Rendering & Physics Engine

Posted: Thu Jul 10, 2014 1:49 am
by substitute541
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.

Re: Oysi's 3D Rendering & Physics Engine

Posted: Thu Jul 10, 2014 3:04 am
by ArchAngel075
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...

Re: Oysi's 3D Rendering & Physics Engine

Posted: Tue Jul 15, 2014 3:03 am
by Oysi
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. =)


Re: Oysi's 3D Rendering & Physics Engine

Posted: Tue Jul 15, 2014 11:08 am
by jjmafiae
my mind is blow, this is amazing

Re: Oysi's 3D Rendering & Physics Engine

Posted: Fri Jul 18, 2014 6:07 pm
by badfitz66
oysi is a bot ok

Re: Oysi's 3D Rendering & Physics Engine

Posted: Fri Jul 18, 2014 8:29 pm
by Oysi
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.