Ogre Procedural [v0.2 officially out]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
LinuxInside
Kobold
Posts: 30
Joined: Sun Dec 11, 2011 6:00 pm

Re: Ogre Procedural v0.1 released!

Postby LinuxInside » Thu Jan 19, 2012 9:49 pm

Mikachu wrote:Oops, you're right!
I didn't see that... and the compiler didn't tell me it's weird (returning a private type from a public method)


No problem, I'm a sort of tester! :D
0 x

User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany

Re: Ogre Procedural v0.1 released!

Postby tdev » Sun Feb 12, 2012 10:37 am

just for documentation [so i dont forget ;)], need to use this lib for svg parsing: http://code.google.com/p/nanosvg/
looks well fitted for our purpose
0 x

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Sun Mar 11, 2012 12:53 pm

I have troubles with applying materials to procedural meshes. My log says my material has been parsed, without errors, still the log says

Code: Select all

12:40:17: Can't assign material  to SubEntity of Ogre/MO3 because this Material does not exist. Have you forgotten to define it in a .material script?
0 x

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Sun Mar 11, 2012 3:38 pm

@jokoon : I don't think it's related to the fact that it's a procedural mesh.
Looking at the log message, you're probably trying to apply a material whose name is an empty string...
0 x
OgreProcedural - Procedural Geometry for Ogre3D

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Thu Mar 29, 2012 1:24 pm

Is it possible to "carve" 3D shapes ?

I explain:
Let us say I have a cube, and I want to make a box out of it (a box I can put stuff in, think like a concave box). So I select another smaller cube, and tell it to carve inside the former cube. I could also have selected another shape, like a cylinder or another shape.

Any other way I can do this ? I could make windows out those simple steps, but I don't know if it's already possible to do that in ogre procedural.
0 x

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Thu Mar 29, 2012 1:34 pm

The feature you're mentioning is generally referred to as CSG.
Currently, OgreProcedural 0.2 supports CSG in 2D only : you can do CSG between 2D shapes, then extrude it into a 3D mesh, which can cover a few use cases.
3D CSG is not yet supported, I intend to try implementing it for 0.3 ... :)
0 x
OgreProcedural - Procedural Geometry for Ogre3D

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Thu Mar 29, 2012 2:32 pm

Well I'm really impatient to see it working then :D !

Best luck to you, must be quite complicated to implement such a feature :shock:

I wonder if I could be any help, I'm not the best coder out there, but I have time and this really is a feature I'm looking towards to.

One could generate several sorts of building or other objects by a set of rules and parameters, instead of storing full meshes, could be a very powerful way to save space for large levels, and still it would be non-repetitive.

Found this, how good do you think it is ?
viewtopic.php?f=11&t=48028
0 x

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Thu Mar 29, 2012 4:42 pm

jokoon wrote:I wonder if I could be any help, I'm not the best coder out there, but I have time and this really is a feature I'm looking towards to.

Feel free to contribute :) ... but I doubt that 3D CSG is the easiest feature to implement (I keep a list of features to implement here)

Based on my experience on 2D CSG, the general case is not too complex, but there are plenty of edge cases to handle (things like coplanar triangles and the like..). Maybe getting inspiration on the 2D CSG algorithm would be a good way to start (at least, that's how I would do it).
jokoon wrote:Found this, how good do you think it is ?
viewtopic.php?f=11&t=48028

I knew it existed, but never tried it...
The "GPL" word may have triggered a red light in my mind :P
0 x
OgreProcedural - Procedural Geometry for Ogre3D

User avatar
zarfius
Gnome
Posts: 367
Joined: Wed Jan 03, 2007 12:44 pm
Location: Brisbane, Australia
Contact:

Re: Ogre Procedural v0.1 released!

Postby zarfius » Fri Mar 30, 2012 12:37 pm

I've done some work on 3D CSG recently. It does take a long time and a lot of careful testing. The basic idea to to cut each polygon by the "planes" of any intersecting polygons and then remove any polygons on the inside of the solid shape. You should be able to get an idea of the methods / functions you'll need to implement from that short description :)

I'm not ready to release my code, but a helpful resource I found in my research is the Java UnBBoolean implementation.
http://unbboolean.sourceforge.net/
0 x
Craftwork Games - hand crafted entertainment.
http://www.craftworkgames.com/

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Fri Mar 30, 2012 12:48 pm

zarfius wrote:It does take a long time and a lot of careful testing. The basic idea to to cut each polygon by the "planes" of any intersecting polygons and then remove any polygons on the inside of the solid shape.

Yeah, that's the method I used for 2D CSG, and that I intended to use for 3D CSG too (seg-seg instead of tri-tri intersections, but it's the same idea..)
So I'm not the only one to have had this idea :)
zarfius wrote:It does take a long time and a lot of careful testing.

