Please break this!

Blitz3D Forums/Blitz3D Programming/Please break this!

fredborg(Posted 2003) [#1]
Newest version here: ImportTest.zip ~650Kb Imports 3DS and ASE files. Minor bugs should be fixed soon...

Hi,

I'm working on a proper 3DS importer* ("how stupid", you might think, but that's me ;) And I think I've got all the chunks, bits and bytes supported that I want to have. But before I go on, I would like you to test if you can break it!

Basically what this is, is a dumping test, it loads a 3DS file, and spits the info out in a text file. Simply drag a 3DS file onto the program icon, and watch the fun. A log file called: a3DS_***_log.txt will be created in the same folder as the 3DS file.

- Download removed -

Anyone, who can break it, will get the full import code once it's done! Oh, and it only breaks if the program actually halts, Unknown Chunks are OK, but some might break the code, those are the buggers I'm after...

* Not that the importer in Blitz isnt't OK, but it doesn't support advanced material settings, smoothing groups, lights, cameras, etc.

PS: If you do get any Unknown Chunk reports, please post the numbers here (just copy it from the text file), and I'll see if I can figure out what the chunks are...

Fredborg


Beaker(Posted 2003) [#2]
That sounds like a good idea.


Skitchy(Posted 2003) [#3]
PLEEEASE release the source when it's done.
Go on.

Even if nobody breaks it.
:)


fredborg(Posted 2003) [#4]
Break it, then we'll talk :)

Fredborg


fredborg(Posted 2003) [#5]

The importer should now work almost 100% perfectly. As can be seen from the screenshot (hopefully), it will load smoothing groups, advanced material settings, lights, cameras (although they are disabled), pivots/dummies, and a few other things. Getting smoothing groups to be reconstructed at a reasonable speed was pretty tricky, but once I got it working, it turned out to be the simplest solution :)

The following material settings are loaded:
- Diffuse color
- Shininess
- Diffuse Texture
- Opacity Texture (only if it is the same as the diffuse map)
- Self Illumination Texture (handled a little differently than in 3DS max)
- Reflection Texture (loaded as a spherical reflection map)

A few objects might be rotated wrongly, but I'm looking into that at the moment. Ambient light, and fogging is not loaded.

You can download a demonstration viewer here - Download removed -
The rule is still if you can break it for real, you earn the source code, if you can't then keep trying!

PS: Gotta love Blitz :)

See you,
Fredborg


fredborg(Posted 2003) [#6]
Updated, download above! Thanks to MarkT and Peter Scheutz for breaking it :)

MarkT, make your claim! Even though it actually was an incorrect chunk in the file causing the lock up :)

Fredborg


