DFF mesh format loader

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

That's some great stuff loki1985. Is that Starfish Island in the Vice City shot?
TheQuestion = 2B || !2B
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

Halifax wrote:That's some great stuff loki1985. Is that Starfish Island in the Vice City shot?
thanks.

for me it looks more like Prawn Island, i think the buildings on the top right are from the film studio.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

loki1985 wrote:today i revisited the moomapper source code searching for the bug which caused GTAVC and GTASA DFF meshes to not display properly. i found that most of these newer DFFs use triangle strips instead of triangle lists. now i added support for that, and voilá, VC and SA are displayed correctly.
Great stuff!

I'm hoping to get some time to actually look at this myself over the holidays...
Carama
Posts: 10
Joined: Sun Dec 14, 2008 12:44 pm

Post by Carama »

Today, i thought about a gta dff loader and wanted start to code ... but there is allready one :D.

Can i load the car models?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

loki1985 wrote:for me it looks more like Prawn Island, i think the buildings on the top right are from the film studio.
Ah! Yes you are very right. I was going to say, the mansion, and the island, looked a little small to me.
TheQuestion = 2B || !2B
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

Carama wrote:Today, i thought about a gta dff loader and wanted start to code ... but there is allready one :D.

Can i load the car models?
i don't know, did not try yet (only tried environment models).

if it works, currently no frames are implemented, and i think the damaged models are frames inside the DFF. maybe, if i find some time in the future, i will add support for frames.
Carama
Posts: 10
Joined: Sun Dec 14, 2008 12:44 pm

Post by Carama »

i tried to load cars but it don't work :(
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

Carama wrote:i tried to load cars but it don't work :(
currently, DFF files with frames are not supported. since the individual (moving or parametrised) parts of the vehicles are stored as frames, vehicles are not supported at the moment.
Mania-92
Posts: 16
Joined: Sat May 19, 2007 2:21 pm

Post by Mania-92 »

Very, very, nice! Have you got any updates since your last post?

Well I love this, saves a lot of time converting everything from dff to something else.
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

well, i don't have much time for it at the moment. i was thinking about adding frames support, but then abandoned that idea because of the efforts involved.

some days ago i ported my code to irrlicht 1.6-svn, which will allow me to write an IMG loader, so loading files directly from the games archives should be possible.

then maybe, just maybe, i will write a model-streaming (or rather model manager) class proof of concept, to see if that can improve render speed and quality.

when that works, i plan to release the complete viewer application to the community, because i think then i will not invest much more time into this project. my main intention always was to have a nice GTA world renderer in irrlicht, and while it would be technically possible to have support for cars (frames) and NPCs (skeletal animations), the effort required is pretty high...
Mania-92
Posts: 16
Joined: Sat May 19, 2007 2:21 pm

Post by Mania-92 »

loki1985 wrote:well, i don't have much time for it at the moment. i was thinking about adding frames support, but then abandoned that idea because of the efforts involved.

some days ago i ported my code to irrlicht 1.6-svn, which will allow me to write an IMG loader, so loading files directly from the games archives should be possible.

then maybe, just maybe, i will write a model-streaming (or rather model manager) class proof of concept, to see if that can improve render speed and quality.

when that works, i plan to release the complete viewer application to the community, because i think then i will not invest much more time into this project. my main intention always was to have a nice GTA world renderer in irrlicht, and while it would be technically possible to have support for cars (frames) and NPCs (skeletal animations), the effort required is pretty high...
Ah ok, thanx..

But anyway does have anyone got all the textures in the PNG format? Converting them TXD's to PNG will take me all day..
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

sorry, i cannot send them to you since they are copyrighted material.
but converting doesn't take so long, took me about 10 minutes.
Mania-92
Posts: 16
Joined: Sat May 19, 2007 2:21 pm

Post by Mania-92 »

Converting them all took you 10 minutes? How did you do that?
The only way I know is to open every TXD in TXD workshop en export them to PNG, and with around 1300 TXD files that'll take me a atleat a few hours full-time converting.
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

convert TXDs to TGAs:

Code: Select all

@echo off
for %%a in (*.txd) do C:\txdworkshop\txdworkshop.exe /extract %%a
- copy code to BAT/CMD file.
- run BAT/CMD in directory with TXD files.
- requires TXDWorkshop 3.1 or later
- change path to txdworkshop.exe to your needs
- problem: creates directories in the root of the drive where the .TXD resides. that means if your TXDs are somewhere on drive C you will get hundreds of new folders in there. undesirable. i think this is a bug in TXDWorkshop as a workaround, create a big enough ramdrive or other means of writable drive emulation (i successfully used a truecrypt volume, as i am a lazy bastard).
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

also, here are 2 batch files to convert all these TGA files to JPG:

tgatojpg.bat:

Code: Select all

cd %1
echo %1
C:\Programme\IrfanView\i_view32.exe *.tga /silent /convert=*.jpg
del *.tga
cd..
tgatojpgrecursive.bat

Code: Select all

@echo off
for /d %%a in (*) do call tgatojpg.bat %%a
- requires Irfanview
- change path to i_view32.exe to your needs
- create the 2 batch files above, copy first one to somewhere in your path (e.g. C:\Windows, dirty but it works)
- copy second batch file to folder containing texture subdirectories (the several hundred folders named like the original TXD files) and run it.
- be patient
- be aware that JPG supports no transparency etc...
Post Reply