Even if 2D CSG is probably easier, it was still a big pain to test every possible case, so I guess you're right ;)
0 x
OgreProcedural - Procedural Geometry for Ogre3D

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
Contact:

Re: Ogre Procedural v0.1 released!

Postby duststorm » Fri Mar 30, 2012 12:49 pm

CSG is definitely not a simple thing to do.
But I think it would really be nice to have a reusable component for doing 3D CSG with Ogre meshes.
Also an interesting thought is that two types of CSG could be useful:
- full and accurate CSG (costly)
- fast inaccurate but good enough CSG (for example for breaking objects with physics libraries)

The second thing already exists by the way: Worm's meshsplitter (viewtopic.php?f=11&t=68189)
It's used in OgrePhysX (viewtopic.php?f=5&t=54763)
0 x
Developer @ MakeHuman.org

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Fri Mar 30, 2012 1:52 pm

Mikachu wrote:
zarfius wrote:It does take a long time and a lot of careful testing. The basic idea to to cut each polygon by the "planes" of any intersecting polygons and then remove any polygons on the inside of the solid shape.

Yeah, that's the method I used for 2D CSG, and that I intended to use for 3D CSG too (seg-seg instead of tri-tri intersections, but it's the same idea..)
So I'm not the only one to have had this idea :)
zarfius wrote:It does take a long time and a lot of careful testing.

Even if 2D CSG is probably easier, it was still a big pain to test every possible case, so I guess you're right ;)


What is the difference between 2D CSG and 3D CSG ? I understand 3D CSG is the one describe on the wikipedia page, but in this case what does 2D CSG look like, can you give me an example ?
0 x

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Fri Mar 30, 2012 1:58 pm

jokoon wrote:What is the difference between 2D CSG and 3D CSG ? I understand 3D CSG is the one describe on the wikipedia page, but in this case what does 2D CSG look like, can you give me an example ?

Here it is...
0 x
OgreProcedural - Procedural Geometry for Ogre3D

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Fri Mar 30, 2012 8:32 pm

discovering the manual... for the first time :shock:

thanks !
0 x

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
Contact:

Re: Ogre Procedural v0.1 released!

Postby duststorm » Sat Mar 31, 2012 11:53 am

Indeed, I also discovered the manual thanks to that link.
I must say, great job! You don't see that many projects this small and young that have good documentation.
Often one can be glad if there is a good API documentation, you guys already have a manual.
0 x
Developer @ MakeHuman.org

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Sat Mar 31, 2012 9:50 pm

I'm struggling with one problem, and I don't know if I can solve it with this lib.

I know I can now generate a wall with "windows" if I make a shape, but is it possible to make one submesh when I'm done making my geometry ? Procedural is very cool, but if I want to make one huge building with a lot of windows, it's going to be a lot of submeshes and thus a lot of batches, and maybe some performance drop. Is there already some function to attach pieces of geometry, or is it a function I should do myself ?

This also applies if I make several different pieces, for example a house, I'd need 4 walls with their window entrances, one roof, then add wall inside, and then merge everything into one packed submesh if possible.

I know it's a lot to ask, but I did not dive into the code, and I wonder if it's doable or if it's a huge waste of time and if it's doable where should I start ?

PS: just trying to generate something which can compare with this, in less ambitious: http://www.youtube.com/watch?v=9unXHC0WTR0
0 x

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Sun Apr 01, 2012 12:05 am

jokoon wrote:discovering the manual... for the first time

thanks !

duststorm wrote:Indeed, I also discovered the manual thanks to that link.
I must say, great job! You don't see that many projects this small and young that have good documentation.
Often one can be glad if there is a good API documentation, you guys already have a manual.

Thanks ;)
Actually, I was planning to announce this manual when 0.2 is officially released.. but glad you like it :)
jokoon wrote:Is there already some function to attach pieces of geometry, or is it a function I should do myself ?

That is quite easy, actually (I assume you mean packing as in static geometry, not 3D CSG...)
Instead of calling realizeMesh() from one generator, you can call addToTriangleBuffer() for each generator.
Then, when your TriangleBuffer is ready, transformToMesh() will create an Ogre Mesh :)
0 x
OgreProcedural - Procedural Geometry for Ogre3D

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Mon Apr 02, 2012 4:13 pm

I see you can load a spline from a SVG file, did somebody already coded something so it loads a shape ? Or maybe is it simpler than I think it is ?
EDIT: hum I can't find this function in the ogre-procedural repo, but google finds it, I'm confused...

Code: Select all

int CubicHermiteSpline2::loadFromSVG(Ogre::String filename, Ogre::String shapeName, bool moveToCenter, Ogre::String group)
0 x

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Mon Apr 02, 2012 4:26 pm

That's because loading from SVG, as well as XML format, are only available on the 'serializer' branch.
Soon after 0.2 release, I'll have a closer look at that, and merge what needs to be merged to default branch.
0 x
OgreProcedural - Procedural Geometry for Ogre3D

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
Contact:

