Registriert: Mi Aug 28, 2002 19:27 Beiträge: 568 Wohnort: Chemnitz / Sachsen
hello, i tried to load a 3ds with some parts beeing transparent. but if i used this my whole textures got the same as the texture of the transparent material. (the 3ds file had only one material, the transparent one) ;-(
Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
Noeska, do you still work on the loader? If yes, I have some suggestions for it that I already implemented (my loader is heavily modified) and that maybe usefull :
Share texture IDs between materials that use the same texture This may sound like something that wouldn't be usefull, but it is when you're composing scenes out of other meshes, like I do for the levels in my current game. Let's say you have material A in your scene that uses texture "test.jpg". And you build your level objects ('cause you also want to use them in other levels) not directly in the same 3DS level, but in a separate file. And now that object would also use "test.jpg". So you then at some point put that object in your level and voilá : you have two materials that use the same texture (test.jpg), but they are two "different" materials, so your loader loads this test.jpg two times. In my current level (that's normal when you share textures amongst many separate objects), there are textures that get loaded half a dozen time. That does not only take longer, but also wastes much memory. So when updating the texture maps for your materials, before loading the texture you iterate through all materials that have been loaded before, and if one of those has the same filename as the current one, you don't load that texture anymore and just assign the texture ID. Just to give you some numbers from my current project (taken from the Taskmanager) : My current game without that optimization takes up ~50 MBytes, with it it's only ~42 MBytes. But as that map is just a small tutorial map, that optimization may really come in handy.
Make Vertices- and Indexlist public This is needed when you for example want to use something like the newton physics engine and want to build convex collision hulls from 3DS meshes. In this case, you must tell newton the vertex- and indexlist of the mesh you want to create the convex collision hull from. But to overgive them as pointers, you need direct access to those arrays (in your last version, they're private).
Add an assign function to meshes and/or materials Especially for meshes, it can often be usefull to just copy one mesh to another (at least when using physics, cause you then must for example manage the chassis and the tires of a wheel by yourself). It's not much work to implement.
Those are some of the things I've added to your loader and they are very handy. I'd make my one public, but I've made some heavy modifications and even took out some stuff of the original header (like bump-map stuff, switched back to textures.pas, etc.), so it would only make people confused.
Hope those suggestions sound logic and usefull to you.
Registriert: Do Sep 25, 2003 15:56 Beiträge: 7810 Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Ich möchte hier nochwas zu Texturen/Materialien loswerden. Es könnte für den ein oder anderen Nützlich sein. Es betrifft aber vermutlich nur die ältere Version des Loaders (die welche die Textures.pas als Textureloader verwendete).
Wenn ihr, wie es Sascha in seinen 3DS-Tutorials auf der Seite mal angemerkt hat, die Textur eures Models austauschen wollt, damit es anders aussieht müsst ihr auf folgendes achten:
Ein einfaches austauschen der TextureID der betreffenden Materialien funktioniert nicht in jedem Fall. Wenn die Neue Textur mit einem anderen Texturloader, wie z.B. Losseys glBitmap, geladen wurde, müsst ihr die Textur noch spiegeln. Praktischerweise hat Lossey bereits in seinem Loader die Nötige Funktion eingebaut. Ein einfacher aufruf von FlipHorizontal lößt das Problem.
Da in der neueren Version des gl3DS eh Losseys Loader verwendet wird, sollte dieses Problem nicht auftauchen.
Nur so als Info. (Ich hab ne weile gebraucht bis es bei mir durchgerieselt ist. Bei meinem Model war es nämlich nicht so einfach zu erkennen was schief gelaufen ist. )
_________________ Blog: kevin-fleischer.de und fbaingermany.com
Hi, I've got a problem with bumpmapped 3ds example. When I start the application, it shows an error: cannot access to memory ... . Does anybody know, what's the problem? Thanks for answer.
Hi. I've beein using the gl3DS one for a while now, it's definitely the best option out there at the moment, and the new release is better. If it's helpful, your 3DS support is better than the 3D Studio MAX 7's support, yours will read in models correctly where theirs doesn't (and I checked the mesh list, MAX 7 isn't importing some of the meshes correctly)
A couple of things. I don't use glBitmap, as I have a custom texture manager, so I usually wrap the texture calls into virtual calls as part of the main class and then inherit it to a specific non-glBitmap based texture map
Secondly, I still get errors with transparent models still, in the latest version (downloaded december 2005). Here's the original model from MAX:
To bypass it, I've temporarily disabled the transparency sorting function, as that's the one causing the error.
Also, there is a performance issue. For every single face, there's a glBegin and a glEnd. In one or two small (~4000 faces) this is Ok, but in larger models, around 40,000 to 100,000 faces, the performance is terrible compared to alternative solutions. If faces were sorted (i.e. placed into bins) based on their material, then this will do two things:
eliminate the transparency problem, because by binning it into materials, it then becomes easy to render the transparent materials last, and this also cuts down on the vast number of material changes, begin and end functions etc.. that goes on, particularly in the situation of large models, or large quantities of small models. This does however still have the depth problem of foreground transparent faces obscuring ones further away, but, one thing at a time!
The performance improvement is astounding. A model that prior to this generated a 13fps output (on a Geforce 6600, AMD 3500+), suddenly jumps to 75fps!
There also seems to be one additional problem and that is of Smoothing Groups, which bends the normals to match the smoothing group, making for output closer to that of 3D Studio's own rendering. I've got hold of some reference code for this, which greatly improves the image quality, but I haven't fully worked out how to integrate that into my copy of gl3DS.
There's additional stuff regarding triangle strips and so on that can then boost this, but that's a bit more than I can chew on for the moment, and that's of more benefit to models in the 200,000 polygon range.
Registriert: Di Jul 01, 2003 18:59 Beiträge: 887 Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Just to let you know i am still working on gl3ds.
Currently i am rewriting it to be be more 'modular' E.g. There now is a tmodel class works like timage. So in the futere more 3d object formats could be easily added in.
Render is now handled in inherited classes so (in theory) it is now easier to render models in other ways so it is drawn more efficiently.
Also maintenance will be easier as all code parts are seperated instead of having all in one large file.
The thing i am trying to improve is that some models still refuse to load properly like a car model that refuses to load properly. (Luckily) other commercial applications also have lots of problems with that model. But i have a feeling that most models are rendered correctly with the latest complete example for 3ds i released (way back). That is the main reason i did not release newer versions of yet.
Also i am stil working on getting a 3ds mesh to play its animations. But the results are to experimental to be published.
For getting animation into gl3ds i could use some help from people wo can read french! On the following thread there is a lively discussion on getting animation from 3ds models: http://forum.games-creators.org/showthread.php?t=3421 . I do not read french, but it seems to me that even skeleton animation would be possible from an 3ds file (WOW). But as i cannot read french .
gl3ds already knows bone animation for milkshape animations so if i know what to read from the 3ds file it should be doable.
For milkhsape ascii a bone and animation save is in the pipeline, but for that i first need to finish the rewrite of gl3ds.
So when the new version is ready it should allow to make a 3D file converter from it or even something like milkhsape can be made with it.
But i feel it should be renamed from gl3ds to ????, let me know. And those wo read French do give me translations!
Mitglieder in diesem Forum: 0 Mitglieder und 6 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.