Jump to content
The Dark Mod Forums

Improved DDS File Handling


Recommended Posts

I hadn't the time to do this yet. The fix is in SVN now.

 

Appreciated, my map runs a lot better now too, less memory and half the load time :blink::wub: :wub:

You are doing AMAZING work on this tool Greebo, ID should hire you to work on their editor after this is all done, their's sucks balls compared to DarkRadiant.

Hell even going back to Quake 3 editing with the last release of GTKRadiant is such a huge step back from DR that I end up ripping my hair out.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Thanks for the words. :)

 

Realistically though, the work we're doing here is nothing in comparison with the work id is doing on their new "studio" developed for the Rage engine. Have you seen those editor demo videos?

Link to comment
Share on other sites

Thanks for the words. :)

 

Realistically though, the work we're doing here is nothing in comparison with the work id is doing on their new "studio" developed for the Rage engine. Have you seen those editor demo videos?

 

Yeah, but does it run in Linux? :) Still, you are doing awesome work, please keep it up!

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Yeah, but does it run in Linux?

Most probably not. The capability to run in Linux is admittedly one of the strong points of DarkRadiant.

 

I also got the impression (I think I read that on d3world), that John Carmack was somewhat losing interest in developing for the Linux platform. Would be a shame anyhow. (Not that this would be the Large Gaming Market in the first place, it's rather a symbolic gesture, in my opinion.) But still, the tools they're developing look really great, and they're showing at which rate a development studio can produce new stuff.

Link to comment
Share on other sites

I tried the new version under Linux and it compiled fine. But it doesn't work, it segfaults when loading blackhear_manor.map.

 

Watching the loading screen, the primitives finish, and then with the entities it crashes. Sorry, have not further info atm.

 

Loading the map with the old version worked, it took 2 minutes 16 seconds and consumed 1128 Megabytes (since my laptop only has 1Gbyte, it swapped out, hence the very long loading time).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Somebody, report it on the tracker please, I'll look into that sometime.

 

Done:

 

http://bugs.angua.at/view.php?id=1583

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

  • 2 weeks later...

 

Done now a test with the newest version, which now loads Blackheart Manor without crash :)

 

Here are the values:

 

20500 te 20 0 836m 703m 22m S 7 70.2 1:58.41 darkradiant

 

Meaning it uses only 836 Mbyte of memory. It took about 1 minute and 54 seconds to load the map.

 

Compare to:

 

Loading the map with the old version worked, it took 2 minutes 16 seconds and consumed 1128 Megabytes (since my laptop only has 1Gbyte, it swapped out, hence the very long loading time).

 

:wub:

 

The time is not much less than before, because as you can see from the 703 resident memory value above, my system still swapped out 150 Mbyte and this slowed down the loading stage of the entities. With 1.5 Gbyte memory the map would probably load much faster. Anyway, good work!

 

Here is one question that popped into my head: Do the editor textures in JPG format actually help? Because if we already have JPG for most textures, why does the DDS loading make so much difference? Also, since JPG need to be decompressed and then recompressed as DDS with mipmaps, wouldn't they actually slow down things down, despite them being 256x256 instead of 512x512 etc?

 

If we could get rid of the JPG files, we would save a ton of files on SVN and releases, and if that makes actually map loading faster and use less memory, that would be a win all around. Greebo, do you have any insight into this?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Before anyone leaps in and deletes all the .jpgs, keep in mind that modeling programs cannot load .dds files, so modelers are using the editor versions of textures when they model.

Link to comment
Share on other sites

Before anyone leaps in and deletes all the .jpgs, keep in mind that modeling programs cannot load .dds files, so modelers are using the editor versions of textures when they model.

A lot of modelling programs can handle dds files. And if not, why not convert the dds into something else so you can have a larger/sharper image for uv mapping?

Link to comment
Share on other sites

A lot of modelling programs can handle dds files.

 

Lightwave doesn't. The last time I looked for a decent plugin I couldn't find one for my version, though I admittedly did not spend a lot of time looking.

 

I'm not saying this is a reason not to remove the .jpg files, if they serve no other purpose. I just don't want anyone to leap in and do it without talking to the modelers so we can figure something else out.

Link to comment
Share on other sites

Lightwave doesn't. The last time I looked for a decent plugin I couldn't find one for my version, though I admittedly did not spend a lot of time looking.

 

I'm not saying this is a reason not to remove the .jpg files, if they serve no other purpose. I just don't want anyone to leap in and do it without talking to the modelers so we can figure something else out.

 

