Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Texture window request
Goto page 1, 2  Next
 
Post new topic   Reply to topic    DeleD Community Edition Forum Index -> DeleD Feature Requests
View previous topic :: View next topic  
Author Message
yertari
DeleD PRO user


Joined: 13 Aug 2005
Posts: 33

PostPosted: Tue Mar 28, 2006 3:19 pm    Post subject: Texture window request Reply with quote

I have over 500 textures that i need to put in a cateogry, but it just cannot be done - because firstly, i cannot select all the textures at once, and the texture window above to put them into cannot be resized.

Now.. you might say make smaller categories, but it would mean, that i would have hundreds of sub categories and i dont want to do this.

Can you help?

Cheers
Steve
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5334
Location: The Netherlands

PostPosted: Tue Mar 28, 2006 3:30 pm    Post subject: Reply with quote

At first, I would still recommend making smaller categories. Surely having 500 textures would not have to result into hunderds of sub categories. Only a few dozen if you do this in a clever way.

But... we're alway open for alternative ways to handle textures/materials. Suggestions anyone?

I'm not sure what the problem is with the texture window not being able to be resized. Can you elaborate?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest






PostPosted: Tue Mar 28, 2006 4:16 pm    Post subject: Reply with quote

Well, i cannot make the scene materials window bigger - so i cant add say more than 20 textures to it. Surely it would be better for these windows to be allowed to resize.


In fact wouldnt it be much easier, to simply insert all the textures you want into the TEXTURES directory, and for these to show up when you load DeleD, so i do not need to make categories from within DeleD, but i can create my own categories in the TEXTURE folder, and these be auto loaded.

Please do this!

I have a situation now, where i have 50 textures, but i cant resize the window bigger to add them too

Cheers

Steve
Back to top
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Tue Mar 28, 2006 5:37 pm    Post subject: Reply with quote

Code:
//TextureLoad.cpp
//Place this .exe file in your texture folder and run the program
//it will scan all the texture file names and create a
//dmf file with all the textures loaded into it that you
//can load up and use as is

#include <string>
#include <iostream>
#include <fstream>
#include <direct.h>
#include <io.h>
#include <conio.h>

using namespace std;

int main(void)
{
    char input[256];
    char sub[256];
    char cat[256];
    char searchstring [ ] = "*.*";

    cout << "DMF Texture Load\n\n";

    enterfilename:
    cout << "Enter the name of the DMF File to be created.\n";
    cout << "Name: (eg test.dmf) -> "; cin.getline(input,256);

    if (strstr(input,".dmf") == NULL)
    {
        cout << "\n\nERROR: You must have '.dmf' at the end of your filename...\n\n";
        goto enterfilename;
    }

    //get the current working directory name
    _getcwd(sub,sizeof(sub));
    int k;
    for (k = strlen(sub); k > 0; --k)
    {
        if (sub[k] == '\\') break;
    }
    sprintf(cat,&sub[k+1]);
    cout << "Category: " << cat << endl;

    //count all the files in the areas subfolder
    int files = 0;
    intptr_t handle;
    _finddata_t filedata;

    handle = _findfirst(searchstring,&filedata);
    if (handle == -1)
    {
        cout << "Error: No texture files found.\n\n";
        cout << "\n\nGoodbye!\nPress a key to quit\n\n"; _getch();
        _findclose(handle);
        return false;
    }

    do
    {
        if (strstr(filedata.name,".bmp") == NULL &&
                strstr(filedata.name,".jpg") == NULL &&
                    strstr(filedata.name,".tga") == NULL)
                    {
                        continue;
                    }
        else ++files;
    } while  (_findnext(handle,&filedata) != -1);

    _findclose(handle);

    //allocate filenames
    string* texs = NULL;
    texs = new string[files];
    if (texs == NULL)
    {
        cout << "Error: Out of Memory.\n\n";
        cout << "\n\nGoodbye!\nPress a key to quit\n\n"; _getch();
        return false;
    }

    int i = 0;
    handle = _findfirst(searchstring,&filedata);
    do
    {

        if (strstr(filedata.name,".bmp") == NULL &&
                strstr(filedata.name,".jpg") == NULL &&
                    strstr(filedata.name,".tga") == NULL)
                    {
                        continue;
                    }

        texs[i] = filedata.name;
        cout << "Found texture " << texs[i] << "\n";

        ++i;
        if (i >= files) break;
    } while  (_findnext(handle,&filedata) != -1);

    _findclose(handle);

    //write out a DMF file
    fstream dmf;

    dmf.open(input,fstream::out|fstream::trunc);
    if (!dmf.is_open())
    {
        cout << "Error: Could not create file.\n";
        cout << "\n\nGoodbye!\nPress a key to quit\n\n"; _getch();
        return false;
    }

    dmf << "DeleD Map File;\n";
    dmf << "Version 1.1;\n";
    dmf << "no-name-yet;00FFFFFF;75;\n";
    dmf << files << ";\n";

    for (int j = 0; j < files; ++j)
    {
        dmf << j << ";"; // id
        dmf << "auto_mat_" << j << ";";         // name
        dmf << "auto_mat" << ";";               // category
        dmf << "0" << ";";                      // reserved
        dmf << "1" << ";";                      // layers
        dmf << "0" << ",";                      // layer type
        dmf << cat << "\\" << texs[j] << ",";   // layer filename
        dmf << "1" << ";\n";                    // layer blend op
    }

    dmf << "0;\n";  // <-- No Objects
    dmf << "0;\n";  // <-- No Lights

    dmf.close();

    cout << "\n\nGoodbye!\nPress a key to quit\n\n"; _getch();

    return true;
}


