Kineme 3D

Scratchpole's picture

Well I guess here is the place to ask. What's the crack with .obj files in your loader? Is there a vertex limit?

I read there are issues with .obj, what are they? other than slow loading. Some of my (smaller) models work others cause crashes.

From my regular use of the .obj loader in Edo I ascertained that (Pauli Ojala) the programmer opted to create the VN's within the loader/edo, loading models with VN's may be what slows it down.

I have attached a model which works with the other .obj loader, but no joy with yours. (Ahhh I converted it to an FBX and it worked. Yippeee.) Look forward to days of fun working with these new tools. Thanks. Jx

PreviewAttachmentSize
hairball23VN.obj_.zip5.39 MB

cwright's picture
objs

There aren't any vertex limits, but, as you say, the obj loader is terribly slow -- I'm using Autodesk's obj loader, because it's simpler than writing my own. Loading vertices and VN's are trivial (it's a really simple format, conceptually -- however, it supports polygons with an arbitrary number of sides, which then requires me to write a polygon convex tester (to fan-split convex n-gons), and a polygon ear-clipper (to triangluate concave polygons) which is a lot of additional code that I'd rather not write/bug test right now.

That said, the current loader shouldn't crash (though it can stall the app for minutes at a time), so please supply all the obj's you have that crash it (so I can find out what the problem is, and fix it). Checking out the model you provided.

cwright's picture
model

The above model loads fine for me (though it takes a long time) -- 250,000 faces/750,000 normals/texture coordinates is a bit stressful with the current engine.

(Perhaps supply an fbx of the same thing, and I'll test smoothing/simplifying, to see if it's triggering a bug in one of those parts....)

Scratchpole's picture
obj crash

Well I have attached a model that has no vn's and it crashes qtz. I exported another version with vn's and it loads.

Did u have any joy with the previous model?

p.s. this was the first model I ever built please excuse my terrible modeling skills.

PreviewAttachmentSize
aaarrow.obj_.zip38.17 KB

Scratchpole's picture
Oh right, maybe I just need

Oh right, maybe I just need to wait loooooonnnnger. Thing is though it's fine and pretty quick with the other obj loader.