That's a good point to take into consideration. One thing tho, the JPGs only have 256x256 resolution "to keep space down" and this is very blurry, so modellers probably are better of to use the DDS or even the TGAs? Or does this not matter much for modeling? (you can tell I never done it :P

 

Lightwave:

 

This:

 

http://forums.cgsociety.org/archive/index.php/t-155051.html

 

talks about this containing one, but I can't check:

 

http://www.dstorm.co.jp/english/plugin/object.htm#DirectX2

 

(scroll to top to see list of plugins)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I can see the point about the modeling program - I've been using the stone textures for my models as well, and without JPG editor images, I would have been quite lost. Blender doesn't support DDS files out of the box, as far as I could see.

 

As for the question about JPG vs DDS: yes, DDS editor images would mean faster loading times, as they can be directly pushed to the GL routines without prior decompression.

 

To get a better feeling about what we're talking about an actual benchmark would be very helpful, loading Saint Lucia using JPG vs loading it using DDS editor images.

Link to comment
Share on other sites

To get a better feeling about what we're talking about an actual benchmark would be very helpful, loading Saint Lucia using JPG vs loading it using DDS editor images.

 

It should be possible to do this by cloning the entire darkmod directory, then deleting all .JPG files, then loading the map there versus the original. I can attempt this and post back here, but it might need an hour time to copy the entire folder.

 

Edit: Just to be clear, there are three methods we can try:

 

* current: most editor images are 256x256 JPG files (uses little disk space)

* editor images are 256x256 DDS images (uses very probably more disk space)

* editor images are non-existant, the normal texture (512x512 or 1024x1024) are used directly (uses no additional disk space)

 

Which one needs how much loading time and uses how memory is not yet known.

 

I am attempting the last one as this is easiest to try. The second variant needs a script to convert all JPG to DDS, which I don't have time right now :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Okay, here is the first data:

 

First, there seems to be another memory leak when switching maps. For instance, when you load cath.map right after start, DR uses 404 Mbyte of memory.

 

If you instead load saintlucia.map, DR uses 865 Mbyte of memory. When you then just load cath.map, DR uses 883 megabyte - which is even more than saintlucia and a lot more than 400 Mbyte. Maybe old data from the first map is not cleared away properly?

 

Then I did a test loading SL with the JPG files in place, and without them. It looks like in that case DR refuses to load the diffusemaps in place, and instead just displays "shader not found". Greebo, would it be possible to make DR fall back to the diffusemap instead if the qer_editorimage cannot be found?

 

Here is the data:

 

Saintlucia:

16768 te		20   0  759m 626m  22m S   10 62.5   1:27.19 darkradiant

With:

16992 te		20   0  865m 727m  20m S	3 72.6   1:46.22 darkradiant

 

That means the editor image textures use up about 100 mybte or roughly 1/8 of all the memory. Since we didn't actually use any textures in their place, this is not practical, but it puts up an upper limit on how much memory we can save. And 1/8 isn't much :)

 

I wonder where the rest of the memory goes. There seem quite a few textures with no JPG version yet, so at least that would be a way to improve things.

 

Now to find out how much memory using the DDS in place would need means I need to strip out the qer_editorimage lines from all material files, and thats gonna take a me a while. Stand by :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I used the following monster to remove the qer_editorimage lines in all material files:

 

find materials/ -type f -print0 -name "*.mtr" |xargs -0 perl -p -i.bak -e 's#qer_editorimage.*(models|darkmod).
*##'

 

The result is inconclusive, however. Memory consumption is still 759 Mbytes, however, all the textures where DDS files are used are now appearing white, very probably because my laptops shitty graphic can't render DDS files. I don't know what the memory consumption would be if my laptop could render DDS.

 

Anyway, that alone is a reason to not get rid of the JPG files, because my laptop is the only machine where DR still works (it no longer compiles on my 64bit PC for several months :(

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Hm,

 

instead of getting rid of the JPGs I think it would also be possible to improve my check-materials.pl script. It could be more stable and then be used to generate the missing JPG files.

 

Also, this technique:

 

http://www.imagemagick.org/Usage/annotating/#wmark_image

 

might be used to draw some fake bumpmapping on the editor textures. That would give them more depth, and it would also mean that the stone textures where the features are only defined by the normal map, could be generated automatically.

 

Unfortunately, I don't know yet how to convert a normal map into a bumpmap....

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...