Specular map .mtl syntax for TG?

Started by PuffnStuff, March 20, 2026, 02:15:52 AM

Previous topic - Next topic

PuffnStuff

So... does anyone know the proper .mtl syntax to import a specular map through TG's obj importer?

TIA.

Dune

OBJ's don't import completely, AFAIK. It's better to import spec (and other) maps from the default shader within the object. And save as TGO for future use.

Kevin Kipper

#2
Great question.  I've done some research on this in the past and hopefully this may help.  Here's an example for one surface of an object exported in OBJ format and its associated MTL file.

newmtl Sidewinder_NotSmooth
Kd 0.95 0.95 0.95
Ke 1 0 1
Ka 1 1 0
Ks 0.5 1.0 1.0
Ns 500
Tr 0
d 0.5
Ni 1.123
Tf 0.5 0.2 0.8
map_Kd Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Color_1001.png
map_Ke Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Normal_1001.png
Bump Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Height_1001.png
map_Ks Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Metallic_1001.png
map_Bump Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Height_1001.png
map_Ns Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Roughness_1001.png
map_d Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Normal_1001.png
map_Pm Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Metallic_1001.png
map_Pr Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Metallic_1001.png
map_Ps  Z:/Library/Images/Vehicles/Air/Sidewinder_Missile/SidewinderMissile_SubPainter_v001_Metallic_1001.png


In a PBR Metallic Roughness workflow the metalness image provides the specular information.

You'll want to assign the image associated with the MTL's map_Ks parameter to the Default shader's Metalness image parameter in Terragen.  Currently Terragen does not automatically do this; but this behavior may be updated in the future.   The Metalness parameter should be set to a value of 1 because all three of the Default shader's metalness parameters are multiplied together for the final value.

The Default shader automatically maps the MTL's Ks value to the Default shader's Fresnel Reflectivity parameter.

PuffnStuff

Hi, Kipper -

Thanks for the response! Score. I spent a bit of time experimenting with .mtl imports over the last few weeks, and it seemed that getting a spec map loaded just didn't work - the only way was to manually load it. Which is fine. I was just looking for a way to streamline the workflow.

PuffnStuff

Oh, and the handling re: the metalness parameter handling was useful, too. :)