Oysi's 3D Rendering & Physics Engine

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Oysi's 3D Rendering & Physics Engine

Post by Ranguna259 » Fri Jul 18, 2014 8:46 pm

Awesome sauce, don't 3D engines use filters on meshes to smooth polygons and to make objects more realistic ? (like this)
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.

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 » Sun Jul 20, 2014 6:23 pm

Ranguna259 wrote:Awesome sauce, don't 3D engines use filters on meshes to smooth polygons and to make objects more realistic ? (like this)
They do indeed. It works by using a different normal for every vertex of the polygon, and then have it interpolated per pixel. I did actually do this, right after I made the texturing (very early on in this thread), as they both work off the same concept. You can see it here. You will also be able to see it my newest video:

TERRAIN!

Follow the potato. Achieve enlightenment.

LiquidDandruff
Prole
Posts: 18
Joined: Fri Dec 16, 2011 11:29 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by LiquidDandruff » Sun Jul 20, 2014 8:56 pm

I've just read the entire thread. This is amazing stuff, Oysi! I can't wait for your tutorials; you really are a god!

Scratchthatguys
Prole
Posts: 8
Joined: Thu Jun 12, 2014 10:49 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by Scratchthatguys » Mon Jul 21, 2014 7:25 pm

LiquidDandruff wrote:I've just read the entire thread. This is amazing stuff, Oysi! I can't wait for your tutorials; you really are a god!

Code: Select all

function love.load()
    now = os.time
    videos = {}
    people = {}
    people["god"] = oysi93
end
function love.update(dt)
    if os.time() >= now then
        videos[#videos + 1] = video.new()
        love.event.quit()
    end
end

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 25, 2014 8:16 pm

Haha.

Here's me having fun with my "engine", showing some of the stuff it's capable of:

I almost feel bad doing this, seeing as I haven't uploaded the thing.
almost =P

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 » Mon Jul 28, 2014 1:20 am

So with the previous optimizations I discovered, I've been rewriting my engine. But I got sort of stuck when I came to the shaders, because there are so many different ways of doing it. At first I used different shaders for different effects. One for texture mapping, one for texture mapping with normal mapping, one for texture mapping with normal mapping with some other effect, and so on. It was very tedious to have more than one, mainly because of all the extra code in each shader that is necessary to make it work. After that I swapped to a more unified system, where instead of using different shaders, I just put everything into one shader, but I could enable and disable features as I wanted. This is of course very nice for demonstration purposes, because I can change stuff at runtime with a simple function call. But the problem with this is that even though I turned things off, it would still send all the information, so turning everything off would change the output image, but not the performance.

Now I've sort of gone back to my first system, but I've changed it around a bit. Instead of adding in all that extra code, I created an include preprocessor directive. Currently it only works with 3 different things, GL_UNIFORMS, GL_LIB, and GL_MAIN, but I could of course make it work with filenames and such as well. Uniforms is the one with the uniforms (duh), sent from the lua code, having the projection information and such. Lib has a library of handy functions to make life easier, including the 'uv' function you see. And Main does all the main things, reverse projection, raycasting, uv mapping, all the good stuff to get the proper information you need. With all of this, I can create easy shaders:

Image

That shader effectively takes in the 3 vertex positions, 3 vertex colors, interpolates the color, and scales it by the depth to the pixel, giving this result:

Image

Here's a different shader, which also does texture mapping along with the per vertex color:

Image

And its result: (I pushed the camera further ahead, and reduced the intensity on the depth for a better image)

Image

Here is one last shader, where I took out the per vertex color, and added per vertex texture. =O

Image

And the result: (I left only one cube alive, and I rearranged the vertices for a better image)

Image

What do you guys think?
Follow the potato. Achieve enlightenment.

User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Somewhere in Brazil
Contact:

Re: Oysi's 3D Rendering & Physics Engine

Post by HugoBDesigner » Mon Jul 28, 2014 6:02 am

It looks really, really good, Oysi. It's smaller, so it'll be faster, and it's easier for you to add in new features. Good work! Your engine is the best 3D engine after Löve that I've seen so far!
HugoBDesigner - my Twitter
HugoBDesigner - my Blog

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 » Sun Oct 12, 2014 12:33 pm

Hi again, I have a new update. A haxy haxy sphere thingy (they're not actually real spheres, but then again, they behave just like normal spheres, so it really comes down to how you would define a real sphere, and whether you are philosophical enough to discuss this at length)...



Which is done by this neat little shader:

Image

It's incredibly fast, and I can't wait to implement optimized physics for spheres, so I can see how many of them I can have at once. =o

Although I am in the process of rewriting the whole thing, again. More to come later. =)
Follow the potato. Achieve enlightenment.

User avatar
Positive07
Party member
Posts: 1005
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Oysi's 3D Rendering & Physics Engine

Post by Positive07 » Mon Oct 13, 2014 2:42 pm

Oysi I may be dumb of course your 3D is amazing but I'm far more interested in that console of yours... it's awesome! can you post it or give me many hints on the workings of it?
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(Github.com/Positive07)

User avatar
veethree
Inner party member
Posts: 814
Joined: Sat Dec 10, 2011 7:18 pm

Re: Oysi's 3D Rendering & Physics Engine

Post by veethree » Tue Oct 14, 2014 12:25 pm

Positive07 wrote:Oysi I may be dumb of course your 3D is amazing but I'm far more interested in that console of yours... it's awesome! can you post it or give me many hints on the workings of it?
As far as i can tell it uses loadstring to run lua code. I've made one of those myself, There's a version of it hidden (in plain sight) in the source of my calculator if you want to check it out. If i remember right that version of it is completely self contained, so you can drop it into any project and it'll work.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests