Replies: 29 (Who?), Viewed: 38922 times.
Page 1 of 2
Mesh Maestro
Original Poster
#1 Old 25th Aug 2005 at 9:05 PM Last edited by leefish : 17th Jan 2014 at 7:45 PM.
Understanding The TXTR File and Formats
Understanding The TXTR File and Formats


DISCLAIMERThis is NOT a tutorial; it is intended to help average-experienced object creators performing specific tasks, or to give users a deeper in-sight on specific modding-related subjects. So, don't expect to find step-by-step explanations, to be performed "blindly". Please DO NOT REPOST the following info, or part of them, on other sites.

SUMMARY: This article gives in depth details about "Texture Format’s", their uses, Mipmap building, DDS plug-ins, tools and their use.The provided snapshots have been taken from UVMapper Pro and SimPE v.044.
This InfoCenter article is also provided in PDF format. To view it, we strongly suggest to download the Foxisoft PFD Viewer: it's free and small, less than 1Mb!

-------------------------------------------------------------------------------------




DDS Utilities and Tools

DDS Utilities allows our Mipmaps to be “automatically” built when importing a DDS format texture.

DDS Plug-ins when installed in our PhotoShop paint program gives us the versatility and usage of the DDS (image) texture format.
FAQ: DDS Plug-ins can only be installed in PhotoShop paint programs. If the DDS plug-in is used with PaintShop Pro, it will cause an error every time a "Save as... .dds" is attempted.


Mipmaps

What is a Mipmap? A Mipmap is a technique used to obtain a high level of detail represented by a two dimensional texture that is placed on a three dimensional mesh. A Mipmap is a composition of multiple images derived from one texture map at different resolutions to represent surface textures at varying distances from the viewer's perspective. The initial (largest) texture is placed in the foreground and progressively smaller ones recede toward the background. Though you can not see this in-game these maps are constantly changing as you zoom in and out. Each scale difference is defined as a MIP map level. MIP mapping helps avoid unwanted rough edges that sometimes can be noticed with other image (texture) formats at different resolutions.
FAQ: A Mipmap is composed of a series of images that are divisible by 2.

Other image formats that can be used in SimPE packages are: png, bmp, gif, tiff, wmf, emf, and jpg. The most widely used for a Sims2 package is the “png” format image due to its low resource and high detail. It is second only to DDS format and therefore very antiquate for usage in creating textures for our packages.


DDS Utility Formats

When you install DDS utilities you are obtaining multiple image/texture formats.
  • ExtRaw8Bit: Used mainly for shadow textures (grey scale) 8 bits per pixel.
  • Raw8Bit: Used mainly for shadow textures (grey scale) 8 bits per pixel.
  • Raw24Bit: Simple color texture format, 24 bits per pixel RGB color mode.
  • ExtRaw24Bit: color texture format, 24 bits per pixel RGB color mode.
  • Raw32Bit: Higher quality “Raw” color texture format 32 bits per pixel in RGBA color mode with 8 bits of color.
  • DXT1: Most commonly used for “normal” high quality textures (DXT1 does not support texture alpha data).
  • DXT3: Most commonly used textures utilizing a single “alpha” channel. DXT3 is most suited for textures with sharp alpha transitions, between translucent and opaque areas.
  • DXT5: Most commonly used for textures utilizing a varying amount of transparency. DXT5 formatted textures use an interpolated alpha scheme, they generally produce better results for transparency gradients than DXT3.
FAQ: Raw means “Unprocessed”.




Building a Mipmap

In our example our initial largest texture is 128 x 128. It is not large enough to cover the mesh and we are experiencing “stretching” and “blurring” so we would like to use a larger texture to eliminate this problem.



We decide that due to our larger mesh size that we need to make our largest “Mipmap” texture 512 x 512. The first step is to equate our new number of Mipmap levels. Multiplying by 2 we come up with the new Mipmap level amount of 10 so we need to enter “10” in the “Mipmap Level” field. Next, we need to click “Build”.


Now we can “Import” our new 512 x 512 texture map, “Update all Sizes”, “Commit” and “Fix Integrity”.



After we “Fix Integrity”, save and re-open our package we can see that our new mipmap is built by looking at the “Size” (see image below).










-------------------------------------------------------------------------------------

OTHER USEFUL RESOURCES

Modding InfoCenter Index - Comprehensive list of all the InfoCenter threads
Object Creation Workshop and Repair Center - If your object doesn't work, no matter what you try
Colour Options for "EP-ready" packages - About the texture linking tecniques
Sims 2 start to finish Object Creation Tutorial - Learn how to create your own object.