Here you go. I read this post and coded this up. Compile it, and place it in your textures subfolder eg: Deled\textures\Yertari... it will add all the bmp, tga, and jpg files it finds into a blank DMF File. Move this file into the Deled maps folder, then you can load this new file up and have all your textures...
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5334
Location: The Netherlands

PostPosted: Tue Mar 28, 2006 6:02 pm    Post subject: Reply with quote

Anonymous wrote:
Well, i cannot make the scene materials window bigger - so i cant add say more than 20 textures to it. Surely it would be better for these windows to be allowed to resize.

In fact wouldnt it be much easier, to simply insert all the textures you want into the TEXTURES directory, and for these to show up when you load DeleD, so i do not need to make categories from within DeleD, but i can create my own categories in the TEXTURE folder, and these be auto loaded.


We'll definately look into the resizing problem, thanks for mentioning!

Simply inserting all textures is not really an option, I think, because it would drain resources fast. Each texture has to be loaded into graphics memory for the 3D view and be used for GUI elements like the Material picker. Can you imagine the amount of memory having to be available if you want 500+ textures to load properly? That's one of the reasons we invented categories - to limit the textures needed in scenes. Another big advantage, imho, is that this makes the artist think about what exactly he would like to do. And, finally, having your textures conviniently stored in a clever categorized system, makes finding them back again much easier.

Feel free to try VD's code, should be a good stress-test. Keep in mind, 500+ textures might run well on your system, but might crash out on someone elses.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Tue Mar 28, 2006 6:22 pm    Post subject: Reply with quote

Jeroen wrote:
Feel free to try VD's code, should be a good stress-test. Keep in mind, 500+ textures might run well on your system, but might crash out on someone elses.
Depends on the size of these textures. My old VTM level editor used to load up some 300-600 (256x256 and below) textures at a time. Was never a problem on my old 32mb TNT 2.

Also, the unused textures from the working set are usually stripped when exporting .dmf to the target file.

Also, there's a "bug" in my above dmf creator in that it doesn't load the default Deled textures such as 'system' and the rest. You can easily add these back after loading your file up. The only category will be 'auto_mat' with all your textures in there.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5334
Location: The Netherlands

PostPosted: Tue Mar 28, 2006 6:45 pm    Post subject: Reply with quote

Vampyre_Dark wrote:
Jeroen wrote:
Feel free to try VD's code, should be a good stress-test. Keep in mind, 500+ textures might run well on your system, but might crash out on someone elses.
Depends on the size of these textures. My old VTM level editor used to load up some 300-600 (256x256 and below) textures at a time. Was never a problem on my old 32mb TNT 2.


Agreed. But nowadays texture-sizes are increasing. Ok, so memory-size is growing too. Nevertheless, I think it is generally not a good idea to have 500+ available, even with a category system installed. However, implementing some sort of "Add all..." method isn't hard and the user can try and see for himself how many textures load up fine in his situation. Added to our TODO list!

We really need to sit down and sort our TODO list based on priority. 248 items and counting...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Tue Mar 28, 2006 6:58 pm    Post subject: Reply with quote

Jeroen wrote:
But nowadays texture-sizes are increasing.
For whom? The average DeleD user? That's kind of on a user by user basis. In any given scene you can easy eat through a few hundred textures quicker than you would believe. Especially if you want professional looking results.

You need variation. If you just want to do a small medieval outdoor village, you can use up 20+ textures just for the different variations of the curves in the dirt road / grass.

Every type of brick for all the houses will have 2 or 3 small variations. Either to break up the pattern, or to have lower, middle and upper parts.

Then you have lots of small textures for the insides of window frames, and little surfaces like that.

It goes really quick.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Guest






PostPosted: Tue Mar 28, 2006 7:04 pm    Post subject: Reply with quote

Guys... i will carry on singing the praises of the DeleD community, both members and staff - where else would you get someone code something like that for a fellow member

I salute you!

Thankyou kindly for all this great support - im gonna try that code now

Cheers

Steve
Back to top
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5334
Location: The Netherlands

PostPosted: Tue Mar 28, 2006 7:20 pm    Post subject: Reply with quote

Vampyre_Dark wrote:
For whom? The average DeleD user? That's kind of on a user by user basis. In any given scene you can easy eat through a few hundred textures quicker than you would believe. Especially if you want professional looking results.

You need variation. If you just want to do a small medieval outdoor village, you can use up 20+ textures just for the different variations of the curves in the dirt road / grass.

Every type of brick for all the houses will have 2 or 3 small variations. Either to break up the pattern, or to have lower, middle and upper parts.

Then you have lots of small textures for the insides of window frames, and little surfaces like that.

It goes really quick.


I understand that perfectly. But that's still no reason to just dump all the textures you have into a program. We're talking about 500+ here but one could also easily add 10.000+ textures, just because it's easy to do so. Ok, so we're going to allow that in DeleD but that doesn't mean it's a good idea, imho. You need variation. You need it in a categorized way. You need to think about what you want + need before you start modelling.

Oh well, I guess we could discuss this until we're both old and grey. It's already added to the TODO list anyway. Laughing
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Tue Mar 28, 2006 7:45 pm    Post subject: Reply with quote

What idiot would load 10,000 textures. Add this feature: If anyone does that, send a fine for 50,00$ out to the printer. Laughing

I'm not arguing for or against any features here. Just arguing against what I perceived to be a "20 textures should be enough for a scene" argument. Laughing
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5334
Location: The Netherlands

PostPosted: Tue Mar 28, 2006 7:54 pm    Post subject: Reply with quote

Vampyre_Dark wrote:
What idiot would load 10,000 textures. Add this feature: If anyone does that, send a fine for 50,00$ out to the printer. Laughing

I'm not arguing for or against any features here. Just arguing against what I perceived to be a "20 textures should be enough for a scene" argument. Laughing


Haha, I can see why you would misunderstand me. But indeed, that's not what I meant. I just meant this: if we allow 10.000 textures to be added to DeleD, some idiot (and probably more than one) will stand up and try it. Laughing That same idiot will then come to our forums complaining DeleD hung up on him and demanding a new solution from us. Thrust me, it happens. Wink

Nevertheless, Yertari would not do that as he knows what he's doing. And it's still a handy feature to have, if you know what you're doing. So here you go. Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CMe
Member


Joined: 30 Jun 2005
Posts: 72
Location: Ontario Canada

PostPosted: Tue Mar 28, 2006 8:37 pm    Post subject: Reply with quote

Regarding the material editor. Are the "thumbnail" images being loaded using the full resolution or as a reduced set ie. mipmapped. This would reduce memory usage considerably if this isn't the case. A similar solution could be made for the 3D editor window too. Use lower resolution maps if memory consumption gets too big. Just a thought.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
afecelis
DeleD PRO user


Joined: 08 Aug 2004
Posts: 427
Location: Colombia

PostPosted: Wed Mar 29, 2006 4:48 am    Post subject: Reply with quote

Hey VD! many thanks for writing that interesting app! Very Happy works nicely!
well done!

ps. Should anyone be interested in the app you can grab it here:
http://www.danielpatton.com/afecelis/Deled/TextureLoad.zip
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Daaark
DeleD PRO user


Joined: 01 Sep 2004
Posts: 2696
Location: Ottawa, Canada

PostPosted: Wed Mar 29, 2006 5:34 am    Post subject: Reply with quote

Dammit -
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    DeleD Community Edition Forum Index -> DeleD Feature Requests All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum