3D Proof of Concept

Showcase your libraries, tools and other projects that help your fellow love users.
gnomish
Prole
Posts: 3
Joined: Wed Dec 03, 2014 4:18 pm

3D Proof of Concept

Post by gnomish »

3D Proof of Concept

Image

Recently, I've been hacking on a small 3D proof of concept. Here are some bullet points:
  • * Includes a very (very) basic WaveFront OBJ loader
    * Works with Love 0.9.1 out-of-the-box
    * Uses Luajit's FFI to enable/disable OpenGL's depth testing
Future work:
  • * Get vertex normals working
    * Explore possibility of using advanced opengl functionality
    * Break the OBJ loader out into a separate library on Github
    * Break out math library - either into it's own repo, or submit patches to shakesoda/cpml
Download:
3d-obj-loader-december-2-2014-v3.love


Many thanks to Karai, Madoka, Slime, and everyone else who helped get this working.


Also see:

LÖVE3D
viewtopic.php?f=5&t=78943

Oysi's 3D Rendering & Physics Engine
viewtopic.php?f=5&t=77896
User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

Re: 3D Proof of Concept

Post by Tjakka5 »

Looks great, and that fps too!

Can you also provide a example with multiple 3d objects?
And maybe even some with alpha and the such?
User avatar
soulaymenc
Prole
Posts: 36
Joined: Thu Jul 11, 2013 2:03 pm
Contact:

Re: 3D Proof of Concept

Post by soulaymenc »

Amazing work! Would love to see more features coming, so I can start making 3d games in love2d .. uhh that's sounds wrong .., love3d :D
This world is so strange.
gnomish
Prole
Posts: 3
Joined: Wed Dec 03, 2014 4:18 pm

Re: 3D Proof of Concept

Post by gnomish »

Tjakka5 wrote: Can you also provide a example with multiple 3d objects?
The example I posted has two meshes (two chests).
Tjakka5 wrote: And maybe even some with alpha and the such?
Could you clarify what you mean by alpha? Do you mean transparent textures? Could you provide a screenshot of what you mean?

Thanks
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: 3D Proof of Concept

Post by Jasoco »

The part I'm most interested in is the pixel depth shading. (Texture clipping when models overlap) This is the first time I've seen it done in Löve. I'd be interested in seeing a real stress test however. How would it handle a large scene with many models?
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: 3D Proof of Concept

Post by slime »

Jasoco wrote:The part I'm most interested in is the pixel depth shading. (Texture clipping when models overlap) This is the first time I've seen it done in Löve. I'd be interested in seeing a real stress test however. How would it handle a large scene with many models?
About as well as any 'real' 3D game, since it uses the same hardware functionality. :)
gnomish
Prole
Posts: 3
Joined: Wed Dec 03, 2014 4:18 pm

Re: 3D Proof of Concept

Post by gnomish »

slime wrote:
Jasoco wrote:The part I'm most interested in is the pixel depth shading. (Texture clipping when models overlap) This is the first time I've seen it done in Löve. I'd be interested in seeing a real stress test however. How would it handle a large scene with many models?
About as well as any 'real' 3D game, since it uses the same hardware functionality. :)
Exactly.

@Jasoco: This demo I posted is not like the 3D work you've been doing -- which is much more impressive, btw. If I'm not mistaken, you're writing a 3D rasterizer. With my demo, I was simply trying to find a way to inject a call to glEnable(GL_DEPTH_TEST).
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: 3D Proof of Concept

Post by Jasoco »

gnomish wrote:
slime wrote:
Jasoco wrote:The part I'm most interested in is the pixel depth shading. (Texture clipping when models overlap) This is the first time I've seen it done in Löve. I'd be interested in seeing a real stress test however. How would it handle a large scene with many models?
About as well as any 'real' 3D game, since it uses the same hardware functionality. :)
Exactly.

@Jasoco: This demo I posted is not like the 3D work you've been doing -- which is much more impressive, btw. If I'm not mistaken, you're writing a 3D rasterizer. With my demo, I was simply trying to find a way to inject a call to glEnable(GL_DEPTH_TEST).
I would kill to have pixel depth shading though. Without it it means all my quads (I have to use 4 corner quads instead of triangles because of the way my texture library works) are sorted as it by depth and if something is complex, you get improper z-sorting on certain polygons which looks terrible. Plus it means I can't have shapes intersect with other shapes as it will draw the entire polygon instead of clipping it.

I don't know how your demo really works even though I looked at the code, but as soon as I saw the two chests intersect with each other, you got my attention. Plus the detail and texturing of the model in that example was lovely. It's the style I'd love to go for but can't because of my limitations.

I'd always wondered if there was a way to take all my polygons, throw them into a shader with each ones four screen x and y and distance from camera for each corner and have it draw everything all at once with each textured polygon intersecting properly.

But thanks for saying mine is impressive even though it's quite simple and limited. Perhaps you'd like to go into more detail about what exactly is going on in this demo?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: 3D Proof of Concept

Post by Karai17 »

Jasoco wrote:The part I'm most interested in is the pixel depth shading. (Texture clipping when models overlap) This is the first time I've seen it done in Löve. I'd be interested in seeing a real stress test however. How would it handle a large scene with many models?
I'm gonna use this opportunity to remind you that the LOVE3D that myself and shakesoda are working has had depth buffering from the beginning (among many other things).
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
foo0
Prole
Posts: 35
Joined: Sun Apr 27, 2014 10:25 am

Re: 3D Proof of Concept

Post by foo0 »

I would love love.graphics.newMesh3D() function that would allow passing xyz coordinates to the shader without hacks :)
Post Reply

Who is online

Users browsing this forum: No registered users and 81 guests