-------------------------------------------------------------------------------------




.
Screenshots
Download - please read all instructions before downloading any files!
File Type: rar Modding - InfoCenter - PDF - Understanding the TXTR (TextureFile).rar (353.9 KB, 724 downloads) - View custom content

Reading is the key to all knowledge, math is the key to everything.
Advertisement
Test Subject
#2 Old 25th Aug 2005 at 9:13 PM
Thanks JWoods. You must have read my mind. I was going to ask how to create the larger texture.
One horse disagreer of the Apocalypse
#3 Old 1st Oct 2005 at 7:44 PM
I'm afraid I didn't understand: "The first step is to equate our new number of Mipmap levels"

I have a largest texture image of 512x256 and I want to use one of 512x512. If the mipmap level currently is 9, what should I change it to?

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Mesh Maestro
Original Poster
#4 Old 1st Oct 2005 at 7:50 PM
Inge if your largest MipMap desired is 512*512 then there will end up being 10 levels:
512*512
256*256
128*128
64*64
32*32
16*16
8*8
4*4
2*2
1*1

Reading is the key to all knowledge, math is the key to everything.
One horse disagreer of the Apocalypse
#5 Old 1st Oct 2005 at 7:53 PM Last edited by Inge Jones : 1st Oct 2005 at 8:50 PM.
In that case SimPE must have sprung a bug. I had a feeling it would turn out to be 10 so I already tried it, but SimPE says I used an invalid parameter. Never mind I'll check if there's a newer version yet.

Later: I'm still getting the error message with the latest SimPE so I have reported it to Quaxi.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
One horse disagreer of the Apocalypse
#6 Old 2nd Oct 2005 at 2:11 PM
I know what's wrong now. The image in the file I am editing is not square, it's 256x512. SimPE doesn't want to know. If I try exactly the same moves on a square texture file, it's perfectly happy. Maybe I should enter 9.5?

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Mesh Maestro
Original Poster
#7 Old 2nd Oct 2005 at 2:31 PM Last edited by JWoods : 2nd Oct 2005 at 2:31 PM. Reason: typo
Inge: Regardless of size it should be divisible by 2 with the first entry being 1*1.

1x1
2x1
4x2
8x4
16x8
32x16
64x32
128x64
256x128
512x256

See how this still ultimately = 10?

Reading is the key to all knowledge, math is the key to everything.
One horse disagreer of the Apocalypse
#8 Old 2nd Oct 2005 at 2:36 PM
Maybe SimPE doesn't understand that it can legitimately be non-square. Anyway I filed a bug report to Quaxi last night. Since I wanted the texture square in any case, I simply cloned the shadow texture in order to make a base for my new textures, so at least I can get on with my object now. Thanks!

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
The ModFather
retired moderator
#9 Old 2nd Oct 2005 at 4:21 PM
I always deal with non-square images using the "Build DXT" function and the DDS utilities. The "Build DXT" is handy also when your new image hasn't the same dimensions of the original one.

Moreover, in the DDS window, you can set the number of mipmaps at will.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
One horse disagreer of the Apocalypse
#10 Old 2nd Oct 2005 at 5:00 PM
Ah right, I will remember that for the future. I only last night downloaded the Nvidia DDS stuff, so it's opened a new world for me

I'm getting so into meshing that all my hacking requests are building up - but it's so rewarding to actually *see* something you made in the game.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Lab Assistant
#11 Old 26th Jan 2009 at 7:22 PM
I beg your patience while I ask a stupid question (or two)...

1. Am I correct in assuming higher mipmap level = higher quality/detail of the texture?

2. What's the max number of mipmap levels? (~thinking Spinal Tap - can we crank it to 11?) Or 12 since it has to be divisible by 2?
Field Researcher
#12 Old 26th Jan 2009 at 8:36 PM
Quote:
Originally Posted by groovilicious
I beg your patience while I ask a stupid question (or two)...

1. Am I correct in assuming higher mipmap level = higher quality/detail of the texture?


I think, but not at all. In my objects I generally use 512x512, in the large ones. In small I use 512x512 too just for "texture work" (i prefer work in large files), but I can use 256, 128... Depends of the mesh. If your mesh is big, the big textures will be better. In small mesh, small textures will be perfect, using large textures in them will be *almost* no difference