cwright's picture
yeah :(

yeah, it shouldn't take as long as it does -- I can't do much about it (other than writing an obj loader myself, which I don't really feel like doing -- obj's ancient, and there are plenty of tools to update them some something like fbx for free).

cwright's picture
fbx bug :(

This file triggers a bug in the fbx sdk -- it's looking for a field that doesn't exist, and crashes (lame). I don't have the source to the FBX SDK, so I can't fix this.

The previous model (hairball) worked, though it was very complex and slow to render on my macbook (gma950 = sucks). Not sure how long it took to finish loading -- I watched some of a movie before checking back to see if it finished.

[note that I've reported the bug here: http://area.autodesk.com/index.php/forums/viewthread/20358/ ]

gtoledo3's picture
Things like Wings 3D and

Things like Wings 3D and other converters = my friend.

The thing to consider about other object loaders is the libraries they use (which may or may not have been "ripped" from somewhere, or aren't for commercial use, etc.,) and that Kineme3D also has to setup the file to work with all of the other tools, etc... I have no idea about the nuts and bolts of it for others, but converting files hasn't been a big deal for me.

For "me" the example of gravity warp with an entire object has been a BIG deal with this latest release. I was using things like the twister and bend box, and hadn't considered piping a whole object through the warp. It is almost like a sculpt tool in Blender, especially if you just "lock" coordinates, and chain multiples...

I have one object loader for example, that is on the web, that loads some things pretty quick, but you can't even use it with a GLSL shader :o(

gtoledo3's picture
Would you say that, in

Would you say that, in general, you think that fbx is an optimized format for the Kineme3D or are there no real "rules of thumb" at this point?

cwright's picture
guts and glory

Basically, kineme3d works like this (internally):

We have our own loaders (a crappy obj loader I wrote that's disabled, a non-commercial 3ds loader that's disabled (works with some models, not with others)), Autodesk's FBX SDK loader (which loads FBX, DAE, DXF, OBJ, and 3DS, all from the same piece of code), and the MD2 Loader that I wrote. I'll divide the rest into Theory and Practice parts:

Theory:

The MD2 Loader is fine.

Practice:

The MD2 Loader is fine (there's a nasty bug you recently found, fixed for rc2.1).

Theory:

The FBX SDK is rather complicated: We (kineme) don't handle the formats it support directly, we let autodesk code handle it all. All the formats it supports should be equally well supported.

Practice:

The FBX SDK has some annoying caveats:

  • 3ds with certain materials don't work, bug reported by me (fix scheduled for spring 2009)
  • obj takes for ever to load, bug reported years ago, no one seems to care
  • certain objs crash the SDK, reported by me a little bit ago
  • certain DAE's also trigger failures in it, reported by others a while ago, being worked on by autodesk)

Analysis: DXF, FBX, and MD2 have a clean track record (either there aren't any problems, or the problems that exist can be fixed by us.) DAE, OBJ, and 3DS have problems, and can't be fixed by us (without writing a loader ourselves, which is a huge time investment that we're not willing to make this close to release).

Conclusion: FBX is probably the best, full-featured format supported without problems. DXF is next, MD2 after that (MD2 is a very limited format, but it's handled quickly and efficiently). 3DS, if it doesn't fail, is essentially as full-featured as fbx (for what we're doing currently -- once animation is introduced, 3ds will likely go extinct).

In the spring (FBX SDK update), 3DS bugs will likely be fixed, and the obj crash will probably be fixed. obj load speed probably won't. I don't feel like ever writing a loader for that format, so that's probably where it will stay unless someone feel like it's easier the throw dollars at us to write a new obj loader than it is to download wings3d or blender or whatever, and convert their objs into smaller, faster, more well-supported formats (fbx, most likely, possibly 3ds, though I wouldn't recommend it).

gtoledo3's picture
I have to say, I am

I have to say, I am surprised that you say the obj loader that you had written that was disabled was crappy... I don't remember having any problems with it, if it was what was in previous versions. The old 3ds loader was hit or miss as you say and non-commercial, so it is even steven as far as all that goes between new vs old.

Oooohhhh, spring 2009. Well. I guess that will probably come before we know it actually. Even though now it seems like forever.

So, I guess I'll lean on working with fbx...

gtoledo3's picture
I am replying to myself

I am replying to myself but... and I am SURE a websearch will answer this, but know of any good tools for making md2's from scratch? I actually think this is a pretty nifty format....

....

a little hot and sticky md2 action...

As we discussed via email... this background is based in the panoramic image to front culled sphere example. I want to throw this concept out there for others. I seriously think that someone could probably make a modest living going around and doing a CD ROM of photos from around the world, setup like this. It is "wicked" simple, and blows many people's minds when I show it to them, even if it is pretty elementary. Using it as a backdrop is something that just recently came to mind...

In this case, I think it is a good way to set up some scenes in QC without having to have QC "crunch" the numbers for a ton of background objects or something like that. From some elementary tests, I can also see that you can fly these kind of photos into an editor, make "frames" with the picture content edited, and then fly them onto the sphere with a picture loader setup... so that you now have achieved an "animated" background. That is a little more taxing, but can still be achieved with decent frame rates. I would love to have an actual "movie" file that "looks" like the panorama's do, to use THAT to map onto the sphere.

Oh, and a domestic monster squabble using some different models, similar setup... and GL logic op blending for some weird otherworldliness...

Those last two use and abuse standard 3d transforms and the kineme GL Field of View patch... which has overtaken ortho as my favorite of the viewpoint mod patches.

And what is my most over-used technique at this point... taking objects and deforming them using elementary GLSL vertex deformation....

From skeleton to diamond...

The translucency is more GL Logic Op... which is a friggin cool patch. I have to say that it is so simple in theory, but at this point it is probably my favorite non-standard QC patch hands down, save for Kineme3D.

cwright's picture
obj

the crappy obj loader was only available around december 2007 -- you probably never touched it (it was Really bad, trust me :) I spent like 5 minutes writing it, and it only handled triangular meshes, etc.) The one current one is the same one from autodesk since early 2008 -- I don't think it's changed at all (still takes forever, but otherwise works as expected, except for the aaarow.obj file crashing it)

cwright's picture
md2 from scratch

You might find some old Quake2 utilities that allow you to make md2 models -- otherwise, it's such an old old old format (it was popular when I was in high school.... holy crap, I'm old) that most new tools skip it because of its limitations (normals suck, polygon counts are very limited). A similar slightly newer format is md3, which has less sucky (but still not perfect) normals and polygon limits -- some tools might still support that, but I'm not sure.

anyway -- fbx is the way to go, as far as I can see -- it supports multiple objects (for current keyframing), actual keyframing (not yet supported, but probably could easily in the future), and skeletal animation (holy grail of animation -- not sure how to make it work in a QC-paradigm though yet...)

Scratchpole's picture
Do you fancy sharing that skeletal diamond bling?

Been trying to replicate your skeletal bling to no avail would you mind sharing your qtz gtoledo?

gtoledo3's picture
HMMMMMMMMMM. hmmmmmmmmmmmmmm

HMMMMMMMMMM.

hmmmmmmmmmmmmmmmmmmmmmmmmmmm.

I've been working on that one for an actual video, so I am hemming and hawing a little bit :o)

I'm on the "road" right now and it doesn't seem to be on my laptop, but when I am by that hard-drive (later tonight or tomorrow) I'll post an example up.

gtoledo3's picture
But, if you can't wait that

But, if you can't wait that long...

Take any 3d figures, whatever, and put them inside of a Sphere Morph GLSL.... there is an example in the Developer files. Slow down the period...

Then take that, and put it inside a GL Logic Op, and start scrolling through the different settings.

I will definitely post a .qtz though....

Scratchpole's picture
Nah couldn't wait.

Thanks for the instructions. Find my version attached, get a decent 60fps with that hairball.fbx Now how to morph into another model????

PreviewAttachmentSize
ObjWarpGT.qtz4.73 KB

gtoledo3's picture
Cool. I will check that out!

Cool. I will check that out! I am really happy about that "technique" in general, and it is always cool to stumble upon something...

Also try a torus morph... I think that it isn't too crazy to use a shader to morph something into many different types of geometric shapes, but I think using it to morph to a full on "object" is definitely difficult... but possible in some cases if the shader code is correct and the desired shape basic enough!

As far as morphing one actual "3d file" into another...hmmm, I haven't messed with the object blend renderer too much, but I wonder if that can do something like that?

That quantize example with the head that Chris put in this last update looks really interesting with some of the GL Logic Op stuff.

cwright's picture
credits

The head model is from François Wunschel (franz, on this site) of exyzt (http://exyzt.net).

The blender currently is limited to blending objects with the same number of vertices/faces. Still looking for/thinking about a good fast algorithm for handling the more common case of different numbers of vertices/faces...

gtoledo3's picture
I keep looking at different

I keep looking at different files I have named skeleton blah blah blah, and none of them are the correct file... I have to look through my email now, because I seem to remember sending Chris something at some point.

Here is an example... and I am lame and STILL haven't looked at your interpretation of my description... going to check it out in a second :o) (edit:looked at it and it's right on).

I left the shader in non-repeat, so once it turns into a ball it is going to stay like that. I published the repeat mode and the file input though....

PreviewAttachmentSize
PRISM.zip5.86 MB

gtoledo3's picture
Yup, you hit the nail on the

Yup, you hit the nail on the head with your interpretation Scratchpole/Catchpole, glad to see that my description got you there.... nice qtz if I do say so myself :o)

Another note though, is to play around with the start and end values of the shader... you can use a throw of something like 0 - 0.2 and get subtle warp. You can also attach an lfo or interpolation to either the start value or the end (or both I guess) to get some effects that are less obviously "spherical".

The torus shader, or any other shader that deforms vertices can be used like this as well.

Trying out different blend modes, and different colors on the clears can be cool, and you can probably add in clears at various layers to get some different looks. You can also add more lighting sources for some twists.

Oh... and thanks to toneburst, vade, and memo for posting the original examples that started intriguing me about GLSL shading in general. There is a deforming shader that Vade posted somewhere in particular that tipped me off to deforming shaders and what led me to start looking at the Orange Book, and the Apple examples.

muqeem's picture
Re: obj

new to kenime 3D, please.

When I import obj model, I do not see the textures. Do I have to do something.

thanks Muqeem

cwright's picture
Re: obj

You have to load the textures separately (i.e. drag/drop the images into the editor manually) -- Kineme3D does not load textures automatically.

usefuldesign.au's picture
Re: md2 from scratch

Dude when I was at high school we had an Apple ][ and and Digital PDP-8, by uni we got a Mac II first colour Mac, with Doom just around the corner and Quake not even a twinkle in it's eye. Enjoy your youth!