Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Nn::mii::detail::ResourceTextureHeader
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Used on [[Nintendo Switch]] in NXTextureMidSRGB.dat, and on [[Nintendo Switch 2]] in OunceTextureMidSRGB.dat. == Naming == The file name is composed of four parts: <math display="inline">a \text{Texture} b c\text{.dat}</math>, where <math display="inline">a</math> is the console (NX, Ounce), <math display="inline">b</math> is the size (Mid, High, Poster), and <math display="inline">c</math> is the colorspace (Linear, SRGB). === On Switch 2 === Observed on Switch 2 ([https://switch2brew.org/w/index.php?title=Title_list title ID 0400000000000849]): * OunceTextureMidSRGB.dat * OunceTextureHighSRGB.dat High textures are 2x height and width compared to Mid textures. (Shapes are same across NX and Ounce.) While NX textures use Tegra swizzling, Ounce textures use Desktop Nvidia (Orin) swizzling<ref>https://github.com/ScanMountGoat/tegra_swizzle/compare/main...KillzXGaming:tegra_swizzle:main</ref>. Textures have been successfully extracted using [[Vee (Unofficial)|vfl-cli]] (although with inaccurate color channels..) == Struct Format (Header) == This sample is in the ImHex Pattern<ref>https://imhex.werwolv.net/</ref> format.<syntaxhighlight lang="c"> enum ResourceMemoryLevel : u8 { ResourceMemoryLevel_1=1, ResourceMemoryLevel_Min=1, ResourceMemoryLevel_2=2, ResourceMemoryLevel_3=3, ResourceMemoryLevel_4=4, ResourceMemoryLevel_5=5, ResourceMemoryLevel_6=6, ResourceMemoryLevel_7=7, ResourceMemoryLevel_8=8, ResourceMemoryLevel_Default=8, ResourceMemoryLevel_9=9, ResourceMemoryLevel_Max=9 }; enum ResourceCompressLevel : u8 { ResourceCompressLevel_0=0, // Z_NO_COMPRESSION ResourceCompressLevel_Min=0, ResourceCompressLevel_1=1, // Z_BEST_SPEED ResourceCompressLevel_2=2, ResourceCompressLevel_3=3, ResourceCompressLevel_4=4, ResourceCompressLevel_5=5, ResourceCompressLevel_6=6, ResourceCompressLevel_Default=6, ResourceCompressLevel_7=7, ResourceCompressLevel_8=8, ResourceCompressLevel_9=9, // Z_BEST_COMPRESSION ResourceCompressLevel_Max=9 }; struct ResourceCommonAttribute { // Size = 0x10 // Same size as FFLiResourcePartsInfo, identical up to compressLevel. u32 offset; u32 size; u32 compressedSize; u8 compressLevel; // ResourceCompressLevel // FFLiResourcePartsInfo: u8 windowBits; // FFLiResourceWindowBits u8 memoryLevel; // ResourceMemoryLevel / Verified but unused. // FFLiResourcePartsInfo: u8 strategy; // FFLiResourceStrategy u8 pad[2]; // Unused padding for alignment. }; enum ResourceTextureType : u8 { ResourceTextureType_Hat=0, ResourceTextureType_Eye=1, ResourceTextureType_Eyebrow=2, ResourceTextureType_Beard=3, ResourceTextureType_Wrinkle=4, ResourceTextureType_Make=5, ResourceTextureType_Glass=6, ResourceTextureType_Mole=7, ResourceTextureType_Mouth=8, ResourceTextureType_Mustache=9, ResourceTextureType_Noseline=10, ResourceTextureType_End=11 } ; struct ResourceTextureAttribute { // Size = 0xc // Same size as FFLiResourceTextureFooter, not identical. u32 alignment; u16 width; u16 height; u8 format; // ResourceTextureFormat u8 mipCount; u8 tileMode; // ResourceTileMode u8 _pad[1]; // Unused padding for alignment. } ; enum ResourceTileMode : u8 { ResourceTileMode_Optimal=0, ResourceTileMode_Linear=1, ResourceTileMode_End=2 } ; enum ResourceTextureFormat : u8 { // Matches FFL. ResourceTextureFormat_R8_Unorm=0, ResourceTextureFormat_R8_B8_Unorm=1, ResourceTextureFormat_R8_G8_B8_A8_Unorm=2, ResourceTextureFormat_BC4_Unorm=3, ResourceTextureFormat_BC5_Unorm=4, ResourceTextureFormat_BC7_Unorm=5, ResourceTextureFormat_Astc4x4_Unorm=6, ResourceTextureFormat_End=7 }; struct TextureElement { // ResourceTextureHeader::Element / Size = 0x1c ResourceCommonAttribute common; ResourceTextureAttribute texture; }; struct ResourceTextureHeader { // Size = 0x2428 u32 signature; // 0x5254464e / "NFTR" u32 version; // 1 u32 fileSize; // Includes size of header. u32 maxSize[11]; // ResourceTextureType_End u32 maxAlignment[11]; // Either 8 or 16. TextureElement hat[132]; // HairType_End TextureElement eye[62]; // EyeType_ResourceCount TextureElement eyebrow[24]; // EyebrowType_End TextureElement beard[2]; // BeardType_TextureCount TextureElement wrinkle[12]; // FacelineWrinkle_End TextureElement make[12]; // FacelineMake_End TextureElement glass[20]; // GlassType_End TextureElement mole[2]; // MoleType_End TextureElement mouth[37]; // MouthType_ResourceCount TextureElement mustache[6]; // MustacheType_End TextureElement noseline[18]; // NoseType_End }; ResourceTextureHeader resourcetextureheader_at_0x00 @ 0x00; </syntaxhighlight> == In Codebases == # [https://github.com/j0lol/vee/blob/f134e28eec22bdf8587d5abbf0f2d0f1ffc5b8a5/crates/vee_resources/src/tex.rs#L236 Vee Face Library] == References == <references />{{Resource-Navbox}}
Summary:
Please note that all contributions to Mii Technical Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Mii Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Hlist/styles.css
(
edit
)
Template:Navbox
(
edit
)
Template:Resource-Navbox
(
edit
)
Module:Arguments
(
edit
)
Module:Navbar
(
edit
)
Module:Navbar/configuration
(
edit
)
Module:Navbar/styles.css
(
edit
)
Module:Navbox
(
edit
)
Module:Navbox/configuration
(
edit
)
Module:Navbox/styles.css
(
edit
)
Module:TableTools
(
edit
)
Search
Search
Editing
Nn::mii::detail::ResourceTextureHeader
Add topic