Quote:
Originally Posted by groovilicious
2. What's the max number of mipmap levels? (~thinking Spinal Tap - can we crank it to 11?) Or 12 since it has to be divisible by 2?


I've never work with more than 10. But I don't think it's necessary.
Scholar
#13 Old 26th Jan 2009 at 9:22 PM Last edited by pixelhate : 27th Jan 2009 at 8:49 AM.
The texture size determines the mip map level : 512x512 =10, 1024X1024=11, 2048x2048= 12 etc.
Level of Mipmap is a consequence of the texture size. The bigger texture, the higher mipmap will be. (As explained by JWoods in post #5 & #7)
More Mipmap doesn't improve texture quality.

Understand Material definition-TXMT and customize the look of your objects ! This way

"The longer something exists in this world, the more wear and tear it will have."
Lab Assistant
#14 Old 27th Jan 2009 at 3:06 AM
Ok, thank you for the replies! Um, I'm working on a mirror with a stained glass decor overlay, and while I employed the DXT builder to make my texture for the decor/overlay 512 x 512, the mipmap level was at 7 until I manually changed it to 10 following the instructions above.

I assume that the 7 existed from the previous (the cloned object's) texture, which was originally 128 x 128 (I think). So, what I'm trying to say (and terrible at explaining myself at times) is that the DXT Builder did *not* change my mipmap level automatically in this case (if that's what you meant Pixelhate by 'consequence'?). So now I'm wondering what changed when I changed the mipmap level from 7 to 10? The number of smaller zooms? And if I want a higher quality texture from my 512 x 512 .png, should I increase the DXT from 3 to 5? Will increasing the DXT level affect the transparency of the decor? Do I need to ask the last 2 questions somewhere else? :D

Thanks again for your time!
Scholar
#15 Old 27th Jan 2009 at 8:30 AM
Let's pretend you have a 512 texture with mip map level 1. What will happen ?
If you zoom out very far and even if you don't noticed any detail of your texture, you object is still calling the big texture, putting useless strain on the computer for no visible result.

If you have a 512 texture with correct mip map, the computer will choose the appropriate size to render at the appropriate distance ( like 1x1 for extreme far distance). Performances of the computer will be kept at best.

If you change the size of the texture to larger, you'll have to adjust the mip map level manually, just like you did. When building with smaller size than original, the level will be adapted automatically.

Dxt1 is perfect for most textures if they don't need transparency to be shown.
Dxt3 is needed if you want to have an Alpha Channel (transparency). But final file will be bigger.
Dxt5 may increase the visual of the texture (especially when dealing with subtle transparency) BUT it will considerably increase your file size too.

When building dxt, setting the sharpen filter to none will help for neater texture.

Of course, the starting texture will influence everything. You can't hope to improve the quality of a poor texture with the dxt features.

Understand Material definition-TXMT and customize the look of your objects ! This way

"The longer something exists in this world, the more wear and tear it will have."
The ModFather
retired moderator
#16 Old 27th Jan 2009 at 9:04 AM
A trick to be sure to have the right number of mipmaps:

when you are importing the texture using the "Build DXT" function, and the DDS Utilities window is open, set the number of mipmaps to a high value such as 15; then import the texture. The DDS utilities will automatically reduce the mipmaps to the right value.

Note: the DDS utilities can't increase a low value: they can only cut down a high value.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Scholar
#17 Old 27th Jan 2009 at 9:13 AM
ModFather, while you are there... a question. The tut says to update all sizes, but I was thinking this step isn't necessary when using Build function. Can you confirm ?
And what about the fix integrity thinggy ?

Understand Material definition-TXMT and customize the look of your objects ! This way

"The longer something exists in this world, the more wear and tear it will have."
The ModFather
retired moderator
#18 Old 27th Jan 2009 at 2:40 PM
You're right: the "Update all sizes" must NOT be performed when using the DDS utilities; updating would actually ruin the good work of the DDS utilities.
And also clicking the "Build" button (so to rebuild the mipmaps) must be skipped, when using the Build DXT function.

As for fixing integrity, in general it doesn't harm; but frankly I'd skip that passage, too If you are creating an object that uses a Maxis repository, the Fix Integrity may break some links, putting an unwanted ##0x1c050000! prefix where it is NOT supposed to be...

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Lab Assistant
#19 Old 27th Jan 2009 at 2:55 PM
Ah! Some interesting info there pixelhate and Numenor!

I do my best to make my textures as clean and clear as I can, and I'm ok with the file size with the DXT builder at 3. I may have been fuzzying my smaller zooms because it's become a habit to 'update all sizes', so I'll try to practice *not* doing that when I'm using the DXT builder... I may experiment and see how horrendous the file size gets with the DXT set at 5, just for kicks... Great to know I can plug in the mipmap level when using the Builder as well!

But I honestly and mistakenly thought that the mipmap had something to do with texture detail until I read this thread and asked questions! (maybe my brain equated to something like bump map? - who knows! )

Thank so much for everyone's time! Interesting and informative discussion!
Scholar
#20 Old 27th Jan 2009 at 8:21 PM
Not wanting to confuse people, I feel the need to precise something.

There're two ways of briging a texture (and/or changing its size) in SimPE.

One is, as described here by JWoods:
Using Build function to adjust the Mipmap level
Then import new texture via Import button.
Then update all sizes.
Commit & save.
This method works and is, of course, correctly described in the tutorial.

The second way is:
Right clicking on the texture, choosing Build DXT option.
In pop up window, adjusting the Mipmap level, choosing the Sharpen filter setting, selecting DXT type (1,3,5) and opening the new texture.
Commit & save.
No need to update all sizes.

The second way offers often better results for texture distinctness, in my opinion.

It's describred in step 3 of this tutorial.

Understand Material definition-TXMT and customize the look of your objects ! This way

"The longer something exists in this world, the more wear and tear it will have."
Lab Assistant
#21 Old 28th Jan 2009 at 3:30 PM
Well done on the clarification pixelhate! Thank you!

Aside: Just in case someone is interested - with the mirror I'm working on, increasing the DXT from 3 to 5 didn't increase my file size at all - dunno why... I had to use DXT3 because I'm working with transparency - the original file size with DXT3 was 556k and that's where it stayed when I upped it to 5! Additionally, the increase from 3 to 5 didn't make any apparent-to-my-eye improvements in the quality of texture either...

Thanks again to everyone for all the good info!
The ModFather
retired moderator
#22 Old 28th Jan 2009 at 9:00 PM
As far as I know, the DXT5 is *always* bigger than the DXT3. Is it possible that you didn't click Commit, after changing the format to DXT5?

And I agree that often there are no visual improvements using the DXT5: it should be used only if - for whatever reason - the DXT3 doesn't compress the image correctly, and creates artefacts, pixelization and colour bleeding.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Lab Assistant
#23 Old 29th Jan 2009 at 12:55 AM
Um, I'm pretty sure Numenor, the recolors I did also came up as DXT5 when I created them. I have the files, I name them differently as I go along, so I always have my steps backwards (if that makes sense); if you're *really* curious about peaking between the two, I can send them... They're not the finished product, as I'm continuing to tweak and rename, but you're welcome to see them...

I was planning to send you some pictures of my finished product, just in case you might enjoy seeing what your good work helps create... So, check your PMs tomorrow!

EDIT TO ADD: I went looking back through my last 3 days files, and the packages where I cranked the reflection up on the decor have a significant (I think) file size increase (and isn't in my final version)... that's the only place I see a noticeably different file size...
Test Subject
#24 Old 9th Nov 2009 at 8:15 PM
I'm looking for answers on how fits a 5x5 tiles texture, should it be 1280x1280 image? how many levels it needs? Sorry if the answer is already there, but I'm reading so many things that maybe I am missing something.

What I'm trying to design is a diagonal rail track, it needs to be in a 2x2 tile plus the turning connection which maybe should be in 5x5 and is giving me too many troubles to get it working.
Scholar
#25 Old 9th Nov 2009 at 10:37 PM Last edited by pixelhate : 10th Nov 2009 at 7:53 AM.
1280x 1280 is not an acceptable size (not a power of 2), should be 512x512, 1024x1024, 2048x2048, 4096x4096, etc.

When building your new texture via DDS, to have the correct level of mipmap, just follow the advice given by Numenor in post #16, which is :
"when you are importing the texture using the "Build DXT" function, and the DDS Utilities window is open, set the number of mipmaps to a high value such as 15; then import the texture. The DDS utilities will automatically reduce the mipmaps to the right value."

To have a 2x2 tile matching with a 5x5 tile will require some calculation.
But supposing we're talking about floor or terrain, aren't you working with HomeCrafter?

Understand Material definition-TXMT and customize the look of your objects ! This way

"The longer something exists in this world, the more wear and tear it will have."
Page 1 of 2
Back to top