Re: Ogre Procedural v0.1 released!

Postby duststorm » Mon Apr 02, 2012 7:48 pm

Mikachu wrote:That is quite easy, actually (I assume you mean packing as in static geometry, not 3D CSG...)
Instead of calling realizeMesh() from one generator, you can call addToTriangleBuffer() for each generator.
Then, when your TriangleBuffer is ready, transformToMesh() will create an Ogre Mesh :)

That's a good part for adding to the manual ;)
0 x
Developer @ MakeHuman.org

Mawen
Halfling
Posts: 54
Joined: Wed Jun 04, 2003 7:34 pm
Location: Calgary, Canada
Contact:

Re: Ogre Procedural v0.1 released!

Postby Mawen » Sat Apr 07, 2012 2:49 pm

Any word on a possible C# (Mogre) port/wrapper?
0 x
(aka Meharin) Mogre (1.7.1) .NET 4, GUI: WPF (see https://bitbucket.org/JaredThirsk/mogreinwpf), Net: Lidgren+custom RPC+MessagePack, Sound: MOgreFreeSL, Physics: BulletSharp, with MeshStrider and partially working DebugDraw [and soon Input: MOIS]

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural v0.1 released!

Postby Mikachu » Sat Apr 07, 2012 10:05 pm

duststorm wrote:That's a good part for adding to the manual

Looks like adding documentation to a project is a never ending task ;)
I'll write an introduction to these classes (TriangleBuffer, MeshGenerator...)
Mawen wrote:Any word on a possible C# (Mogre) port/wrapper?

By wrapper, do you mean a C wrapper (to make dll with standard ABI) ? I may consider it later... (though if you need it soon, you may as well wrap the calls by yourself, it shouldn't be too hard)

If more than C interface is needed, I have no experience with C#/Mogre, so any contribution in that field would be welcome :)
0 x
OgreProcedural - Procedural Geometry for Ogre3D

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural v0.1 released!

Postby jokoon » Sat Apr 07, 2012 10:23 pm

Mikachu wrote:Looks like adding documentation to a project is a never ending task ;)
I'll write an introduction to these classes (TriangleBuffer, MeshGenerator...)


Oh yes please ! If you don't have much time, write about most important classes, or maybe add some comments there and there...
I know there are some theory stuff which can be read on wikipedia, like delaunay's.

For example I'm still wondering how you can manage to create a single batch procedurally even when calling several addToTriangleBuffer()... Procedural is cool, but I wonder if it's possible to spam procedures like a dummy and still get single batches for good draw times; by the way I'm not expecting 3D CSG anymore, but it would be really awesome... too good to be true :cry:

I peeked and saw you work for some architecture or city software, have you already planned how to make buildings, houses out of shapegenerators ?
0 x

User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France

Re: Ogre Procedural [v0.2 officially out]

Postby Mikachu » Thu May 03, 2012 10:09 am

After more than one year since the 0.1 release, I’m proud to announce that OgreProcedural 0.2 is now officially out! :D
I know most of you were already playing on the 0.2 branch of the repo, so it’s not very new news ;)

Anyway, the binary SDKs are available on the project page.
They are built against the 1.8 branch of Ogre, and may or may not work with 1.7.x (if you're looking for an Ogre 1.8 binary SDK, look here)

Here are some of the main new features :
- Extrusion, Lathe
- Triangulation of 2D shapes
- 1D, 2D, and 3D splines with associated operations (for example, CSG applied to shapes)

Image

Some samples of the new features, along with a few explanation are in the brand new user manual.

So, what has taken so long?
Well, first, some features, such as triangulation, were quite hard to implement, and each time I thought the algorithm was right, I found a new case were everything was broken.
I also worked on a few things that are not immediately related to procedural geometry : CMake scripts and continuous integration, user manual generation, visual unit tests...

Overall, I’m not very satisfied about the time gap the 2 releases, I’ll try to do more frequent revisions in the future.
And for those who can’t wait, you can always get a nightly build here, or simply build yourself from the repository :P

What's next?
I keep a non-exhaustive list of features I'd like to implement.
The ones I will concentrate on for 0.3 are, among other things, about tooling : I've already started defining a file format (partially inspired by tdev's work), and once it's stable enough, I'll try creating an Ogitor plugin to help writing and previewing procedural scripts.

Also, don't hesitate to submit new ideas or suggestions! :D
0 x
OgreProcedural - Procedural Geometry for Ogre3D

jokoon
Goblin
Posts: 203
Joined: Sun Aug 23, 2009 8:30 am

Re: Ogre Procedural [v0.2 officially out]

Postby jokoon » Thu May 03, 2012 10:26 am

Did you add any samples to show what has been added ?
0 x


Return to “Showcase”

Who is online

Users browsing this forum: No registered users and 6 guests