PDA

View Full Version : Question to Chris about material types in 3DS Max, which is puzzling me..



VinnyBarb
November 18th, 2015, 09:32 PM
Hi Chris or I guess anyone else who might know, say I have a main texture map (2048x2048) on an asset and use that same texture map with 3 different material types in 3DS Max. Say, the main material type where the main asset gets textured, apart from transparency or reflective or chrome. The second material type is, say, a transparent material type for windows etc. on the asset and the third material type is a reflective or even a gloss material type, again, all using the same main texture map referenced in the 3 different material types used in 3DS Max.

Does it mean, for each material type used on the asset, 3 instances of the same texture map is getting loaded into memory or does the program TS12 and TANE know, hey, we only need one instance of the main texture map to load into memory, as this is the same for all the 3 material types used?

Providing of course, the window texture and the gloss/reflective textures are incorporated into the main texture map as just some extra small textures on it with all other different textures assembled there.

Or would I be better off using the main texture map for the main part of the asset only and for the other 2 material types by using 2 extra texture maps, say, 24x24 pixels each (of course a slightly different colour pixel in each corner or TANE will spit a dummy), one for transparency/opacity and one for reflective/chrome I would need as above in the first scenario? Which of the 2 scenarios give a better performance for TS12 or TANE?

Thank you for any answers.

VinnyBarb

WindWalkr
November 18th, 2015, 10:32 PM
Does it mean, for each material type used on the asset, 3 instances of the same texture map is getting loaded into memory or does the program TS12 and TANE know, hey, we only need one instance of the main texture map to load into memory, as this is the same for all the 3 material types used?

Any given texture file on disk will only be loaded once into memory.

There are performance costs associated with having multiple materials in use, and this can be substantial relative to other rendering costs if the number of polygons involved is low, but that doesn't come from duplication of the texture.



Or would I be better off using the main texture map for the main part of the asset only and for the other 2 material types by using 2 extra texture maps, say, 24x24 pixels each

You should aim to have the texels-to-meters relationship remain fairly consistent across the mesh. If you have a very high ratio in some areas and a very low ratio in other areas, this will mess with the LOD algorithms and may either cause a visible reduction in texture quality or cause higher-detail mips to be loaded in unnecessarily, wasting GPU memory.

Between that problem, and the problem of introducing additional textures "unnecessarily", there's no single good choice. Your ideal scenario is of course to use a single material for the whole mesh. If you're dealing with high-detail meshes (multiple thousands of polygons, large textures) then I would probably split the textures to avoid wastage. If you're dealing with lower detailed meshes, I would first and foremost try to avoid having multiple materials because this is going to be a bigger cost than any of your other concerns.

chris

VinnyBarb
November 19th, 2015, 02:27 AM
Hey, thank you Chris, concise and to the point with your answer. It always bugged me which is the better of the 2 scenarios, now I do know. Realistically speaking when creating a good looking locomotive, one needs at least 2 or possible more material types, no way around it. Then we of course have the auto numbering which introduces some 9 to 16 extra different material types, depending on the fonts (bigger and smaller and different coloured numbers) used and also for the head board(s) which often have again a different number set there, meaning another material type on top of the others. I wonder if there is an easier way to set up auto numbering as is presently getting used by us?

Thank you again

VinnyBarb

WindWalkr
November 19th, 2015, 02:47 AM
Realistically speaking when creating a good looking locomotive, one needs at least 2 or possible more material types, no way around it.

The main thing to keep in mind here is that this is only true of the high LODs, where performance isn't so much of a concern anyway. As you drop LODs, you should also be dropping your material count, texture count, etc. The lowest LOD should definitely only have a single material.



Then we of course have the auto numbering which introduces some 9 to 16 extra different material types, depending on the fonts (bigger and smaller and different coloured numbers) used and also for the head board(s) which often have again a different number set there, meaning another material type on top of the others. I wonder if there is an easier way to set up auto numbering as is presently getting used by us?

You're right, the running numbers are horrible for performance. As above, you can mitigate this by dropping them out in the distant LODs. Longer term, it would be nice to replace these with something slightly more efficient- perhaps a system which can merge several such images and then apply it to the train in a single textured quad. It's questionable whether it's worth the effort- you're still going to want to drop it out during your LOD process, so all it's really buying you is a slight improvement in performance at the higher LODs.

chris

VinnyBarb
November 19th, 2015, 03:28 PM
When you mean above to "drop it out" re auto numbering in lesser LODs, I guess you mean culling the attachment points where auto numbering is attached to? Or is there something else I should know?

Thanks again for any answer

VinnyBarb

WindWalkr
November 19th, 2015, 07:45 PM
Simply don't use that feature in the lower-detail meshes.

chris

VinnyBarb
November 19th, 2015, 09:51 PM
Easier said then done, autonumbering is referenced in the config.txt, where one can not disable this.

Any other helpful hints?

VinnyBarb

WindWalkr
November 19th, 2015, 11:32 PM
Easier said then done, autonumbering is referenced in the config.txt, where one can not disable this.

Autonumbering works by replacing named textures in the mesh file. If the textures aren't used in the mesh file, then there is no autonumbering.

chris

VinnyBarb
November 20th, 2015, 04:51 PM
OK, I will try it. Thank you.

VinnyBarb