General Material File Help Please

I have a copy of example.mtr from when they were introduced. Is this still correct -

////////

// Specification of shaders to use.
// See the notes.txt for further details.
customshadervs vslitc_nm  
customshaderfs fslit_nm_rhi

// Assures that tangents are generated for the associated models.
renderhint NormalAndSpecMapped

////////

// Standard texture inputs
// Add/remove the '//' in front of the texture* to enable/disable these.

// 0 - Diffuse / albedo map.
// If omitted, it defaults to pure white.
//texture0 example_d 

// 1 - Normal map.
// If omitted, it defaults to all normals facing directly away from the surface. 
//texture1 example_n

// 2 - Specular map. Grayscale. 
// Should be in the 1% to 10% for non-metals and close to 100% for metals.
// If omitted, it will set a default value that fits most non-specular materials.
//texture2 example_s

// 3 - Roughness map. Grayscale.
// Determines the softness of specular reflection highlights to simulate smoothness of a surface.  
// If omitted, it will scale roughness with specularity
//texture3 example_r

// 4 - Height. Grayscale.
// Determines displacement and occlusion.
// If omitted, the surface will be rendered as if flat.
//texture4 example_h

// 5 - Glow / self-illumination map. Grayscale. 
// Makes the surface light up. 
// If omitted, it defaults to no self-illumination.
//texture5 example_i

////////

If it is, how do you indicate that certain maps are not available while later ones in the list are?

Thanks in advance.

TR

Tarot, up until PREVIEW 8193.21, this is what a MTR file looks like that would be using Diffuse, Normal, Specular, and Heightness maps. The “NULL” value for Texture3 and Texture5 tells the engine those maps are not used. Note, you could also remove Texture5, as nothing comes after it.

customshadervs vslit_nm
customshaderfs fslit_nm_rh 

renderhint NormalAndSpecMapped
texture0 example_d 
texture1 example_n
texture2 example_s
texture3 null
texture4 example_h
texture5 null

Note the custom shader names are different than what you had had in your op. These shaders can be found in the /ovr folder for patches 8193.16 and up.

If you are using PREVIEW 8193.21 (or later) the same MTR will look like this, as those custom shaders have now been removed and rolled into the standard shader:

renderhint NormalAndSpecMapped
texture0 example_d 
texture1 example_n
texture2 example_s
texture3 null
texture4 example_h
texture5 null
2 Likes

Thank you. I have a lot of fully public domain fancy mapped textures that were (mostly) not necessarily designed for the NwN scheme of things. Now that I have this information I can get on making them work with NwN.

FWIW the readme file that comes with the textures reads (relevant extract) -

CC0 1.0 Universal (CC0 1.0)
Public Domain Dedication
No Copyright
This license is acceptable for Free Cultural Works
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.

You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

So absolutely free to use or to modify in any kind of work (personal, commercial or else) =)

Please, don’t be an ass, don’t just resell it. ><

TR

Just another quick question. Can NwN EE happily handle 24 bit (RGB) textures or does it prefer 32 bit (RGBA)? Currently most of the textures that I am adapting all seem to have 32 bit but only use 24 bit which means that I could reduce the size of these textures by 25%…

Thanks in advance.

TR

1 Like

I always use 24-bit uncompressed RGB TGA textures which I then convert to Bioware DDS with Crunch. IIRC, the only TGAs that are 32-bit in my CC are those with an alpha channel.

1 Like

Thanks. I just needed to check before screwing up 300+ textures :scream_cat:

TR