fredborg(Posted 2003) [#7]
Minor update: Texture tiling, Texture offset, Texture W Angle, should now function properly. Unfortunately the 3DS file format doesn't support texture cropping. Download above...

Fredborg


MarkT(Posted 2003) [#8]
*bows* Thank you *bows*

you can email me at themark_99@..., my current email server is down so thats the only one i can be contacted at. Just email me with a link to claim my prize ;)


DH(Posted 2003) [#9]
Actually Fredborg, I was hoping you would release the documentation you have on the 3ds format. I have a few simple doc, and they took forever to find. Last loader I made was very simplistic, but it also included a "SaveMesh()" function. The only draw back to the save mesh was the lack of knowing which texture was applied to a model in blitz (feature request pending :).

Would you be willing to share the 3ds documentation?


fredborg(Posted 2003) [#10]
Hi DH,

Sure thing! I've trawled the net for solid info as well, and it sure seems hard to come by, but the following three places have proved invaluable in my quest :)

Discreet Sparks - Discreets own 3DS file support package can be downloaded from here.
3DS FTK 4 - A copy of Discreet/Kinetix descriptions, that are a bit more thorough.
Lib 3DS - An almost full, but with a few flaws import library.

But don't trust everything in these documents and examples, as far as I can tell they all contain minor errors. Or maybe it's just me :)

Have fun, and don't hesitate to ask for help!
Fredborg


fredborg(Posted 2003) [#11]
MarkT: It's been sent, once again thanks for helping!

Fredborg


fredborg(Posted 2003) [#12]

Updated! ASE import is now working...Hopefully :) Should you wish to test it, you can download it here: - Download Removed - (Imports both 3DS and ASE files)

The ASE import supports the same things as the 3DS importer, and:
- Import of background color
- Import of ambient light
- Vertex Colors
- Multi/Sub object materials
- Spot, Directional, (with targets) and Omni lights
- Perfect smoothing group and texturing reconstruction (maybe)

This time however, there are no prizes for breaking it, but please report any errors you might get.

Fredborg


Dock(Posted 2003) [#13]
Wow, this seems really excellent! The ASE format would be really great for the game projects I'm currently developing, but the whole system seems to work brilliantly. I'm incredibly impressed. Do you intend to release the source at any stage?


Beaker(Posted 2003) [#14]
Excellent. That model is nice looking. How are you blending textures on the ground and tree/rock base?


Skitchy(Posted 2003) [#15]
If you're doing ASE as well then take a look at this :-
http://crow.riot.org/index.rt
Its essentially ASE with skin and bone support so it should be pretty straightforward for you to imlement.

Do I get the source now? ;)

I started an importer but got sidetracked and have turned over development to Drago.
Is this going to be publicly available at all ie. for cash, or are you keeping it in-house? I'd be willing to pay for it.


fredborg(Posted 2003) [#16]
Dock: Thanks for the comments :) No, the source will not be released, at least not anytime soon.

MasterBeaker: Thank you. Here is a small example, including an ASE file :) Check.zip ~8Kb As you can see it's very simple, but it's the easiest way, and it's fast and fun.

Skitchy: I have taken a look at the RTX format, but as you probably know the licensing agreement is rather harsh. Additionally, I do not intend to import animation in any form, at least not for now. No, you don't get the source :) Yes, it will be publicly available sometime in the semi-near future, but as part of a larger package. And yes, it will cost money. So keep your wallet nearby :) Good luck with the importer, ASE is a fairly straight forward format, and should pose no greater problems.

Fredborg


Litobyte(Posted 2003) [#17]
Ooooooooooooh

+does this means that this imports and supports also Smoothing Groups ????


fredborg(Posted 2003) [#18]
Yes, it supports smoothing groups for both ASE and 3DS :)

Fredborg


Skitchy(Posted 2003) [#19]
Part of a larger package you say ....... intriguing.

Care to elaborate on that or is it still top secret?
:)


IPete2(Posted 2003) [#20]
Wow,

Thank you guys, that looks tremendous. Hmm I can't get it to work using the supplied demo file.

I should just drag the .ase file onto the .exe is that correct?

regards,

IPete2.


fredborg(Posted 2003) [#21]
Hi IPete2 (who is IPete1?)

I changed the demo file, which is very boring :) Should work now, try downloading it again. Use the arrow keys, and mouse to move around :)

Sktichy: It's top secret ;)

Fredborg


Binary_Moon(Posted 2003) [#22]
A few questions...

How did you do the blending between textures in the last screen shot? Is it using opacity maps/ vertex alpha/ clever texturing.

Why do you turn off mipmapping? That's something I have noticed in a number of your demos (including the water reflection one) and have never understood why, you have these nice scenes and ruin them with pixely distortion (see the corridor above)

Offtopic but how did you do the wireframe grid in the scene above (I assume thats a blitz screen)? I have managed to make a wireframe grid but it only works either in front or behind objects (using multiple camera renders). I can't get it to intersect objects.

Anyway the scenes look nice and I too am intrigued about what you're making.


fredborg(Posted 2003) [#23]
The texturing is very simple, and not especially clever. But you can see how it's done in the demo file (4 posts below the screenshot). It's simply done by putting a touch of grass at the bottom edge of the other textures.

Ahhh, mipmapping :) Well, I guess it depends on what kind of stuff I do. But sometimes I just like the crispness, of not mipmapping. If you had seen the corridor with mipmapping, you would know why I turned it off. The floor grid, is a total smudge when mipmapping is on. Next time, I promise to use mipmapping :)

The wireframe is pretty easy to do. Make a triangle between two vertices, set the EntityFX to fullbright and no backface culling. Hide everything but the wireframe objects. Render with wireframe on. Show everything except the wireframe objects, set CameraClsMode to not clear color or zbuffer, render again. Repeat.

Here is an example of how to make a square in wireframe:
a = AddVertex(surf, 1,0, 1)
b = AddVertex(surf,-1,0, 1)
c = AddVertex(surf,-1,0,-1)
d = AddVertex(surf, 1,0,-1)
AddTriangle(surf,a,a,b)
AddTriangle(surf,b,b,c)
AddTriangle(surf,c,c,d)
AddTriangle(surf,d,d,a)


And, well, I'm kind of intrigued about what I'm making myself :)

Fredborg


Binary_Moon(Posted 2003) [#24]
"It's simply done by putting a touch of grass at the bottom edge of the other textures." - Oh ok. It's the smoothing groups that makes it look seamless then.

The viewer doesn't work on win2000. I had the same problem with blitzes media viewer. When you drag and drop a file it automatically adds quotes around the name of the file you drop on the app. I am getting the error - Sorry the .ASE" format is not yet supported an extra line to remove all quotes at the start and end of the command line will sort it out.

I already do the wireframe the way you have said. The only thing I wasn't doing was changing the cameraclsmode before each render - I always set it when I created the camera then left it alone. I had tried the zbuffer thing but it always made things dissapear. I now have it working though. Thanks

Edit - I lied it didn't work. I changed the grid to render AFTER the objects and then it worked fine :)

As for mipmapping messing up textures it does happen but I prefer it to the pixel mess you can get with these things. MAybe if you release a game you shoudl add it as an option so people can decide for themselves. The fact you used textures with very small details isn't going to help though :)


fredborg(Posted 2003) [#25]
Ok, it should be fixed now. There is a minor bug with lights and cameras without targets, they are sometimes rotated in the wrong direction, but it should be fairly easy to fix. Also, I turned mipmapping on, so have a go at it Ben :)

ImportTest.zip ~650Kb

Fredborg


Binary_Moon(Posted 2003) [#26]
works fine now.

The mipmapping messes up the transition between the checker board and the cube though... lol :)

Every mesh I have tried it with has worked fine. Something which Quill had problems with.


fredborg(Posted 2003) [#27]
See :) I told you :) Actually it was messed up with mipmapping off, because the textures are so small :) Sounds great (that it's working that is)!

Fredborg


IPete2(Posted 2003) [#28]
Fredborg,

Yeah that works well now, I'm going to have to find something a little more interesting to import though! :)

btw...

IPete2 is my PC Internet handle - I was IPete (IPete1) when on the Internet in the days of the Amiga (1995).

IPete is short for Interactive Pete a nickname given to me by my then bosses. I now work for SmartScreen Digital Media - which is my own company.


Regards,

IPete2


fredborg(Posted 2003) [#29]
Yeah, the demo file isn't the most exciting thing ever conceived :) I saw that waterfall demo you did in Director, sometime when Director 8.5 had just come out. It is pretty sweet :)

Fredborg